/******************************** Constructors/Destructors ******************************/
-CvTS::CvTS()
+CvTS::CvTS(const char* _module_name)
{
+ module_name = _module_name;
start_time = 0;
version = CV_TS_VERSION;
memory_manager = 0;
}
}
-#if 0
-//#if !defined WIN32 && !defined _WIN32
- if (! config_name )
- {
- char * confname = getenv("configname");
- if (confname)
- config_name = confname;
- }
-
- if( !params.data_path || !params.data_path[0] )
- {
- char* datapath = getenv("datapath");
- if( datapath )
- set_data_path(datapath);
- }
-
// this is the fallback for the current OpenCV autotools setup
if( !params.data_path || !params.data_path[0] )
{
- char* srcdir = getenv("srcdir");
+ char* datapath_dir = getenv("OPENCV_TEST_DATA_PATH");
char buf[1024];
- if( srcdir )
+ if( datapath_dir )
{
- sprintf( buf, "%s/../../opencv_extra/testdata/", srcdir );
+ sprintf( buf, "%s/%s", datapath_dir, module_name ? module_name : "" );
+ printf( LOG + CONSOLE + SUMMARY, "Data Path = %s\n", buf);
set_data_path(buf);
}
}
-#endif
if( write_params )
{
}
}
+ int filter_state = 0;
+
// 4. traverse through the list of all registered tests.
// Initialize the selected tests and put them into the separate sequence
for( i = 0; i < all_tests.size(); i++ )
if( !(test->get_support_testing_modes() & get_testing_mode()) )
continue;
- if( strcmp( test->get_func_list(), "" ) != 0 && filter(test, blacklist) )
+ if( strcmp( test->get_func_list(), "" ) != 0 && filter(test, filter_state, blacklist) )
{
if( test->init(this) >= 0 )
{
}
-int CvTS::filter( CvTest* test, const char** blacklist )
+int CvTS::filter( CvTest* test, int& filter_state, const char** blacklist )
{
const char* pattern = params.test_filter_pattern;
const char* test_name = test->get_name();
int inverse = 0;
+ int greater_or_equal = 0;
if( blacklist )
{
inverse = 1;
pattern++;
}
-
+
+ if( pattern && pattern[0] == '>' )
+ {
+ greater_or_equal = 1;
+ pattern++;
+ if( pattern[0] == '=' )
+ {
+ greater_or_equal = 2;
+ pattern++;
+ }
+ }
+
if( !pattern || strcmp( pattern, "" ) == 0 || strcmp( pattern, "*" ) == 0 )
return 1 ^ inverse;
break;
}
- return found ^ inverse;
+ if( greater_or_equal == 0 )
+ return found ^ inverse;
+ if( filter_state )
+ return inverse^1;
+ if( !found )
+ return inverse;
+ if( greater_or_equal == 1 )
+ {
+ filter_state = 1;
+ return inverse;
+ }
+ if( greater_or_equal == 2 )
+ {
+ filter_state = 1;
+ return inverse ^ 1;
+ }
}
else
{
public:
// constructor(s) and destructor
- CvTS();
+ CvTS(const char* _module_name=0);
virtual ~CvTS();
enum
virtual int read_params( CvFileStorage* fs );
// checks, whether the test needs to be run (1) or not (0); called from run()
- virtual int filter( CvTest* test, const char** blacklist=0 );
+ virtual int filter( CvTest* test, int& filter_state, const char** blacklist=0 );
// makes base name of output files
virtual void make_output_stream_base_name( const char* config_name );
// name of config file
const char* config_name;
+
+ const char* module_name;
// information about the current test
CvTestInfo current_test_info;