Default test driver implementation. More...
#include <iterator>
#include <unistd.h>
Go to the source code of this file.
Functions | |
int | binary_diff (const char *testfile, const char *baseline) |
Compare two files byte by byte. | |
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. | |
void | testdriversetup (int *argc, char **argv[]) |
Parse command-line arguments and initialize test driver. | |
int | text_diff_lines (const char *testfile, const char *baseline, unsigned int max_number_of_differences) |
Compare two text files line by line. |
Detailed Description
Default test driver implementation.
Copyright (c) 2011, 2012 University of Pennsylvania. All rights reserved.
See https://www.cbica.upenn.edu/sbia/software/license.html or COPYING file.
Contact: SBIA Group <sbia-software at uphs.upenn.edu>
Definition in file testdriver.hxx.
Function Documentation
int binary_diff | ( | const char * | testfile, |
const char * | baseline | ||
) |
Compare two files byte by byte.
- Parameters:
-
[in] testfile File generated by test. [in] baseline Baseline file.
- Return values:
-
-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 185 of file testdriver.hxx.
vector<string> get_baseline_filenames | ( | string | filename_template | ) |
Definition at line 268 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.
- Parameters:
-
[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.
- Returns:
- Number of voxels with a difference above the set
intensity_tolerance
.
Definition at line 295 of file testdriver.hxx.
void testdriversetup | ( | int * | argc, |
char ** | argv[] | ||
) |
Parse command-line arguments and initialize test driver.
- Parameters:
-
[in] argc Number of arguments. [in] argv Command-line arguments.
Definition at line 38 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.
- Parameters:
-
[in] testfile File generated by test. [in] baseline Baseline file. [in] max_number_of_differences Number of lines that may differ at most.
- Return values:
-
-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
lines1 if the two files differ in more than the allowed number of lines
Definition at line 226 of file testdriver.hxx.