summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 10:54:36 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:52 +0200
commite6db99720aded590a5a580096d3a89e8237a9ddc (patch)
tree442113c6a016843aef85e62f513e9d636fd3278c /tests
parent3ae52c48122ba894d3b4b2e93be8535b6720cc38 (diff)
Use do_run_from_file() for test_globals
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_globals.in13
-rw-r--r--tests/core/test_globals.out1
-rw-r--r--tests/test_core.py16
3 files changed, 17 insertions, 13 deletions
diff --git a/tests/core/test_globals.in b/tests/core/test_globals.in
new file mode 100644
index 00000000..ed5e7891
--- /dev/null
+++ b/tests/core/test_globals.in
@@ -0,0 +1,13 @@
+
+ #include <stdio.h>
+
+ char cache[256], *next = cache;
+
+ int main()
+ {
+ cache[10] = 25;
+ next[20] = 51;
+ printf("*%d,%d*\n", next[10], cache[20]);
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_globals.out b/tests/core/test_globals.out
new file mode 100644
index 00000000..2cb6768e
--- /dev/null
+++ b/tests/core/test_globals.out
@@ -0,0 +1 @@
+*25,51* \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index c6ab5ab9..66ef952b 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1002,20 +1002,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_globals(self):
- src = '''
- #include <stdio.h>
-
- char cache[256], *next = cache;
+ test_path = path_from_root('tests', 'core', 'test_globals')
+ src, output = (test_path + s for s in ('.in', '.out'))
- int main()
- {
- cache[10] = 25;
- next[20] = 51;
- printf("*%d,%d*\\n", next[10], cache[20]);
- return 0;
- }
- '''
- self.do_run(src, '*25,51*')
+ self.do_run_from_file(src, output)
def test_linked_list(self):
src = '''