summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-06 23:30:27 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:52 +0200
commitb738dbadbbd9a49d1ae093c451245f20d7664e09 (patch)
tree02896478e855bfd7420493ec2b1b55814ef781c9
parent64b0558bb691baefb7def2b3520e84b0369ddfd3 (diff)
Use do_run_from_file() for test_funcs
-rw-r--r--tests/core/test_funcs.in12
-rw-r--r--tests/core/test_funcs.out1
-rw-r--r--tests/test_core.py17
3 files changed, 17 insertions, 13 deletions
diff --git a/tests/core/test_funcs.in b/tests/core/test_funcs.in
new file mode 100644
index 00000000..f2e707f9
--- /dev/null
+++ b/tests/core/test_funcs.in
@@ -0,0 +1,12 @@
+
+ #include <stdio.h>
+ int funcy(int x)
+ {
+ return x*9;
+ }
+ int main()
+ {
+ printf("*%d,%d*\n", funcy(8), funcy(10));
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_funcs.out b/tests/core/test_funcs.out
new file mode 100644
index 00000000..f58def9a
--- /dev/null
+++ b/tests/core/test_funcs.out
@@ -0,0 +1 @@
+*72,90* \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index fb4a4ff8..823c0285 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -958,19 +958,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
self.do_run_from_file(src, output)
def test_funcs(self):
- src = '''
- #include <stdio.h>
- int funcy(int x)
- {
- return x*9;
- }
- int main()
- {
- printf("*%d,%d*\\n", funcy(8), funcy(10));
- return 0;
- }
- '''
- self.do_run(src, '*72,90*')
+ test_path = path_from_root('tests', 'core', 'test_funcs')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output)
def test_structs(self):
src = '''