diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 16:34:57 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:36:01 +0200 |
commit | 8c60ac77238f3b514d4603af9014c48b067b0a05 (patch) | |
tree | 366415dbca589adbcc938aa7727eb7c0ccab0774 | |
parent | a690aeeddc70c51b814999ec8c3d2093e85ed647 (diff) |
Use do_run_from_file() for test_std_cout_new
-rw-r--r-- | tests/core/test_std_cout_new.in | 24 | ||||
-rw-r--r-- | tests/core/test_std_cout_new.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 28 |
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') |