Changeset View
Changeset View
Standalone View
Standalone View
tests/python/modules/render_report.py
| Show First 20 Lines • Show All 404 Lines • ▼ Show 20 Lines | def _diff_output(self, filepath, tmp_filepath): | ||||
| ref_img, | ref_img, | ||||
| tmp_filepath, | tmp_filepath, | ||||
| ) | ) | ||||
| try: | try: | ||||
| subprocess.check_output(command) | subprocess.check_output(command) | ||||
| failed = False | failed = False | ||||
| except subprocess.CalledProcessError as e: | except subprocess.CalledProcessError as e: | ||||
| if self.verbose: | if self.verbose: | ||||
| print_message(e.output.decode("utf-8")) | print_message(e.output.decode("utf-8", 'ignore')) | ||||
| failed = e.returncode != 1 | failed = e.returncode != 1 | ||||
| else: | else: | ||||
| if not self.update: | if not self.update: | ||||
| return False | return False | ||||
| failed = True | failed = True | ||||
| if failed and self.update: | if failed and self.update: | ||||
| Show All 10 Lines | def _diff_output(self, filepath, tmp_filepath): | ||||
| ref_img, | ref_img, | ||||
| tmp_filepath | tmp_filepath | ||||
| ) | ) | ||||
| try: | try: | ||||
| subprocess.check_output(command) | subprocess.check_output(command) | ||||
| except subprocess.CalledProcessError as e: | except subprocess.CalledProcessError as e: | ||||
| if self.verbose: | if self.verbose: | ||||
| print_message(e.output.decode("utf-8")) | print_message(e.output.decode("utf-8", 'ignore')) | ||||
| return not failed | return not failed | ||||
| def _run_tests(self, filepaths, blender, arguments_cb, batch): | def _run_tests(self, filepaths, blender, arguments_cb, batch): | ||||
| # Run multiple tests in a single Blender process since startup can be | # Run multiple tests in a single Blender process since startup can be | ||||
| # a significant factor. In case of crashes, re-run the remaining tests. | # a significant factor. In case of crashes, re-run the remaining tests. | ||||
| verbose = os.environ.get("BLENDER_VERBOSE") is not None | verbose = os.environ.get("BLENDER_VERBOSE") is not None | ||||
| Show All 34 Lines | def _run_tests(self, filepaths, blender, arguments_cb, batch): | ||||
| crash = True | crash = True | ||||
| output = completed_process.stdout | 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 (verbose or crash) and output: | if (verbose or crash) and output: | ||||
| print(output.decode("utf-8")) | print(output.decode("utf-8", 'ignore')) | ||||
| # 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 | |||||