Skip to content
Snippets Groups Projects
Commit e1108a98 authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

ENH: look at the test existence before launching it

parent f049b969
No related branches found
No related tags found
No related merge requests found
......@@ -263,16 +263,26 @@ int main(int ac, char* av[])
}
testToRun = av[1];
}
std::map<std::string, MainFuncPointer>::iterator j = StringToTestFunctionMap.find(testToRun);
// If the test doesn't exists
if ( j == StringToTestFunctionMap.end() )
{
PrintAvailableTests();
std::cerr << "Failure: " << testToRun << ": no test identified " << testToRun << "\n";
return -1;
}
if (j != StringToTestFunctionMap.end())
{
std::cout<<"goooo?: "<<std::endl;
MainFuncPointer f = j->second;
int result;
try
{
// Invoke the test's "main" function.
result = (*f)(ac - 1, av + 1);
if (result != EXIT_SUCCESS)
if (result != EXIT_SUCCESS )
{
std::cout << "-> Test EXIT FAILURE (" << result << ")." << std::endl;
itkGenericExceptionMacro(<< "Function returns EXIT_FAILURE (no regression test)");
......@@ -303,13 +313,14 @@ int main(int ac, char* av[])
result = EXIT_FAILURE;
}
if (result != EXIT_SUCCESS)
std::cout<<"result: "<<result<<std::endl;
if (result != EXIT_SUCCESS )
{
PrintAvailableTests();
std::cerr << "Failure: " << testToRun << ": no test identified " << testToRun << "\n";
return -1;
return -1;
}
result = EXIT_SUCCESS;
std::cout << " -> Test EXIT SUCCESS." << std::endl;
if (lFlagRegression == false)
......
......@@ -27,5 +27,6 @@ int otbFuzzyVariableNew(int argc, char* argv[])
FuzzyVarType::Pointer fv = FuzzyVarType::New();
return EXIT_SUCCESS;
//return EXIT_SUCCESS;
return EXIT_FAILURE;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment