diff options
-rw-r--r-- | tests/core/test_hello_world.in | 8 | ||||
-rw-r--r-- | tests/core/test_hello_world.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 13 |
3 files changed, 13 insertions, 9 deletions
diff --git a/tests/core/test_hello_world.in b/tests/core/test_hello_world.in new file mode 100644 index 00000000..d9ca3acb --- /dev/null +++ b/tests/core/test_hello_world.in @@ -0,0 +1,8 @@ + + #include <stdio.h> + int main() + { + printf("hello, world!\n"); + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_hello_world.out b/tests/core/test_hello_world.out new file mode 100644 index 00000000..30f51a3f --- /dev/null +++ b/tests/core/test_hello_world.out @@ -0,0 +1 @@ +hello, world!
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index b3e57490..fde5c8ca 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -10,15 +10,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co return not ('i386-pc-linux-gnu' in COMPILER_OPTS or self.env.get('EMCC_LLVM_TARGET') == 'i386-pc-linux-gnu') def test_hello_world(self): - src = ''' - #include <stdio.h> - int main() - { - printf("hello, world!\\n"); - return 0; - } - ''' - self.do_run(src, 'hello, world!') + test_path = path_from_root('tests', 'core', 'test_hello_world') + src, output = (test_path + s for s in ('.in', '.out')) + + self.do_run_from_file(src, output) assert 'EMSCRIPTEN_GENERATED_FUNCTIONS' not in open(self.in_dir('src.cpp.o.js')).read(), 'must not emit this unneeded internal thing' |