summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-05-25 09:06:09 +0000
committerDavid Robillard <d@drobilla.net>2015-05-25 09:06:09 +0000
commit4f00b8a2ae7148b3a13fd6af0e79eb9b6abf5634 (patch)
treed1e0ebef3f808c11b90a38e94bf1fc94fdd37976 /tests
parent7408e3bda837654463ea547e10e16ca2087f1c64 (diff)
downloadingen-4f00b8a2ae7148b3a13fd6af0e79eb9b6abf5634.tar.gz
ingen-4f00b8a2ae7148b3a13fd6af0e79eb9b6abf5634.tar.bz2
ingen-4f00b8a2ae7148b3a13fd6af0e79eb9b6abf5634.zip
Fix ingen_test command line arguments.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5686 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'tests')
-rw-r--r--tests/ingen_test.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp
index 4594bee1..39de3d33 100644
--- a/tests/ingen_test.cpp
+++ b/tests/ingen_test.cpp
@@ -132,16 +132,6 @@ main(int argc, char** argv)
Glib::thread_init();
set_bundle_path_from_code((void*)&main);
- if (argc != 3) {
- cerr << "Usage: ingen_test START_GRAPH COMMANDS_FILE" << endl;
- return EXIT_FAILURE;
- }
-
- char* real_start_graph = realpath(argv[1], NULL);
- const std::string start_graph = real_start_graph;
- const std::string cmds_file_path = argv[2];
- free(real_start_graph);
-
// Create world
try {
world = new World(argc, argv, NULL, NULL, NULL);
@@ -150,6 +140,20 @@ main(int argc, char** argv)
return EXIT_FAILURE;
}
+ // Get mandatory command line arguments
+ const Atom& load = world->conf().option("load");
+ const Atom& execute = world->conf().option("execute");
+ if (!load.is_valid() || !execute.is_valid()) {
+ cerr << "Usage: ingen_test --load START_GRAPH --execute COMMANDS_FILE" << endl;
+ return EXIT_FAILURE;
+ }
+
+ // Get start graph and commands file options
+ char* real_start_graph = realpath((const char*)load.get_body(), NULL);
+ const std::string start_graph = real_start_graph;
+ const std::string cmds_file_path = (const char*)execute.get_body();
+ free(real_start_graph);
+
// Load modules
ingen_try(world->load_module("server_profiled"),
"Unable to load server module");