summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-06 23:29:08 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:52 +0200
commit64b0558bb691baefb7def2b3520e84b0369ddfd3 (patch)
tree212adf83f4678fde70cc2f883e4c7acf15cd144d /tests
parent88ee912b36ba0f3e0ba0cd4f4506faaf3a175736 (diff)
Use do_run_from_file() for test_mainenv
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_mainenv.in8
-rw-r--r--tests/core/test_mainenv.out1
-rw-r--r--tests/test_core.py13
3 files changed, 13 insertions, 9 deletions
diff --git a/tests/core/test_mainenv.in b/tests/core/test_mainenv.in
new file mode 100644
index 00000000..da434196
--- /dev/null
+++ b/tests/core/test_mainenv.in
@@ -0,0 +1,8 @@
+
+ #include <stdio.h>
+ int main(int argc, char **argv, char **envp)
+ {
+ printf("*%p*\n", envp);
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_mainenv.out b/tests/core/test_mainenv.out
new file mode 100644
index 00000000..abc8f766
--- /dev/null
+++ b/tests/core/test_mainenv.out
@@ -0,0 +1 @@
+*(nil)* \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index 466ffcc6..fb4a4ff8 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -952,15 +952,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_mainenv(self):
- src = '''
- #include <stdio.h>
- int main(int argc, char **argv, char **envp)
- {
- printf("*%p*\\n", envp);
- return 0;
- }
- '''
- self.do_run(src, '*(nil)*')
+ test_path = path_from_root('tests', 'core', 'test_mainenv')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output)
def test_funcs(self):
src = '''