diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-10-21 17:07:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 09:26:34 +0200 |
commit | d9b26553b67e87dd45b652dd91eaac782fdf91f9 (patch) | |
tree | a42f2e8d4d6bf2e6232861b57d262d2cf8cc0a33 /unit-tests/test/script/parser/driver.cxx | |
parent | a36a5042a35ddf5e8e32dd351168d9e71cd761f2 (diff) |
Add support for testscript scope id, working directory
Diffstat (limited to 'unit-tests/test/script/parser/driver.cxx')
-rw-r--r-- | unit-tests/test/script/parser/driver.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/unit-tests/test/script/parser/driver.cxx b/unit-tests/test/script/parser/driver.cxx index 148a081..db253eb 100644 --- a/unit-tests/test/script/parser/driver.cxx +++ b/unit-tests/test/script/parser/driver.cxx @@ -29,7 +29,7 @@ namespace build2 { public: virtual void - run (const command& t, size_t, const location&) override + run (const scope&, const command& t, size_t, const location&) override { // Here we assume we are running serially. // @@ -37,8 +37,10 @@ namespace build2 } }; + // Usage: argv[0] [<testscript-name>] + // int - main () + main (int argc, char* argv[]) { tracer trace ("main"); @@ -47,7 +49,7 @@ namespace build2 try { - path name ("testscript"); + path name (argc > 1 ? argv[1] : "testscript"); cin.exceptions (istream::failbit | istream::badbit); // Enter mock targets. Use fixed names and paths so that we can use @@ -70,7 +72,7 @@ namespace build2 trace)); tt.path (path ("driver")); - st.path (path ("testscript")); + st.path (name); // Parse and run. // @@ -93,7 +95,7 @@ namespace build2 } int -main () +main (int argc, char* argv[]) { - return build2::test::script::main (); + return build2::test::script::main (argc, argv); } |