Commit b9dc4ac2 authored by Emmanuel Promayon's avatar Emmanuel Promayon
Browse files

FIXED testaction needs to have a valid component extension

parent 4c785127
......@@ -99,9 +99,9 @@ int main(int argc, char* argv[]) {
}
// check input files
QFileInfo inputComponent{o.input().c_str()};
QFileInfo inputActionExtension{o.action().c_str()};
QFileInfo additionaleComponentExtension{o.component().c_str()};
QFileInfo inputComponent {o.input().c_str()};
QFileInfo inputActionExtension {o.action().c_str()};
QFileInfo additionaleComponentExtension {o.component().c_str()};
if (!inputComponent.exists()) {
usage("Argument error: component test file \"" + o.input() + "\" does not exist.");
......@@ -112,13 +112,15 @@ int main(int argc, char* argv[]) {
usage("Argument error: action dll/so file \"" + o.action() + "\" does not exist.");
return EXIT_FAILURE;
}
if (!o.component().empty() && !additionaleComponentExtension.exists()) {
usage("Argument error: action dll/so file \"" + o.component() + "\" does not exist.");
return EXIT_FAILURE;
}
else {
loadAdditionnalComponentExtension = true;
if (!o.component().empty()) {
if (!additionaleComponentExtension.exists()) {
usage("Argument error: action dll/so file \"" + o.component() + "\" does not exist.");
return EXIT_FAILURE;
}
else {
loadAdditionnalComponentExtension = true;
}
}
std::cout << "camitk-testactions run with arguments:" << std::endl;
......@@ -127,7 +129,7 @@ int main(int argc, char* argv[]) {
if (loadAdditionnalComponentExtension) {
std::cout << "- additional component extension: \"" << o.component() << "\"" << std::endl;
}
testInit("Starting the camitk default application...");
//-- init the camitk application context
......@@ -150,7 +152,7 @@ int main(int argc, char* argv[]) {
}
testPassed();
}
testInit("Opening component: " + o.input() + "...");
Component* comp = Application::open(o.input().data());
......@@ -224,7 +226,7 @@ int main(int argc, char* argv[]) {
}
std::cout << "Return status is: " << statusString << std::endl;
}
}
}
std::cout << std::endl;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment