summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 11:00:35 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:53 +0200
commit121b362fc7afa14217858e9188a6c858b687656c (patch)
tree476aef2975c021e2e9c2563ba7b0e78994263759 /tests
parentdb6c55fdc2be4f67106b4672a4205289ab6aedbd (diff)
Use do_run_from_file() for test_libcextra
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_libcextra.in13
-rw-r--r--tests/core/test_libcextra.out1
-rw-r--r--tests/test_core.py15
3 files changed, 17 insertions, 12 deletions
diff --git a/tests/core/test_libcextra.in b/tests/core/test_libcextra.in
new file mode 100644
index 00000000..e0ff2f8e
--- /dev/null
+++ b/tests/core/test_libcextra.in
@@ -0,0 +1,13 @@
+
+ #include <stdio.h>
+ #include <wchar.h>
+
+ int main()
+ {
+ const wchar_t* wstr = L"Hello";
+
+ printf("wcslen: %d\n", wcslen(wstr));
+
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_libcextra.out b/tests/core/test_libcextra.out
new file mode 100644
index 00000000..d0191c32
--- /dev/null
+++ b/tests/core/test_libcextra.out
@@ -0,0 +1 @@
+wcslen: 5 \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index 2629589b..02d4cb6b 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1071,20 +1071,11 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
def test_libcextra(self):
if self.emcc_args is None: return self.skip('needs emcc for libcextra')
- src = r'''
- #include <stdio.h>
- #include <wchar.h>
-
- int main()
- {
- const wchar_t* wstr = L"Hello";
- printf("wcslen: %d\n", wcslen(wstr));
+ test_path = path_from_root('tests', 'core', 'test_libcextra')
+ src, output = (test_path + s for s in ('.in', '.out'))
- return 0;
- }
- '''
- self.do_run(src, 'wcslen: 5')
+ self.do_run_from_file(src, output)
def test_regex(self):
# This is from http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Frtref%2Fregexec.htm