aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 17:14:22 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:36:02 +0200
commit98bb3dd7d7bb45eae92975a6f8ebf5ed4fc1ecab (patch)
tree486f65d85a339be8f8cf8ad61f9b31b8518eac7f /tests
parenta5f8823964c30222ba9cddc370a814ba9c4528f3 (diff)
Use do_run_from_file() for test_fakestat
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_fakestat.in10
-rw-r--r--tests/core/test_fakestat.out1
-rw-r--r--tests/test_core.py15
3 files changed, 15 insertions, 11 deletions
diff --git a/tests/core/test_fakestat.in b/tests/core/test_fakestat.in
new file mode 100644
index 00000000..9a09b57c
--- /dev/null
+++ b/tests/core/test_fakestat.in
@@ -0,0 +1,10 @@
+
+ #include <stdio.h>
+ struct stat { int x, y; };
+ int main() {
+ stat s;
+ s.x = 10;
+ s.y = 22;
+ printf("*%d,%d*\n", s.x, s.y);
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_fakestat.out b/tests/core/test_fakestat.out
new file mode 100644
index 00000000..fbb3ab3c
--- /dev/null
+++ b/tests/core/test_fakestat.out
@@ -0,0 +1 @@
+*10,22* \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index 6349d47c..01154605 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -4476,17 +4476,10 @@ return malloc(size);
self.do_run_from_file(src, output)
def test_fakestat(self):
- src = r'''
- #include <stdio.h>
- struct stat { int x, y; };
- int main() {
- stat s;
- s.x = 10;
- s.y = 22;
- printf("*%d,%d*\n", s.x, s.y);
- }
- '''
- self.do_run(src, '*10,22*')
+ test_path = path_from_root('tests', 'core', 'test_fakestat')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output)
def test_mmap(self):
if self.emcc_args is None: return self.skip('requires emcc')