diff options
-rw-r--r-- | tests/core/test_perrar.in | 13 | ||||
-rw-r--r-- | tests/core/test_perrar.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 16 |
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') |