Changeset View
Changeset View
Standalone View
Standalone View
tests/python/modules/render_report.py
| Show First 20 Lines • Show All 442 Lines • ▼ Show 20 Lines | def _run_tests(self, filepaths, blender, arguments_cb, batch): | ||||
| # Only chain multiple commands for batch | # Only chain multiple commands for batch | ||||
| if not batch: | if not batch: | ||||
| break | break | ||||
| # Run process | # Run process | ||||
| crash = False | crash = False | ||||
| output = None | output = None | ||||
| try: | try: | ||||
| output = subprocess.check_output(command) | completed_process = subprocess.run(command, stdout=subprocess.PIPE) | ||||
| except subprocess.CalledProcessError as e: | if completed_process.returncode != 0: | ||||
| crash = True | crash = True | ||||
| output = completed_process.stdout | |||||
| except BaseException as e: | except BaseException as e: | ||||
| crash = True | crash = True | ||||
| if verbose: | if verbose: | ||||
| print(" ".join(command)) | print(" ".join(command)) | ||||
| if output: | if (verbose or crash) and output: | ||||
| print(output.decode("utf-8")) | print(output.decode("utf-8")) | ||||
| # Detect missing filepaths and consider those errors | # Detect missing filepaths and consider those errors | ||||
| for filepath, output_filepath in zip(remaining_filepaths[:], output_filepaths): | for filepath, output_filepath in zip(remaining_filepaths[:], output_filepaths): | ||||
| remaining_filepaths.pop(0) | remaining_filepaths.pop(0) | ||||
| if crash: | if crash: | ||||
| # In case of crash, stop after missing files and re-render remaining | # In case of crash, stop after missing files and re-render remaining | ||||
| if not os.path.exists(output_filepath): | if not os.path.exists(output_filepath): | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||