diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-06 19:54:52 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:49 +0200 |
commit | 3d2406f47c732f9d0693f7ca27ff992432027705 (patch) | |
tree | 5807a23dbd58996efd395bd00be4f8636b7bb653 /tests | |
parent | 4b67f2ccbff8be080c4f3a8384c5cfd4fd1f4f31 (diff) |
Use do_run_from_file() for test_hello_world
Diffstat (limited to 'tests')
-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' |