aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/runner.py b/tests/runner.py
index d38af50c..fddcf1df 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -6277,10 +6277,11 @@ f.close()
def test_emcc_multifile(self):
# a few files inside a directory
- if not os.path.exists(os.path.join(self.get_dir(), 'subdirr')):
- os.makedirs(os.path.join(self.get_dir(), 'subdirr'));
+ self.clear()
+ os.makedirs(os.path.join(self.get_dir(), 'subdirr'));
+ os.makedirs(os.path.join(self.get_dir(), 'subdirr', 'moar'));
open(os.path.join(self.get_dir(), 'subdirr', 'data1.txt'), 'w').write('''1214141516171819''')
- open(os.path.join(self.get_dir(), 'subdirr', 'data2.txt'), 'w').write('''3.14159265358979''')
+ open(os.path.join(self.get_dir(), 'subdirr', 'moar', 'data2.txt'), 'w').write('''3.14159265358979''')
open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(self.with_report_result(r'''
#include <stdio.h>
#include <string.h>
@@ -6295,7 +6296,7 @@ f.close()
printf("|%s|\n", buf);
int result = !strcmp("1214141516171819", buf);
- FILE *f2 = fopen("subdirr/data2.txt", "r");
+ FILE *f2 = fopen("subdirr/moar/data2.txt", "r");
fread(buf, 1, 16, f2);
buf[16] = 0;
fclose(f2);
@@ -6308,7 +6309,7 @@ f.close()
'''))
# by individual files
- Popen(['python', EMCC, os.path.join(self.get_dir(), 'main.cpp'), '--preload-file', 'subdirr/data1.txt', '--preload-file', 'subdirr/data2.txt', '-o', 'page.html']).communicate()
+ Popen(['python', EMCC, os.path.join(self.get_dir(), 'main.cpp'), '--preload-file', 'subdirr/data1.txt', '--preload-file', 'subdirr/moar/data2.txt', '-o', 'page.html']).communicate()
self.run_browser('page.html', 'You should see two cool numbers', '/report_result?1')
os.remove('page.html')