summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/ingen_test.cpp24
-rw-r--r--wscript2
2 files changed, 15 insertions, 11 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");
diff --git a/wscript b/wscript
index 0e85c8ef..92f6b705 100644
--- a/wscript
+++ b/wscript
@@ -275,7 +275,7 @@ def test(ctx):
autowaf.pre_test(ctx, APPNAME, dirs=['.', 'src', 'tests'])
for i in ctx.path.ant_glob('tests/*.ttl'):
autowaf.run_tests(ctx, APPNAME,
- ['ingen_test ../tests/empty.ingen %s' % i.abspath()],
+ ['ingen_test --load ../tests/empty.ingen --execute %s' % i.abspath()],
dirs=['.', 'src', 'tests'])
autowaf.post_test(ctx, APPNAME, dirs=['.', 'src', 'tests'],
remove=['/usr*'])