diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/test_fakestat.in | 10 | ||||
-rw-r--r-- | tests/core/test_fakestat.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 15 |
3 files changed, 15 insertions, 11 deletions
diff --git a/tests/core/test_fakestat.in b/tests/core/test_fakestat.in new file mode 100644 index 00000000..9a09b57c --- /dev/null +++ b/tests/core/test_fakestat.in @@ -0,0 +1,10 @@ + + #include <stdio.h> + struct stat { int x, y; }; + int main() { + stat s; + s.x = 10; + s.y = 22; + printf("*%d,%d*\n", s.x, s.y); + } +
\ No newline at end of file diff --git a/tests/core/test_fakestat.out b/tests/core/test_fakestat.out new file mode 100644 index 00000000..fbb3ab3c --- /dev/null +++ b/tests/core/test_fakestat.out @@ -0,0 +1 @@ +*10,22*
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index 6349d47c..01154605 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -4476,17 +4476,10 @@ return malloc(size); self.do_run_from_file(src, output) def test_fakestat(self): - src = r''' - #include <stdio.h> - struct stat { int x, y; }; - int main() { - stat s; - s.x = 10; - s.y = 22; - printf("*%d,%d*\n", s.x, s.y); - } - ''' - self.do_run(src, '*10,22*') + test_path = path_from_root('tests', 'core', 'test_fakestat') + src, output = (test_path + s for s in ('.in', '.out')) + + self.do_run_from_file(src, output) def test_mmap(self): if self.emcc_args is None: return self.skip('requires emcc') |