Default test driver implementation. More...
#include <iterator>#include <unistd.h>
Include dependency graph for testdriver.hxx:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | _BASIS_TESTDRIVER_HXX |
Functions | |
| int | binary_diff (const char *testfile, const char *baseline) |
| Compare two files byte by byte. More... | |
| vector< string > | get_baseline_filenames (string filename_template) |
| int | image_regression_test (const char *imagefile, const char *baseline, double intensity_tolerance, unsigned int max_number_of_differences, unsigned int tolerance_radius, bool orientation_insensitive, int report) |
| Compare output image to baseline image. More... | |
| void | testdriversetup (int *argc, char **argv[]) |
| Parse command-line arguments and initialize test driver. More... | |
| int | text_diff_lines (const char *testfile, const char *baseline, unsigned int max_number_of_differences) |
| Compare two text files line by line. More... | |
Default test driver implementation.
Definition in file testdriver.hxx.
| #define _BASIS_TESTDRIVER_HXX |
Definition at line 17 of file testdriver.hxx.
| int binary_diff | ( | const char * | testfile, |
| const char * | baseline | ||
| ) |
Compare two files byte by byte.
| [in] | testfile | File generated by test. |
| [in] | baseline | Baseline file. |
| -1 | if the test file could not be read |
| -2 | if the baseline file could not be read |
| 0 | if the two files are identical |
| 1 | if the two files differ |
Definition at line 189 of file testdriver.hxx.
| vector<string> get_baseline_filenames | ( | string | filename_template | ) |
Definition at line 272 of file testdriver.hxx.
| int image_regression_test | ( | const char * | imagefile, |
| const char * | baseline, | ||
| double | intensity_tolerance = 2.0, |
||
| unsigned int | max_number_of_differences = 0, |
||
| unsigned int | tolerance_radius = 0, |
||
| bool | orientation_insensitive = false, |
||
| int | report = 0 |
||
| ) |
Compare output image to baseline image.
This function compares a given image to a baseline image and returns a regression test result depending on how well the output image matches the baseline image given the provided tolerance arguments.
| [in] | imagefile | Output image file of test run. |
| [in] | baseline | Baseline image file. |
| [in] | intensity_tolerance | Maximum tolerable intensity difference. |
| [in] | max_number_of_differences | Maximum number of differing pixels. |
| [in] | tolerance_radius | Tolerance radius. |
| [in] | orientation_insensitive | Change orientation of both images to a common coordinate orientation before comparing them. |
| [in] | report | Level of test report to generate. If zero, no report is generated. If greater than zero, a report is generated. Similar to the verbosity of a program, is this parameter used to set the verbosity of the report. Most implementations yet only either generate a (full) report or none. |
intensity_tolerance. Definition at line 299 of file testdriver.hxx.
| void testdriversetup | ( | int * | argc, |
| char ** | argv[] | ||
| ) |
Parse command-line arguments and initialize test driver.
| [in] | argc | Number of arguments. |
| [in] | argv | Command-line arguments. |
Definition at line 42 of file testdriver.hxx.
| int text_diff_lines | ( | const char * | testfile, |
| const char * | baseline, | ||
| unsigned int | max_number_of_differences = 0 |
||
| ) |
Compare two text files line by line.
| [in] | testfile | File generated by test. |
| [in] | baseline | Baseline file. |
| [in] | max_number_of_differences | Number of lines that may differ at most. |
| -1 | if the test file could not be read |
| -2 | if the baseline file could not be read |
| 0 | if the two files differ in no more than max_number_of_differences lines |
| 1 | if the two files differ in more than the allowed number of lines |
Definition at line 230 of file testdriver.hxx.