summaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 12:54:57 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:56 +0200
commitd682885d8ec525e4470e9b21970eb3dac7b434a0 (patch)
tree74348a4b014dfa5925f46b774494534cd28b1d2b /tests/test_core.py
parent72672fc7b0fd2917b0df4e45e65c6576438c813d (diff)
Use do_run_from_file() for test_inlinejs2
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py23
1 files changed, 3 insertions, 20 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index 0d70f50d..9aa64347 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1895,28 +1895,11 @@ def process(filename):
def test_inlinejs2(self):
if not self.is_le32(): return self.skip('le32 needed for inline js')
- src = r'''
- #include <stdio.h>
-
- int mix(int x, int y) {
- int ret;
- asm("Math.pow(2, %0+%1+1)" : "=r"(ret) : "r"(x), "r"(y)); // read and write
- return ret;
- }
-
- void mult() {
- asm("var $_$1 = Math.abs(-100); $_$1 *= 2; Module.print($_$1)"); // multiline
- asm __volatile__("Module.print('done')");
- }
- int main(int argc, char **argv) {
- printf("%d\n", mix(argc, argc/2));
- mult();
- return 0;
- }
- '''
+ test_path = path_from_root('tests', 'core', 'test_inlinejs2')
+ src, output = (test_path + s for s in ('.in', '.out'))
- self.do_run(src, '4\n200\ndone\n')
+ self.do_run_from_file(src, output)
def test_inlinejs3(self):
src = r'''