diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-09-24 13:20:17 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-09-24 13:20:17 -0700 |
commit | 8f40148905b6ad2897ae119f83e9bbba6a9e82b0 (patch) | |
tree | 85221bb6e40af9db975ad8cc5b4a8a4364012ac7 | |
parent | 0f67eac88b3606e1e69c1eb7b7144185e107ea87 (diff) | |
parent | 552031c2fa55b9e358ee24ef25b521b7b2c06fbf (diff) |
Merge pull request #584 from LCID-Fire/glbook_path_function
Extract a function to build path to GL books' samples.
-rwxr-xr-x | tests/runner.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/runner.py b/tests/runner.py index cab5157b..8d1f0674 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -8275,19 +8275,21 @@ elif 'browser' in str(sys.argv): os.path.join('Chapter_10', 'MultiTexture', 'CH10_MultiTexture.bc'), os.path.join('Chapter_13', 'ParticleSystem', 'CH13_ParticleSystem.bc'), ], configure=None) + def book_path(*pathelems): + return path_from_root('tests', 'glbook', *pathelems) for program in programs: print program basename = os.path.basename(program) args = [] if basename == 'CH10_MultiTexture.bc': - shutil.copyfile(path_from_root('tests', 'glbook', 'Chapter_10', 'MultiTexture', 'basemap.tga'), os.path.join(self.get_dir(), 'basemap.tga')) - shutil.copyfile(path_from_root('tests', 'glbook', 'Chapter_10', 'MultiTexture', 'lightmap.tga'), os.path.join(self.get_dir(), 'lightmap.tga')) + shutil.copyfile(book_path('Chapter_10', 'MultiTexture', 'basemap.tga'), os.path.join(self.get_dir(), 'basemap.tga')) + shutil.copyfile(book_path('Chapter_10', 'MultiTexture', 'lightmap.tga'), os.path.join(self.get_dir(), 'lightmap.tga')) args = ['--preload-file', 'basemap.tga', '--preload-file', 'lightmap.tga'] elif basename == 'CH13_ParticleSystem.bc': - shutil.copyfile(path_from_root('tests', 'glbook', 'Chapter_13', 'ParticleSystem', 'smoke.tga'), os.path.join(self.get_dir(), 'smoke.tga')) + shutil.copyfile(book_path('Chapter_13', 'ParticleSystem', 'smoke.tga'), os.path.join(self.get_dir(), 'smoke.tga')) args = ['--preload-file', 'smoke.tga', '-O2'] # test optimizations and closure here as well for more coverage - self.reftest(path_from_root('tests', 'glbook', basename.replace('.bc', '.png'))) + self.reftest(book_path(basename.replace('.bc', '.png'))) Popen(['python', EMCC, program, '-o', 'program.html', '--pre-js', 'reftest.js'] + args).communicate() self.run_browser('program.html', '', '/report_result?0') |