summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
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");