aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/core/test_std_cout_new.in24
-rw-r--r--tests/core/test_std_cout_new.out1
-rw-r--r--tests/test_core.py28
3 files changed, 28 insertions, 25 deletions
diff --git a/tests/core/test_std_cout_new.in b/tests/core/test_std_cout_new.in
new file mode 100644
index 00000000..20895169
--- /dev/null
+++ b/tests/core/test_std_cout_new.in
@@ -0,0 +1,24 @@
+
+ #include <iostream>
+
+ struct NodeInfo { //structure that we want to transmit to our shaders
+ float x;
+ float y;
+ float s;
+ float c;
+ };
+ const int nbNodes = 100;
+ NodeInfo * data = new NodeInfo[nbNodes]; //our data that will be transmitted using float texture.
+
+ template<int i>
+ void printText( const char (&text)[ i ] )
+ {
+ std::cout << text << std::endl;
+ }
+
+ int main()
+ {
+ printText( "some string constant" );
+ return 0;
+ }
+ \ No newline at end of file
diff --git a/tests/core/test_std_cout_new.out b/tests/core/test_std_cout_new.out
new file mode 100644
index 00000000..ddb4b681
--- /dev/null
+++ b/tests/core/test_std_cout_new.out
@@ -0,0 +1 @@
+some string constant \ No newline at end of file
diff --git a/tests/test_core.py b/tests/test_core.py
index 2292676a..5fe627c5 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -4028,32 +4028,10 @@ def process(filename):
def test_std_cout_new(self):
if self.emcc_args is None: return self.skip('requires emcc')
- src = '''
- #include <iostream>
-
- struct NodeInfo { //structure that we want to transmit to our shaders
- float x;
- float y;
- float s;
- float c;
- };
- const int nbNodes = 100;
- NodeInfo * data = new NodeInfo[nbNodes]; //our data that will be transmitted using float texture.
-
- template<int i>
- void printText( const char (&text)[ i ] )
- {
- std::cout << text << std::endl;
- }
-
- int main()
- {
- printText( "some string constant" );
- return 0;
- }
- '''
+ test_path = path_from_root('tests', 'core', 'test_std_cout_new')
+ src, output = (test_path + s for s in ('.in', '.out'))
- self.do_run(src, "some string constant")
+ self.do_run_from_file(src, output)
def test_istream(self):
if self.emcc_args is None: return self.skip('requires libcxx')