mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
rename villas-config-check to villas-test-config
This commit is contained in:
parent
51f7179f0e
commit
7f3986e787
3 changed files with 38 additions and 11 deletions
|
@ -23,8 +23,8 @@
|
|||
add_executable(villas-node villas-node.cpp)
|
||||
target_link_libraries(villas-node PUBLIC villas)
|
||||
|
||||
add_executable(villas-config-check villas-config-check.cpp)
|
||||
target_link_libraries(villas-config-check PUBLIC villas)
|
||||
add_executable(villas-test-config villas-test-config.cpp)
|
||||
target_link_libraries(villas-test-config PUBLIC villas)
|
||||
|
||||
add_executable(villas-test-rtt villas-test-rtt.cpp)
|
||||
target_link_libraries(villas-test-rtt PUBLIC villas)
|
||||
|
|
|
@ -35,12 +35,14 @@ using namespace villas::node;
|
|||
|
||||
static void usage()
|
||||
{
|
||||
std::cout << "Usage: villas-config-check CONFIG" << std::endl
|
||||
<< " CONFIG is the path to an optional configuration file" << std::endl << std::endl;
|
||||
std::cout << "Usage: villas-test-config [OPTIONS] CONFIG" << std::endl
|
||||
<< " CONFIG is the path to an optional configuration file" << std::endl
|
||||
<< " OPTIONS is one or more of the following options:" << std::endl
|
||||
<< " -d LVL set debug level" << std::endl
|
||||
<< " -V show version and exit" << std::endl
|
||||
<< " -h show usage and exit" << std::endl << std::endl;
|
||||
|
||||
print_copyright();
|
||||
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
@ -48,11 +50,36 @@ int main(int argc, char *argv[])
|
|||
SuperNode sn;
|
||||
Logger logger = logging.get("config-test");
|
||||
|
||||
try {
|
||||
if (argc != 2)
|
||||
usage();
|
||||
bool check = false;
|
||||
|
||||
sn.parse(argv[1]);
|
||||
int c;
|
||||
while ((c = getopt (argc, argv, "hcV")) != -1) {
|
||||
switch (c) {
|
||||
case 'c':
|
||||
check = true;
|
||||
break;
|
||||
|
||||
case 'V':
|
||||
print_version();
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
case 'h':
|
||||
case '?':
|
||||
usage();
|
||||
exit(c == '?' ? EXIT_FAILURE : EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
if (argc - optind < 2) {
|
||||
usage();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
try {
|
||||
sn.parse(argv[argc - optind]);
|
||||
|
||||
if (check)
|
||||
sn.check();
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -38,5 +38,5 @@ for CONFIG in ${CONFIGS}; do
|
|||
fi
|
||||
|
||||
echo "=== Testing config: ${CONFIG}"
|
||||
villas-config-check ${CONFIG}
|
||||
villas-test-config ${CONFIG}
|
||||
done
|
Loading…
Add table
Reference in a new issue