aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 15:13:10 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:59 +0200
commit88cde68ca050588cad25f0eaa84ab99057f5044b (patch)
tree6e0acf5c1333c0c576838fddf99f63aeef5d831a
parent0f29e3b614008e8c1e3fe1caa146b086485efbf7 (diff)
Use do_run_from_file() for test_perrar
-rw-r--r--tests/core/test_perrar.in13
-rw-r--r--tests/core/test_perrar.out1
-rw-r--r--tests/test_core.py16
3 files changed, 17 insertions, 13 deletions
diff --git a/tests/core/test_perrar.in b/tests/core/test_perrar.in
new file mode 100644
index 00000000..e15c583a
--- /dev/null
+++ b/tests/core/test_perrar.in
@@ -0,0 +1,13 @@
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <stdio.h>
+
+ int main( int argc, char** argv ){
+ int retval = open( "NonExistingFile", O_RDONLY );
+ if( retval == -1 )
+ perror( "Cannot open NonExistingFile" );
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_perrar.out b/tests/core/test_perrar.out
new file mode 100644
index 00000000..0de5f448
--- /dev/null
+++ b/tests/core/test_perrar.out
@@ -0,0 +1 @@
+Cannot open NonExistingFile: No such file or directory
diff --git a/tests/test_core.py b/tests/test_core.py
index 20d79a47..b04ea5a8 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -3614,20 +3614,10 @@ ok
self.do_run_from_file(src, output)
def test_perrar(self):
- src = r'''
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <stdio.h>
+ test_path = path_from_root('tests', 'core', 'test_perrar')
+ src, output = (test_path + s for s in ('.in', '.out'))
- int main( int argc, char** argv ){
- int retval = open( "NonExistingFile", O_RDONLY );
- if( retval == -1 )
- perror( "Cannot open NonExistingFile" );
- return 0;
- }
- '''
- self.do_run(src, 'Cannot open NonExistingFile: No such file or directory\n')
+ self.do_run_from_file(src, output)
def test_atoX(self):
if self.emcc_args is None: return self.skip('requires ta2')