diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-11 00:00:35 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-27 13:46:04 +0300 |
commit | 6f516fcc631c177a1c9f62b3a22e0c4e0e9713d4 (patch) | |
tree | 9377c1e77a16e6cd0fca5b61fce36b4e78fa6226 /tests/python/opengl_draw_tests.py | |
parent | 219a10e46aa65c6c416b205cd7389d3ee86777f6 (diff) |
Tests: speed up render tests by running multiple in the same process
Blender startup time and shader compilation is a big factor when running
hundreds of tests, so now all renders in the same ctest run in the same
process.
This was previously reverted due to skipping other tests when one test
crashed. Now if a test crashes, Blender is re-run with the remaining
tests so we get results from them still.
Diffstat (limited to 'tests/python/opengl_draw_tests.py')
-rwxr-xr-x | tests/python/opengl_draw_tests.py | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/tests/python/opengl_draw_tests.py b/tests/python/opengl_draw_tests.py index b70111c042f..ab4df63afd9 100755 --- a/tests/python/opengl_draw_tests.py +++ b/tests/python/opengl_draw_tests.py @@ -31,9 +31,8 @@ if inside_blender: sys.exit(0) -def render_file(filepath, output_filepath): - command = ( - BLENDER, +def get_arguments(filepath, output_filepath): + return [ "--no-window-focus", "--window-geometry", "0", "0", "1024", "768", @@ -44,28 +43,7 @@ def render_file(filepath, output_filepath): "-P", os.path.realpath(__file__), "--", - output_filepath) - - try: - # Success - output = subprocess.check_output(command) - if VERBOSE: - print(output.decode("utf-8")) - return None - except subprocess.CalledProcessError as e: - # Error - if os.path.exists(output_filepath): - os.remove(output_filepath) - if VERBOSE: - print(e.output.decode("utf-8")) - return "CRASH" - except BaseException as e: - # Crash - if os.path.exists(output_filepath): - os.remove(output_filepath) - if VERBOSE: - print(e) - return "CRASH" + output_filepath + '0001.png'] def create_argparse(): @@ -81,18 +59,14 @@ def main(): parser = create_argparse() args = parser.parse_args() - global BLENDER, VERBOSE - - BLENDER = args.blender[0] - VERBOSE = os.environ.get("BLENDER_VERBOSE") is not None - + blender = args.blender[0] test_dir = args.testdir[0] idiff = args.idiff[0] output_dir = args.outdir[0] from modules import render_report report = render_report.Report("OpenGL Draw", output_dir, idiff) - ok = report.run(test_dir, render_file) + ok = report.run(test_dir, blender, get_arguments) sys.exit(not ok) |