summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 11:59:40 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:55 +0200
commit45243528c0cefc663314a412b3c34b3469587bdd (patch)
tree404738e8978cb5b1e117b46659d3a5748f71aa5e /tests
parent74502e3598b09e6663ece351c0bc2c0aafd68338 (diff)
Use do_run_from_file() for test_alloca
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_alloca.in11
-rw-r--r--tests/core/test_alloca.out1
-rw-r--r--tests/test_core.py14
3 files changed, 15 insertions, 11 deletions
diff --git a/tests/core/test_alloca.in b/tests/core/test_alloca.in
new file mode 100644
index 00000000..7b53e56c
--- /dev/null
+++ b/tests/core/test_alloca.in
@@ -0,0 +1,11 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
+
+ int main() {
+ char *pc;
+ pc = (char *)alloca(5);
+ printf("z:%d*%d*\n", pc > 0, (int)pc);
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_alloca.out b/tests/core/test_alloca.out
new file mode 100644
index 00000000..37de3d6b
--- /dev/null
+++ b/tests/core/test_alloca.out
@@ -0,0 +1 @@
+z:1* \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index b72ae793..0092a27d 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1552,18 +1552,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_alloca(self):
- src = '''
- #include <stdio.h>
- #include <stdlib.h>
+ test_path = path_from_root('tests', 'core', 'test_alloca')
+ src, output = (test_path + s for s in ('.in', '.out'))
- int main() {
- char *pc;
- pc = (char *)alloca(5);
- printf("z:%d*%d*\\n", pc > 0, (int)pc);
- return 0;
- }
- '''
- self.do_run(src, 'z:1*', force_c=True)
+ self.do_run_from_file(src, output, force_c=True)
def test_rename(self):
src = open(path_from_root('tests', 'stdio', 'test_rename.c'), 'r').read()