aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 16:36:53 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:36:01 +0200
commit776b12fc811e38907bcca064c2ffc4c221794e94 (patch)
tree6721dbee00929096df23c0fc936bdb2966607092
parent8c60ac77238f3b514d4603af9014c48b067b0a05 (diff)
Use do_run_from_file() for test_istream
-rw-r--r--tests/core/test_istream.in16
-rw-r--r--tests/core/test_istream.out1
-rw-r--r--tests/test_core.py19
3 files changed, 20 insertions, 16 deletions
diff --git a/tests/core/test_istream.in b/tests/core/test_istream.in
new file mode 100644
index 00000000..9a9d1c9a
--- /dev/null
+++ b/tests/core/test_istream.in
@@ -0,0 +1,16 @@
+
+ #include <string>
+ #include <sstream>
+ #include <iostream>
+
+ int main()
+ {
+ std::string mystring("1 2 3");
+ std::istringstream is(mystring);
+ int one, two, three;
+
+ is >> one >> two >> three;
+
+ printf( "%i %i %i", one, two, three );
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_istream.out b/tests/core/test_istream.out
new file mode 100644
index 00000000..703ca85b
--- /dev/null
+++ b/tests/core/test_istream.out
@@ -0,0 +1 @@
+1 2 3 \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index 5fe627c5..b3f3fa2c 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -4036,26 +4036,13 @@ def process(filename):
def test_istream(self):
if self.emcc_args is None: return self.skip('requires libcxx')
- src = '''
- #include <string>
- #include <sstream>
- #include <iostream>
-
- int main()
- {
- std::string mystring("1 2 3");
- std::istringstream is(mystring);
- int one, two, three;
-
- is >> one >> two >> three;
+ test_path = path_from_root('tests', 'core', 'test_istream')
+ src, output = (test_path + s for s in ('.in', '.out'))
- printf( "%i %i %i", one, two, three );
- }
- '''
for linkable in [0]:#, 1]:
print linkable
Settings.LINKABLE = linkable # regression check for issue #273
- self.do_run(src, "1 2 3")
+ self.do_run_from_file(src, output)
def test_fs_base(self):
Settings.INCLUDE_FULL_LIBRARY = 1