![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Public Member Functions | |
__init__ (self, args) | |
Run (self) | |
RunSingleTestCase (self, run_label, build_dir, test_case) | |
Public Attributes | |
git = GitHelper() | |
args = args | |
safe_script_dir = self.args.build_dir | |
safe_measure_script_path | |
list | test_cases = [] |
after_build_dir = self.args.build_dir | |
before_build_dir = self.args.build_dir_before | |
Protected Member Functions | |
_InitPaths (self) | |
_FreezeMeasureScript (self) | |
_ProfileTwoOtherBranchesInThisRepo (self, before_branch, after_branch) | |
_ProfileTwoOtherBranches (self, before_branch, after_branch) | |
_ProfileCurrentAndOtherBranchInThisRepo (self, other_branch) | |
_ProfileCurrentAndOtherBranch (self, other_branch) | |
_ProfileLocalChangesAndCurrentBranchInThisRepo (self) | |
_ProfileLocalChangesAndCurrentBranch (self) | |
_ProfileSeparateRepo (self, run_label, relative_build_dir, branch) | |
_CreateTempRepo (self, dir_name, relative_build_dir, branch) | |
_CheckoutBranch (self, branch) | |
_StashLocalChanges (self) | |
_RestoreLocalChanges (self) | |
_BuildCurrentBranch (self, build_dir) | |
_MeasureCurrentBranch (self, run_label, build_dir) | |
_RunSync (self, run_label, build_dir) | |
_RunAsync (self, run_label, build_dir) | |
_MoveImages (self, test_case, run_label) | |
_GetProfileFilePath (self, run_label, test_case) | |
_DrawConclusions (self, times_before_branch, times_after_branch) | |
_PrintConclusions (self, conclusions_dict) | |
_CleanUp (self, conclusions) | |
_CleanUpOutputFile (self, run_label, case_name) | |
A comparison between two branches of pdfium.
Definition at line 35 of file safetynet_compare.py.
testing.tools.safetynet_compare.CompareRun.__init__ | ( | self, | |
args ) |
Definition at line 38 of file safetynet_compare.py.
|
protected |
Synchronizes and builds the current version of pdfium. Args: build_dir: String with path to build directory
Definition at line 377 of file safetynet_compare.py.
Referenced by _ProfileCurrentAndOtherBranch(), _ProfileCurrentAndOtherBranchInThisRepo(), _ProfileLocalChangesAndCurrentBranchInThisRepo(), _ProfileSeparateRepo(), and _ProfileTwoOtherBranchesInThisRepo().
|
protected |
Definition at line 365 of file safetynet_compare.py.
References git.
Referenced by _ProfileCurrentAndOtherBranchInThisRepo(), and _ProfileTwoOtherBranchesInThisRepo().
|
protected |
Removes profile output files for uninteresting cases. Cases without significant regressions or improvements and considered uninteresting. Args: conclusions: A ComparisonConclusions.
Definition at line 570 of file safetynet_compare.py.
References _CleanUpOutputFile(), QD3D11CommandBuffer::Command.args, QDBusConnectionPrivate::ArgMatchRules.args, QEvdevUtil::ParsedSpecification.args, QGles2CommandBuffer::Command.args, QMakeInternal::QMakeBuiltinInit.args, QQmlApplicationPrivate.args, QSignalSpy.args, QV4::CallData.args, QV4::JSCallArguments.args, QV4::JSCallData.args, QVkCommandBuffer::Command.args, args, Tracepoint.args, and VkSpecParser::Command.args.
Referenced by Run().
|
protected |
Removes one profile output file. If the output file does not exist, fails silently. Args: run_label: String to differentiate a version of the code in output files from other versions. case_name: String identifying test case for which to remove the output file.
Definition at line 590 of file safetynet_compare.py.
References _GetProfileFilePath().
Referenced by _CleanUp().
|
protected |
Clones a temporary git repository out of the current working dir. Args: dir_name: Name for the temporary repository directory relative_build_dir: Path to the build dir in the current working dir to clone build args from. branch: Branch to checkout in the new repository. None will keep checked out the same branch as the local repo. Returns: Path to the build directory of the new repository.
Definition at line 311 of file safetynet_compare.py.
References QD3D11CommandBuffer::Command.args, QDBusConnectionPrivate::ArgMatchRules.args, QEvdevUtil::ParsedSpecification.args, QGles2CommandBuffer::Command.args, QMakeInternal::QMakeBuiltinInit.args, QQmlApplicationPrivate.args, QSignalSpy.args, QV4::CallData.args, QV4::JSCallArguments.args, QV4::JSCallData.args, QVkCommandBuffer::Command.args, args, Tracepoint.args, VkSpecParser::Command.args, and git.
Referenced by _ProfileSeparateRepo().
|
protected |
Draws conclusions comparing results of test runs in two branches. Args: times_before_branch: A dict mapping each test case name to the profiling values for that test case in the branch to be considered as the baseline. times_after_branch: A dict mapping each test case name to the profiling values for that test case in the branch to be considered as the new version. Returns: ComparisonConclusions with all test cases processed.
Definition at line 531 of file safetynet_compare.py.
References QD3D11CommandBuffer::Command.args, QDBusConnectionPrivate::ArgMatchRules.args, QEvdevUtil::ParsedSpecification.args, QGles2CommandBuffer::Command.args, QMakeInternal::QMakeBuiltinInit.args, QQmlApplicationPrivate.args, QSignalSpy.args, QV4::CallData.args, QV4::JSCallArguments.args, QV4::JSCallData.args, QVkCommandBuffer::Command.args, args, Tracepoint.args, VkSpecParser::Command.args, and test_cases.
Referenced by Run().
|
protected |
Freezes a version of the measuring script. This is needed to make sure we are comparing the pdfium library changes and not script changes that may happen between the two branches.
Definition at line 116 of file safetynet_compare.py.
References __FreezeFile(), and safe_script_dir.
Referenced by Run().
|
protected |
Definition at line 524 of file safetynet_compare.py.
References QD3D11CommandBuffer::Command.args, QDBusConnectionPrivate::ArgMatchRules.args, QEvdevUtil::ParsedSpecification.args, QGles2CommandBuffer::Command.args, QMakeInternal::QMakeBuiltinInit.args, QQmlApplicationPrivate.args, QSignalSpy.args, QV4::CallData.args, QV4::JSCallArguments.args, QV4::JSCallData.args, QVkCommandBuffer::Command.args, args, Tracepoint.args, and VkSpecParser::Command.args.
Referenced by _CleanUpOutputFile(), and RunSingleTestCase().
|
protected |
Definition at line 43 of file safetynet_compare.py.
References QD3D11CommandBuffer::Command.args, QDBusConnectionPrivate::ArgMatchRules.args, QEvdevUtil::ParsedSpecification.args, QGles2CommandBuffer::Command.args, QMakeInternal::QMakeBuiltinInit.args, QQmlApplicationPrivate.args, QSignalSpy.args, QV4::CallData.args, QV4::JSCallArguments.args, QV4::JSCallData.args, QVkCommandBuffer::Command.args, args, Tracepoint.args, and VkSpecParser::Command.args.
|
protected |
Definition at line 395 of file safetynet_compare.py.
References _RunAsync(), _RunSync(), QD3D11CommandBuffer::Command.args, QDBusConnectionPrivate::ArgMatchRules.args, QEvdevUtil::ParsedSpecification.args, QGles2CommandBuffer::Command.args, QMakeInternal::QMakeBuiltinInit.args, QQmlApplicationPrivate.args, QSignalSpy.args, QV4::CallData.args, QV4::JSCallArguments.args, QV4::JSCallData.args, QVkCommandBuffer::Command.args, args, Tracepoint.args, VkSpecParser::Command.args, and test_cases.
Referenced by _ProfileCurrentAndOtherBranch(), _ProfileCurrentAndOtherBranchInThisRepo(), _ProfileLocalChangesAndCurrentBranchInThisRepo(), _ProfileSeparateRepo(), and _ProfileTwoOtherBranchesInThisRepo().
|
protected |
Definition at line 513 of file safetynet_compare.py.
References QD3D11CommandBuffer::Command.args, QDBusConnectionPrivate::ArgMatchRules.args, QEvdevUtil::ParsedSpecification.args, QGles2CommandBuffer::Command.args, QMakeInternal::QMakeBuiltinInit.args, QQmlApplicationPrivate.args, QSignalSpy.args, QV4::CallData.args, QV4::JSCallArguments.args, QV4::JSCallData.args, QVkCommandBuffer::Command.args, args, Tracepoint.args, and VkSpecParser::Command.args.
Referenced by RunSingleTestCase().
|
protected |
Prints the conclusions as the script output. Depending on the script args, this can output a human or a machine-readable version of the conclusions. Args: conclusions_dict: Dict to print returned from ComparisonConclusions.GetOutputDict().
Definition at line 554 of file safetynet_compare.py.
References QD3D11CommandBuffer::Command.args, QDBusConnectionPrivate::ArgMatchRules.args, QEvdevUtil::ParsedSpecification.args, QGles2CommandBuffer::Command.args, QMakeInternal::QMakeBuiltinInit.args, QQmlApplicationPrivate.args, QSignalSpy.args, QV4::CallData.args, QV4::JSCallArguments.args, QV4::JSCallData.args, QVkCommandBuffer::Command.args, args, Tracepoint.args, VkSpecParser::Command.args, and print().
Referenced by Run().
|
protected |
Profiles the current branch (with uncommitted changes) and another one. This is done in new, cloned repositories, therefore it is safer but slower and requires downloads. The current branch does not need to descend from other_branch. Args: other_branch: Other branch to profile that is not the current. None will compare to the same branch. Returns: A tuple (before, after), where each of before and after is a dict mapping a test case name to the profiling values for that test case in the given branch. The current branch is considered to be "after" and the other branch is considered to be "before".
Definition at line 221 of file safetynet_compare.py.
References _BuildCurrentBranch(), _MeasureCurrentBranch(), _ProfileSeparateRepo(), after_build_dir, and before_build_dir.
Referenced by _ProfileLocalChangesAndCurrentBranch(), and Run().
|
protected |
Profiles the current branch (with uncommitted changes) and another one. This is done in the local repository and changes may not be restored if the script fails or is interrupted. The current branch does not need to descend from other_branch. Args: other_branch: Other branch to profile that is not the current. Returns: A tuple (before, after), where each of before and after is a dict mapping a test case name to the profiling values for that test case in the given branch. The current branch is considered to be "after" and the other branch is considered to be "before".
Definition at line 188 of file safetynet_compare.py.
References _BuildCurrentBranch(), _CheckoutBranch(), _MeasureCurrentBranch(), _RestoreLocalChanges(), _StashLocalChanges(), after_build_dir, before_build_dir, and git.
Referenced by Run().
|
protected |
Profiles the current branch with and without uncommitted changes. This is done in new, cloned repositories, therefore it is safer but slower and requires downloads. Returns: A tuple (before, after), where each of before and after is a dict mapping a test case name to the profiling values for that test case using the given version. The current branch without uncommitted changes is considered to be "before" and with uncommitted changes is considered to be "after".
Definition at line 276 of file safetynet_compare.py.
References _ProfileCurrentAndOtherBranch().
Referenced by Run().
|
protected |
Profiles the current branch with and without uncommitted changes. This is done in the local repository and changes may not be restored if the script fails or is interrupted. Returns: A tuple (before, after), where each of before and after is a dict mapping a test case name to the profiling values for that test case using the given version. The current branch without uncommitted changes is considered to be "before" and with uncommitted changes is considered to be "after".
Definition at line 247 of file safetynet_compare.py.
References _BuildCurrentBranch(), _MeasureCurrentBranch(), _RestoreLocalChanges(), _StashLocalChanges(), after_build_dir, QD3D11CommandBuffer::Command.args, QDBusConnectionPrivate::ArgMatchRules.args, QEvdevUtil::ParsedSpecification.args, QGles2CommandBuffer::Command.args, QMakeInternal::QMakeBuiltinInit.args, QQmlApplicationPrivate.args, QSignalSpy.args, QV4::CallData.args, QV4::JSCallArguments.args, QV4::JSCallData.args, QVkCommandBuffer::Command.args, args, Tracepoint.args, VkSpecParser::Command.args, and before_build_dir.
Referenced by Run().
|
protected |
Profiles a branch in a a temporary git repository. Args: run_label: String to differentiate this version of the code in output files from other versions. relative_build_dir: Path to the build dir in the current working dir to clone build args from. branch: Branch to checkout in the new repository. None will profile the same branch checked out in the original repo. Returns: A dict mapping each test case name to the profiling values for that test case.
Definition at line 291 of file safetynet_compare.py.
References _BuildCurrentBranch(), _CreateTempRepo(), and _MeasureCurrentBranch().
Referenced by _ProfileCurrentAndOtherBranch(), and _ProfileTwoOtherBranches().
|
protected |
Profiles two branches that are not the current branch. This is done in new, cloned repositories, therefore it is safer but slower and requires downloads. after_branch does not need to descend from before_branch, they will be measured the same way Args: before_branch: One branch to profile. after_branch: Other branch to profile. Returns: A tuple (before, after), where each of before and after is a dict mapping a test case name to the profiling values for that test case in the given branch.
Definition at line 164 of file safetynet_compare.py.
References _ProfileSeparateRepo(), after_build_dir, and before_build_dir.
Referenced by Run().
|
protected |
Profiles two branches that are not the current branch. This is done in the local repository and changes may not be restored if the script fails or is interrupted. after_branch does not need to descend from before_branch, they will be measured the same way Args: before_branch: One branch to profile. after_branch: Other branch to profile. Returns: A tuple (before, after), where each of before and after is a dict mapping a test case name to the profiling values for that test case in the given branch.
Definition at line 129 of file safetynet_compare.py.
References _BuildCurrentBranch(), _CheckoutBranch(), _MeasureCurrentBranch(), _RestoreLocalChanges(), _StashLocalChanges(), after_build_dir, before_build_dir, and git.
Referenced by Run().
|
protected |
Definition at line 373 of file safetynet_compare.py.
References git.
Referenced by _ProfileCurrentAndOtherBranchInThisRepo(), _ProfileLocalChangesAndCurrentBranchInThisRepo(), and _ProfileTwoOtherBranchesInThisRepo().
|
protected |
Profiles the test cases asynchronously. Uses as many workers as configured by --num-workers. Args: run_label: String to differentiate this version of the code in output files from other versions. build_dir: String with path to build directory Returns: A dict mapping each test case name to the profiling values for that test case.
Definition at line 426 of file safetynet_compare.py.
References QD3D11CommandBuffer::Command.args, QDBusConnectionPrivate::ArgMatchRules.args, QEvdevUtil::ParsedSpecification.args, QGles2CommandBuffer::Command.args, QMakeInternal::QMakeBuiltinInit.args, QQmlApplicationPrivate.args, QSignalSpy.args, QV4::CallData.args, QV4::JSCallArguments.args, QV4::JSCallData.args, QVkCommandBuffer::Command.args, args, Tracepoint.args, VkSpecParser::Command.args, get(), and test_cases.
Referenced by _MeasureCurrentBranch().
|
protected |
Profiles the test cases synchronously. Args: run_label: String to differentiate this version of the code in output files from other versions. build_dir: String with path to build directory Returns: A dict mapping each test case name to the profiling values for that test case.
Definition at line 405 of file safetynet_compare.py.
References RunSingleTestCase(), and test_cases.
Referenced by _MeasureCurrentBranch().
|
protected |
Definition at line 369 of file safetynet_compare.py.
References git.
Referenced by _ProfileCurrentAndOtherBranchInThisRepo(), _ProfileLocalChangesAndCurrentBranchInThisRepo(), and _ProfileTwoOtherBranchesInThisRepo().
testing.tools.safetynet_compare.CompareRun.Run | ( | self | ) |
Runs comparison by checking out branches, building and measuring them. Returns: Exit code for the script.
Definition at line 71 of file safetynet_compare.py.
References _CleanUp(), _DrawConclusions(), _FreezeMeasureScript(), _PrintConclusions(), _ProfileCurrentAndOtherBranch(), _ProfileCurrentAndOtherBranchInThisRepo(), _ProfileLocalChangesAndCurrentBranch(), _ProfileLocalChangesAndCurrentBranchInThisRepo(), _ProfileTwoOtherBranches(), _ProfileTwoOtherBranchesInThisRepo(), after_build_dir, QD3D11CommandBuffer::Command.args, QDBusConnectionPrivate::ArgMatchRules.args, QEvdevUtil::ParsedSpecification.args, QGles2CommandBuffer::Command.args, QMakeInternal::QMakeBuiltinInit.args, QQmlApplicationPrivate.args, QSignalSpy.args, QV4::CallData.args, QV4::JSCallArguments.args, QV4::JSCallData.args, QVkCommandBuffer::Command.args, args, Tracepoint.args, and VkSpecParser::Command.args.
testing.tools.safetynet_compare.CompareRun.RunSingleTestCase | ( | self, | |
run_label, | |||
build_dir, | |||
test_case ) |
Profiles a single test case. Args: run_label: String to differentiate this version of the code in output files from other versions. build_dir: String with path to build directory test_case: Path to the test case. Returns: The measured profiling value for that test case.
Definition at line 465 of file safetynet_compare.py.
References _GetProfileFilePath(), _MoveImages(), QD3D11CommandBuffer::Command.args, QDBusConnectionPrivate::ArgMatchRules.args, QEvdevUtil::ParsedSpecification.args, QGles2CommandBuffer::Command.args, QMakeInternal::QMakeBuiltinInit.args, QQmlApplicationPrivate.args, QSignalSpy.args, QV4::CallData.args, QV4::JSCallArguments.args, QV4::JSCallData.args, QVkCommandBuffer::Command.args, args, Tracepoint.args, VkSpecParser::Command.args, and safe_measure_script_path.
Referenced by _RunSync().
testing.tools.safetynet_compare.CompareRun.after_build_dir = self.args.build_dir |
Definition at line 65 of file safetynet_compare.py.
Referenced by _ProfileCurrentAndOtherBranch(), _ProfileCurrentAndOtherBranchInThisRepo(), _ProfileLocalChangesAndCurrentBranchInThisRepo(), _ProfileTwoOtherBranches(), _ProfileTwoOtherBranchesInThisRepo(), and Run().
testing.tools.safetynet_compare.CompareRun.args = args |
Definition at line 40 of file safetynet_compare.py.
Referenced by testing.tools.safetynet_measure.PerformanceRun._BuildTestHarnessCommand(), _CleanUp(), _CreateTempRepo(), _DrawConclusions(), _GetProfileFilePath(), testing.tools.safetynet_job.JobRun._IncrementalRun(), _InitPaths(), _MeasureCurrentBranch(), _MoveImages(), _PrintConclusions(), _ProfileLocalChangesAndCurrentBranchInThisRepo(), _RunAsync(), testing.tools.safetynet_measure.PerformanceRun._RunCallgrind(), testing.tools.safetynet_job.JobRun._WriteCheckpoint(), Run(), testing.tools.safetynet_job.JobRun.Run(), testing.tools.safetynet_measure.PerformanceRun.Run(), and RunSingleTestCase().
testing.tools.safetynet_compare.CompareRun.before_build_dir = self.args.build_dir_before |
Definition at line 67 of file safetynet_compare.py.
Referenced by _ProfileCurrentAndOtherBranch(), _ProfileCurrentAndOtherBranchInThisRepo(), _ProfileLocalChangesAndCurrentBranchInThisRepo(), _ProfileTwoOtherBranches(), and _ProfileTwoOtherBranchesInThisRepo().
testing.tools.safetynet_compare.CompareRun.git = GitHelper() |
Definition at line 39 of file safetynet_compare.py.
Referenced by _CheckoutBranch(), _CreateTempRepo(), testing.tools.safetynet_job.JobRun._IncrementalRun(), testing.tools.safetynet_job.JobRun._InitialRun(), _ProfileCurrentAndOtherBranchInThisRepo(), _ProfileTwoOtherBranchesInThisRepo(), _RestoreLocalChanges(), _StashLocalChanges(), and testing.tools.safetynet_job.JobRun.Run().
testing.tools.safetynet_compare.CompareRun.safe_measure_script_path |
Definition at line 49 of file safetynet_compare.py.
Referenced by RunSingleTestCase().
testing.tools.safetynet_compare.CompareRun.safe_script_dir = self.args.build_dir |
Definition at line 45 of file safetynet_compare.py.
Referenced by _FreezeMeasureScript().
testing.tools.safetynet_compare.CompareRun.test_cases = [] |
Definition at line 53 of file safetynet_compare.py.
Referenced by testing.tools.test_runner.TestCaseManager.__iter__(), testing.tools.test_runner.TestCaseManager.__len__(), _DrawConclusions(), _MeasureCurrentBranch(), testing.tools.test_runner.TestRunner._PrintSummary(), _RunAsync(), _RunSync(), testing.tools.test_runner.TestCaseManager.GetTestCase(), and testing.tools.test_runner.TestCaseManager.NewTestCase().