From b82298fbb340446303c9510b56d41cead9d0755b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 16 Oct 2019 07:55:02 +0200 Subject: Escape quoting in config.{c,cxx} paths when passing to tests This is needed due to the command line re-parsing (see "Lexical Structure" in the Testscript manual for details). --- tests/ci.testscript | 2 +- tests/common.testscript | 3 ++- tests/config.testscript | 2 +- tests/fetch.testscript | 2 +- tests/init.testscript | 2 +- tests/new.testscript | 4 ++-- tests/publish.testscript | 2 +- tests/status.testscript | 2 +- tests/sync.testscript | 2 +- tests/test.testscript | 2 +- tests/update.testscript | 2 +- 11 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/ci.testscript b/tests/ci.testscript index b56b4eb..6fa73eb 100644 --- a/tests/ci.testscript +++ b/tests/ci.testscript @@ -52,7 +52,7 @@ repository='http://example.com/prj.git' test.arguments += --yes --repository "$repository" --server "$server" \ --simulate 'success' -cxx = cc config.cxx="'$recall($cxx.path)'" +cxx = cc config.cxx="\\'$recall($cxx.path)\\'" new += 2>! init += $cxx -d prj 2>! &prj/**/bootstrap/*** diff --git a/tests/common.testscript b/tests/common.testscript index bee2cee..cf5931d 100644 --- a/tests/common.testscript +++ b/tests/common.testscript @@ -17,7 +17,8 @@ build = $recall($build.path) # Disable loading the user's default options files (that may affect the test # commands execution) for bdep, bpkg, and build2. # -# @@ Quote paths similar to config.cxx (how does it even work on Windows)? +# Note that this works without quoting on Windows because of the effective +# escaping during the command line re-parse. # options_guard = $~/.build2 +mkdir $options_guard diff --git a/tests/config.testscript b/tests/config.testscript index 11ec4ef..dedb552 100644 --- a/tests/config.testscript +++ b/tests/config.testscript @@ -7,7 +7,7 @@ .include common.testscript project.testscript -cxx = cc config.cxx="'$recall($cxx.path)'" +cxx = cc config.cxx="\\'$recall($cxx.path)\\'" status += -d prj init += -d prj diff --git a/tests/fetch.testscript b/tests/fetch.testscript index 6e4645b..0aa7f1d 100644 --- a/tests/fetch.testscript +++ b/tests/fetch.testscript @@ -4,7 +4,7 @@ .include common.testscript project.testscript -cxx = cc config.cxx="'$recall($cxx.path)'" +cxx = cc config.cxx="\\'$recall($cxx.path)\\'" new += 2>! init += $cxx -d prj 2>! diff --git a/tests/init.testscript b/tests/init.testscript index ccc1775..3fb23a8 100644 --- a/tests/init.testscript +++ b/tests/init.testscript @@ -7,7 +7,7 @@ .include common.testscript project.testscript -cxx = cc config.cxx="'$recall($cxx.path)'" +cxx = cc config.cxx="\\'$recall($cxx.path)\\'" status += -d prj deinit += -d prj diff --git a/tests/new.testscript b/tests/new.testscript index 3692e54..f5b105c 100644 --- a/tests/new.testscript +++ b/tests/new.testscript @@ -14,8 +14,8 @@ c_tests = ($c.target.class != 'windows' && $c.target.class != 'macos') # test.arguments += --no-checks -c = config.c="'$recall($c.path)'" -cxx = config.cxx="'$recall($cxx.path)'" +c = config.c="\\'$recall($c.path)\\'" +cxx = config.cxx="\\'$recall($cxx.path)\\'" status += -d prj diff --git a/tests/publish.testscript b/tests/publish.testscript index d10c3fe..b34e8e2 100644 --- a/tests/publish.testscript +++ b/tests/publish.testscript @@ -30,7 +30,7 @@ end test.arguments += --repository "$repository" --yes \ --author-name user --author-email user@example.com -cxx = cc config.cxx="'$recall($cxx.path)'" +cxx = cc config.cxx="\\'$recall($cxx.path)\\'" new += 2>! init += $cxx -d prj 2>! &prj/**/bootstrap/*** diff --git a/tests/status.testscript b/tests/status.testscript index 27a6a60..d1b430e 100644 --- a/tests/status.testscript +++ b/tests/status.testscript @@ -4,7 +4,7 @@ .include common.testscript project.testscript -cxx = cc config.cxx="'$recall($cxx.path)'" +cxx = cc config.cxx="\\'$recall($cxx.path)\\'" new += 2>! init += $cxx -d prj 2>! diff --git a/tests/sync.testscript b/tests/sync.testscript index c0caab1..666fa86 100644 --- a/tests/sync.testscript +++ b/tests/sync.testscript @@ -4,7 +4,7 @@ .include common.testscript -cxx = cc config.cxx="'$recall($cxx.path)'" +cxx = cc config.cxx="\\'$recall($cxx.path)\\'" new += 2>! init += $cxx -d prj 2>! diff --git a/tests/test.testscript b/tests/test.testscript index 9d0191e..0437789 100644 --- a/tests/test.testscript +++ b/tests/test.testscript @@ -4,7 +4,7 @@ .include common.testscript -cxx = cc config.cxx="'$recall($cxx.path)'" +cxx = cc config.cxx="\\'$recall($cxx.path)\\'" new += 2>! init += cc "'config.cxx=$config.cxx'" -d prj 2>! diff --git a/tests/update.testscript b/tests/update.testscript index 2701b3b..59442d1 100644 --- a/tests/update.testscript +++ b/tests/update.testscript @@ -7,7 +7,7 @@ .include common.testscript -cxx = cc config.cxx="'$recall($cxx.path)'" +cxx = cc config.cxx="\\'$recall($cxx.path)\\'" new += 2>! init += $cxx -d prj 2>! -- cgit v1.1