diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 13:06:16 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:56 +0200 |
commit | 1de317c109dbdcfe403eef51708b41374697fed7 (patch) | |
tree | 0d1a624317b926f97c0cfeb1f0824945002f56fb | |
parent | 6727994eb193435c0f3c16b701d58f23c5f0e86d (diff) |
Use do_run_from_file() for test_tinyfuncstr
-rw-r--r-- | tests/core/test_tinyfuncstr.in | 13 | ||||
-rw-r--r-- | tests/core/test_tinyfuncstr.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 15 |
3 files changed, 17 insertions, 12 deletions
diff --git a/tests/core/test_tinyfuncstr.in b/tests/core/test_tinyfuncstr.in new file mode 100644 index 00000000..ea07ff33 --- /dev/null +++ b/tests/core/test_tinyfuncstr.in @@ -0,0 +1,13 @@ + + #include <stdio.h> + + struct Class { + static char *name1() { return "nameA"; } + char *name2() { return "nameB"; } + }; + + int main() { + printf("*%s,%s*\n", Class::name1(), (new Class())->name2()); + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_tinyfuncstr.out b/tests/core/test_tinyfuncstr.out new file mode 100644 index 00000000..ed0d2567 --- /dev/null +++ b/tests/core/test_tinyfuncstr.out @@ -0,0 +1 @@ +*nameA,nameB*
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index adbe1826..25daae15 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1999,20 +1999,11 @@ def process(filename): def test_tinyfuncstr(self): if self.emcc_args is None: return self.skip('requires emcc') - src = ''' - #include <stdio.h> - struct Class { - static char *name1() { return "nameA"; } - char *name2() { return "nameB"; } - }; + test_path = path_from_root('tests', 'core', 'test_tinyfuncstr') + src, output = (test_path + s for s in ('.in', '.out')) - int main() { - printf("*%s,%s*\\n", Class::name1(), (new Class())->name2()); - return 0; - } - ''' - self.do_run(src, '*nameA,nameB*') + self.do_run_from_file(src, output) def test_llvmswitch(self): Settings.CORRECT_SIGNS = 1 |