diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/test_assert.in | 9 | ||||
-rw-r--r-- | tests/core/test_assert.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 14 |
3 files changed, 14 insertions, 10 deletions
diff --git a/tests/core/test_assert.in b/tests/core/test_assert.in new file mode 100644 index 00000000..7547468e --- /dev/null +++ b/tests/core/test_assert.in @@ -0,0 +1,9 @@ + + #include <stdio.h> + #include <assert.h> + int main() { + assert(1 == true); // pass + assert(1 == false); // fail + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_assert.out b/tests/core/test_assert.out new file mode 100644 index 00000000..870c1784 --- /dev/null +++ b/tests/core/test_assert.out @@ -0,0 +1 @@ +Assertion failed: 1 == false
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index 030d8875..2629589b 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1064,16 +1064,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co self.do_run(src, 'sizeofs:6,8\n*C___: 0,6,12,20<24*\n*Carr: 0,6,12,20<24*\n*C__w: 0,6,12,20<24*\n*Cp1_: 4,6,12,20<24*\n*Cp2_: 0,6,12,20<24*\n*Cint: 0,8,12,20<24*\n*C4__: 0,8,12,20<24*\n*C4_2: 0,6,10,16<20*\n*C__z: 0,8,16,24<28*') def test_assert(self): - src = ''' - #include <stdio.h> - #include <assert.h> - int main() { - assert(1 == true); // pass - assert(1 == false); // fail - return 0; - } - ''' - self.do_run(src, 'Assertion failed: 1 == false') + test_path = path_from_root('tests', 'core', 'test_assert') + src, output = (test_path + s for s in ('.in', '.out')) + + self.do_run_from_file(src, output) def test_libcextra(self): if self.emcc_args is None: return self.skip('needs emcc for libcextra') |