aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 14:05:54 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:57 +0200
commite99d3d2dab89580d35ae2e53940765366aea38c5 (patch)
tree0fe7f9b40a44f0e3b80413711e2738eb27ae6ec9
parent80e7c536cd73ea1079d3d84b8b2e5403e8fff16a (diff)
Use do_run_from_file() for test_time_c
-rw-r--r--tests/core/test_time_c.in9
-rw-r--r--tests/core/test_time_c.out1
-rw-r--r--tests/test_core.py12
3 files changed, 13 insertions, 9 deletions
diff --git a/tests/core/test_time_c.in b/tests/core/test_time_c.in
new file mode 100644
index 00000000..57b47217
--- /dev/null
+++ b/tests/core/test_time_c.in
@@ -0,0 +1,9 @@
+
+ #include <time.h>
+ #include <stdio.h>
+
+ int main() {
+ time_t t = time(0);
+ printf("time: %s\n", ctime(&t));
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_time_c.out b/tests/core/test_time_c.out
new file mode 100644
index 00000000..dc3e339b
--- /dev/null
+++ b/tests/core/test_time_c.out
@@ -0,0 +1 @@
+time: \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index 35be9651..0b073b08 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -2450,16 +2450,10 @@ The current type of b is: 9
self.do_run_from_file(src, output)
def test_time_c(self):
- src = r'''
- #include <time.h>
- #include <stdio.h>
+ test_path = path_from_root('tests', 'core', 'test_time_c')
+ src, output = (test_path + s for s in ('.in', '.out'))
- int main() {
- time_t t = time(0);
- printf("time: %s\n", ctime(&t));
- }
- '''
- self.do_run(src, 'time: ') # compilation check, mainly
+ self.do_run_from_file(src, output)
def test_gmtime(self):
src = r'''