aboutsummaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 16:53:36 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:36:01 +0200
commitfd27a14bc2d192ccbb3266f0f8188e5b371b1ebe (patch)
tree951f62baede73f6fc342ff323aef186e3e73be32 /tests/test_core.py
parent9669423b703fc50f7acbf9f640743669cf893bcc (diff)
Use do_run_from_file() for test_stdvec
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py34
1 files changed, 3 insertions, 31 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index 47a39ba7..228de112 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -4258,39 +4258,11 @@ PORT: 3979
def test_stdvec(self):
if self.emcc_args is None: return self.skip('requires emcc')
- src = '''
- #include <vector>
- #include <stdio.h>
-
- struct S {
- int a;
- float b;
- };
- void foo(int a, float b)
- {
- printf("%d:%.2f\\n", a, b);
- }
-
- int main ( int argc, char *argv[] )
- {
- std::vector<S> ar;
- S s;
-
- s.a = 789;
- s.b = 123.456f;
- ar.push_back(s);
-
- s.a = 0;
- s.b = 100.1f;
- ar.push_back(s);
-
- foo(ar[0].a, ar[0].b);
- foo(ar[1].a, ar[1].b);
- }
- '''
+ test_path = path_from_root('tests', 'core', 'test_stdvec')
+ src, output = (test_path + s for s in ('.in', '.out'))
- self.do_run(src, '789:123.46\n0:100.1')
+ self.do_run_from_file(src, output)
def test_reinterpreted_ptrs(self):
if self.emcc_args is None: return self.skip('needs emcc and libc')