From fae6cd2235c907e077dad7b5d8dc9b6d90a78a37 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 21 Nov 2016 15:14:07 +0200 Subject: Change build.driver/path variable to build.path/process_path --- build2/context.cxx | 25 +++++++++---------------- tests/function/path/buildfile | 2 +- tests/test/script/integration/buildfile | 2 +- tests/test/script/runner/cleanup.test | 2 +- tests/test/script/runner/status.test | 2 +- unit-tests/function/driver.cxx | 8 ++++---- unit-tests/test/script/parser/driver.cxx | 2 +- 7 files changed, 18 insertions(+), 25 deletions(-) diff --git a/build2/context.cxx b/build2/context.cxx index 3b58b90..a193abf 100644 --- a/build2/context.cxx +++ b/build2/context.cxx @@ -237,27 +237,20 @@ namespace build2 v.insert ("extension", variable_visibility::target); } - // Absolute path to the build system driver. - // - { - path p (argv0.effect_string ()); - - if (p.relative ()) - { - p = work / p; - p.normalize (); - } - - gs.assign ("build.driver") = move (p); - } - gs.assign ("build.work") = work; gs.assign ("build.home") = home; - // Enter the version. + // Build system driver process path. + // + gs.assign ("build.path") = + process_path (nullptr, // Will be filled by value assignment. + path (argv0.recall_string ()), + path (argv0.effect)); + + // Build system version. // { - gs.assign ("build.version") = uint64_t (BUILD2_VERSION); + gs.assign ("build.version") = uint64_t (BUILD2_VERSION); gs.assign ("build.version.string") = BUILD2_VERSION_STR; // AABBCCDD diff --git a/tests/function/path/buildfile b/tests/function/path/buildfile index db40358..8f51cab 100644 --- a/tests/function/path/buildfile +++ b/tests/function/path/buildfile @@ -4,4 +4,4 @@ ./: test{testscript} -test{*}: test = $build.driver +test{*}: test = $effect($build.path) diff --git a/tests/test/script/integration/buildfile b/tests/test/script/integration/buildfile index 9b7b906..d2b77c9 100644 --- a/tests/test/script/integration/buildfile +++ b/tests/test/script/integration/buildfile @@ -4,4 +4,4 @@ ./: test{testscript} -test{*}: test = $build.driver +test{*}: test = $effect($build.path) diff --git a/tests/test/script/runner/cleanup.test b/tests/test/script/runner/cleanup.test index 4cd8650..5018bd1 100644 --- a/tests/test/script/runner/cleanup.test +++ b/tests/test/script/runner/cleanup.test @@ -10,7 +10,7 @@ amalgamation = using test EOI -b = $build.driver -q --no-column --buildfile - <"./: test{testscript}" \ +b = $effect($build.path) -q --no-column --buildfile - <"./: test{testscript}" \ &?test/*** test c = cat >>>testscript test = \'$test\' diff --git a/tests/test/script/runner/status.test b/tests/test/script/runner/status.test index 00d7257..09d5b16 100644 --- a/tests/test/script/runner/status.test +++ b/tests/test/script/runner/status.test @@ -10,7 +10,7 @@ amalgamation = using test EOI -b = $build.driver -q --no-column --buildfile - <"./: test{testscript}" \ +b = $effect($build.path) -q --no-column --buildfile - <"./: test{testscript}" \ &?test/*** test c = cat >>>testscript test = \'$test\' diff --git a/unit-tests/function/driver.cxx b/unit-tests/function/driver.cxx index 0708cea..192b954 100644 --- a/unit-tests/function/driver.cxx +++ b/unit-tests/function/driver.cxx @@ -23,9 +23,9 @@ namespace build2 }; int - main () + main (int, char* argv[]) { - init ("false", 1); // No build system driver, default verbosity. + init (argv[0], 1); // Fake build system driver, default verbosity. reset (strings ()); // No command line variables. function_family f ("dummy"); @@ -106,7 +106,7 @@ namespace build2 } int -main () +main (int argc, char* argv[]) { - return build2::main (); + return build2::main (argc, argv); } diff --git a/unit-tests/test/script/parser/driver.cxx b/unit-tests/test/script/parser/driver.cxx index 0fcba38..83160cb 100644 --- a/unit-tests/test/script/parser/driver.cxx +++ b/unit-tests/test/script/parser/driver.cxx @@ -135,7 +135,7 @@ namespace build2 { tracer trace ("main"); - init ("false", 1); // No build system driver, default verbosity. + init (argv[0], 1); // Fake build system driver, default verbosity. reset (strings ()); // No command line variables. bool scope (false); -- cgit v1.1