From d9b26553b67e87dd45b652dd91eaac782fdf91f9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 21 Oct 2016 17:07:18 +0200 Subject: Add support for testscript scope id, working directory --- unit-tests/test/script/parser/driver.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'unit-tests/test/script/parser/driver.cxx') 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] [] + // 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); } -- cgit v1.1