aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 14:58:53 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:59 +0200
commitd952588f9f15e7c461d6ddac8d229cd80c06d93b (patch)
tree81244428791c0ff7d19b4f293a9a32985c0c7596 /tests
parentb0b41194b93b3c6424b4af36580eb2032441481b (diff)
Use do_run_from_file() for test_transtrcase
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_transtrcase.in13
-rw-r--r--tests/core/test_transtrcase.out1
-rw-r--r--tests/test_core.py18
3 files changed, 18 insertions, 14 deletions
diff --git a/tests/core/test_transtrcase.in b/tests/core/test_transtrcase.in
new file mode 100644
index 00000000..0592405e
--- /dev/null
+++ b/tests/core/test_transtrcase.in
@@ -0,0 +1,13 @@
+
+ #include <stdio.h>
+ #include <string.h>
+ int main() {
+ char szToupr[] = "hello, ";
+ char szTolwr[] = "EMSCRIPTEN";
+ strupr(szToupr);
+ strlwr(szTolwr);
+ printf(szToupr);
+ printf(szTolwr);
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_transtrcase.out b/tests/core/test_transtrcase.out
new file mode 100644
index 00000000..dbb541e6
--- /dev/null
+++ b/tests/core/test_transtrcase.out
@@ -0,0 +1 @@
+HELLO, emscripten \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index 55cf142e..5b3a64dd 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -3574,20 +3574,10 @@ ok
self.do_run(src, expected)
def test_transtrcase(self):
- src = '''
- #include <stdio.h>
- #include <string.h>
- int main() {
- char szToupr[] = "hello, ";
- char szTolwr[] = "EMSCRIPTEN";
- strupr(szToupr);
- strlwr(szTolwr);
- printf(szToupr);
- printf(szTolwr);
- return 0;
- }
- '''
- self.do_run(src, 'HELLO, emscripten')
+ test_path = path_from_root('tests', 'core', 'test_transtrcase')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output)
def test_printf(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('i64 mode 1 requires ta2')