tests: test --define in engines
authorJean Privat <jean@pryen.org>
Fri, 10 Oct 2014 22:54:42 +0000 (18:54 -0400)
committerJean Privat <jean@pryen.org>
Sat, 11 Oct 2014 00:02:43 +0000 (20:02 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

tests/nit.args
tests/nitg.args
tests/niti.skip
tests/sav/nit_args4.res [new file with mode: 0644]
tests/sav/nitg_args8.res [new file with mode: 0644]
tests/sav/test_define.res [new file with mode: 0644]
tests/test_define.nit [new file with mode: 0644]

index 3011fc1..0c14c1c 100644 (file)
@@ -1,3 +1,4 @@
 --log --log-dir out/test_nitc_logs ../examples/hello_world.nit
 base_simple3.nit
 -m test_mixin.nit ../examples/hello_world.nit
+test_define.nit -D text=hello -D num=42 -D flag
index 3b38c54..6a47146 100644 (file)
@@ -5,3 +5,4 @@
 --global ../examples/hello_world.nit -m test_mixin.nit -o out/nitg-hello_world_mixed ; out/nitg-hello_world_mixed
 --separate ../examples/hello_world.nit -m test_mixin.nit -o out/nitgs-hello_world_mixed ; out/nitgs-hello_world_mixed
 base_simple_import.nit base_simple.nit --dir out/ ; out/base_simple ; out/base_simple_import
+test_define.nit -D text=hello -D num=42 -D flag --dir out/ ; out/test_define
index c052cff..baf5b76 100644 (file)
@@ -5,6 +5,7 @@ shoot_logic
 bench_
 nit_args1
 nit_args3
+nit_args4
 nitvm_args1
 nitvm_args3
 nitc_args1
@@ -12,6 +13,7 @@ nitg_args1
 nitg_args3
 nitg_args5
 nitg_args6
+nitg_args8
 test_markdown_args1
 pep8analysis
 nitcc_parser_gen
diff --git a/tests/sav/nit_args4.res b/tests/sav/nit_args4.res
new file mode 100644 (file)
index 0000000..483d841
--- /dev/null
@@ -0,0 +1,3 @@
+hello
+42
+true
diff --git a/tests/sav/nitg_args8.res b/tests/sav/nitg_args8.res
new file mode 100644 (file)
index 0000000..483d841
--- /dev/null
@@ -0,0 +1,3 @@
+hello
+42
+true
diff --git a/tests/sav/test_define.res b/tests/sav/test_define.res
new file mode 100644 (file)
index 0000000..8d40171
--- /dev/null
@@ -0,0 +1,3 @@
+some text
+1
+false
diff --git a/tests/test_define.nit b/tests/test_define.nit
new file mode 100644 (file)
index 0000000..4b8ebc7
--- /dev/null
@@ -0,0 +1,20 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+fun text: String do return "some text"
+fun num: Int do return 1
+fun flag: Bool do return false
+print text
+print num
+print flag