tests: test nitunit `NIT_TESTING_PATH`
authorAlexandre Terrasa <alexandre@moz-code.org>
Mon, 28 Nov 2016 21:11:38 +0000 (16:11 -0500)
committerAlexandre Terrasa <alexandre@moz-code.org>
Mon, 28 Nov 2016 21:11:38 +0000 (16:11 -0500)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

tests/nitunit.args
tests/sav/nitunit_args10.res [new file with mode: 0644]
tests/test_nitunit5.nit [new file with mode: 0644]

index f0bc3ee..6474d63 100644 (file)
@@ -7,3 +7,4 @@ test_nitunit3 --no-color -o $WRITE
 test_nitunit_md.md --no-color -o $WRITE
 test_doc3.nit --no-color -o $WRITE
 test_nitunit4 --no-color -o $WRITE
+test_nitunit5.nit --no-color -o $WRITE
diff --git a/tests/sav/nitunit_args10.res b/tests/sav/nitunit_args10.res
new file mode 100644 (file)
index 0000000..5fdb314
--- /dev/null
@@ -0,0 +1,8 @@
+==== Test-suite of module test_nitunit5::test_nitunit5 | tests: 2
+[OK] test_nitunit5$TestNitunit5$test_path_is_set
+[OK] test_nitunit5$TestNitunit5$test_path_is_suite_path
+
+Docunits: Entities: 4; Documented ones: 0; With nitunits: 0
+Test suites: Classes: 1; Test Cases: 2; Failures: 0
+[SUCCESS] All 2 tests passed.
+<testsuites><testsuite package="test_nitunit5::test_nitunit5"></testsuite><testsuite package="test_nitunit5"><testcase classname="nitunit.test_nitunit5.TestNitunit5" name="test_path_is_set" time="0.0"><system-err></system-err></testcase><testcase classname="nitunit.test_nitunit5.TestNitunit5" name="test_path_is_suite_path" time="0.0"><system-err></system-err></testcase></testsuite></testsuites>
\ No newline at end of file
diff --git a/tests/test_nitunit5.nit b/tests/test_nitunit5.nit
new file mode 100644 (file)
index 0000000..602648b
--- /dev/null
@@ -0,0 +1,29 @@
+# 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.
+
+module test_nitunit5 is test_suite
+
+import test_suite
+
+class TestNitunit5
+       super TestSuite
+
+       fun test_path_is_set do
+               assert "NIT_TESTING_PATH".environ != ""
+       end
+
+       fun test_path_is_suite_path do
+               assert "NIT_TESTING_PATH".environ.basename == "test_nitunit5.nit"
+       end
+end