![]() |
Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
|
Public Member Functions | |
None | __init__ (self, str test_filename, Options options) |
str | name (self) |
None | launch (self) |
bool | analyze (self) |
bool | run (self) |
None | __init__ (self, str test_filename, Options options) |
str | name (self) |
None | launch (self) |
bool | analyze (self) |
bool | run (self) |
Protected Member Functions | |
None | _log (self, *args, **kwargs) |
None | _vlog (self, *args, **kwargs) |
typing.Dict[str, str] | _test_environment (self) |
None | _launch_test (self) |
None | _join_test (self) |
None | _check_output_exact (self, str out_name, bytes expected, str exact_name) |
None | _check_output_glob (self, str out_name, bytes expected) |
None | _check_output (self, str out_name) |
None | _check_stderr (self) |
None | _check_stdout (self) |
None | _check_exit (self) |
None | _analyze_results (self) |
None | _log (self, *args, **kwargs) |
None | _vlog (self, *args, **kwargs) |
typing.Dict[str, str] | _test_environment (self) |
None | _launch_test (self) |
None | _join_test (self) |
None | _check_output_exact (self, str out_name, bytes expected, str exact_name) |
None | _check_output_glob (self, str out_name, bytes expected) |
None | _check_output (self, str out_name) |
None | _check_stderr (self) |
None | _check_stdout (self) |
None | _check_exit (self) |
None | _analyze_results (self) |
Protected Attributes | |
_opts = options | |
_test_file = test_filename | |
_test_name | |
dict | _success = {} |
dict | _message = {} |
_test_stdin = None | |
_scratch_dir = os.path.abspath(os.path.join(self._opts.scratch_dir, self._test_name)) | |
_test_process | |
dict | _output = {} |
_exit_code = self._test_process.returncode | |
_succeeded = all(self._success.values()) | |
Logic and state related to running a single test case. 1. Initialize the test case. 2. Launch the test case with :TestCase.launch():. This will start the test execution in a subprocess, but not wait for completion. So you could launch multiple test cases in parallel. This will now print any test output. 3. Analyze the results with :TestCase.analyze():. This will join the test subprocess, check the results against the expectations, and print the results to stdout. :TestCase.run(): is also provided which combines the launch & analyze steps for single-threaded use-cases. All other methods, prefixed with _, are private helper functions.
Initialize the :TestCase: for the test located in :test_filename: with the given :options:.
Initialize the :TestCase: for the test located in :test_filename: with the given :options:.
|
protected |
After all tests have been checked, collect all the successes and messages, and print the results to stdout.
|
protected |
After all tests have been checked, collect all the successes and messages, and print the results to stdout.
|
protected |
Checks the exit code against expectations. If a .exit file exists, we expect that the exit code matches the contents. Otherwise we expect the exit code to be zero. If :Options.preserve: is set we save the exit code to the scratch directory under the filename "exit".
|
protected |
Checks the exit code against expectations. If a .exit file exists, we expect that the exit code matches the contents. Otherwise we expect the exit code to be zero. If :Options.preserve: is set we save the exit code to the scratch directory under the filename "exit".
|
protected |
Checks the output named :out_name: for a match against the expectation. We check for a .exact, .glob, and a .ignore file. If none are found we expect that the output should be empty. If :Options.preserve: was set then we save the scratch directory and save the stderr, stdout, and exit code to the scratch directory for debugging.
|
protected |
Checks the output named :out_name: for a match against the expectation. We check for a .exact, .glob, and a .ignore file. If none are found we expect that the output should be empty. If :Options.preserve: was set then we save the scratch directory and save the stderr, stdout, and exit code to the scratch directory for debugging.
Check the output named :out_name: for an exact match against the :expected: content. Saves the success and message.
Check the output named :out_name: for an exact match against the :expected: content. Saves the success and message.
Check the output named :out_name: for a glob match against the :expected: glob. Saves the success and message.
Check the output named :out_name: for a glob match against the :expected: glob. Saves the success and message.
|
protected |
Checks the stderr output against the expectation.
|
protected |
Checks the stderr output against the expectation.
|
protected |
Checks the stdout output against the expectation.
|
protected |
Checks the stdout output against the expectation.
|
protected |
Join the test process and save stderr, stdout, and the exit code.
|
protected |
Join the test process and save stderr, stdout, and the exit code.
|
protected |
Launch the test subprocess, but do not join it.
|
protected |
Launch the test subprocess, but do not join it.
|
protected |
Logs test output.
|
protected |
Logs test output.
Returns the environment to be used for the test subprocess.
Returns the environment to be used for the test subprocess.
|
protected |
Logs verbose test output.
|
protected |
Logs verbose test output.
bool analyze | ( | self | ) |
Must be called after :TestCase.launch():. Joins the test subprocess and checks the results against expectations. Finally prints the results to stdout and returns the success.
bool analyze | ( | self | ) |
Must be called after :TestCase.launch():. Joins the test subprocess and checks the results against expectations. Finally prints the results to stdout and returns the success.
None launch | ( | self | ) |
Launch the test case as a subprocess, but do not block on completion. This allows users to run multiple tests in parallel. Results aren't yet printed out.
None launch | ( | self | ) |
Launch the test case as a subprocess, but do not block on completion. This allows users to run multiple tests in parallel. Results aren't yet printed out.
str name | ( | self | ) |
Returns the unique name for the test.
str name | ( | self | ) |
Returns the unique name for the test.
bool run | ( | self | ) |
Shorthand for combining both :TestCase.launch(): and :TestCase.analyze():.
bool run | ( | self | ) |
Shorthand for combining both :TestCase.launch(): and :TestCase.analyze():.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |