From 1e577f5ff22e95786daedca5c326029baa59a39d Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 18 Oct 2019 18:44:56 +0300 Subject: Use $quote() for quoting config.cxx option value in testscripts --- tests/ci.testscript | 4 +-- tests/config.testscript | 24 +++++++-------- tests/fetch.testscript | 4 +-- tests/init.testscript | 12 ++++---- tests/new.testscript | 76 ++++++++++++++++++++++++------------------------ tests/publish.testscript | 4 +-- tests/status.testscript | 4 +-- tests/sync.testscript | 6 ++-- tests/test.testscript | 6 ++-- tests/update.testscript | 6 ++-- 10 files changed, 73 insertions(+), 73 deletions(-) diff --git a/tests/ci.testscript b/tests/ci.testscript index 6fa73eb..0afe1ec 100644 --- a/tests/ci.testscript +++ b/tests/ci.testscript @@ -52,10 +52,10 @@ repository='http://example.com/prj.git' test.arguments += --yes --repository "$repository" --server "$server" \ --simulate 'success' -cxx = cc config.cxx="\\'$recall($cxx.path)\\'" +config_cxx = cc config.cxx=$quote($recall($cxx.path) $cxx.mode, true) new += 2>! -init += $cxx -d prj 2>! &prj/**/bootstrap/*** +init += $config_cxx -d prj 2>! &prj/**/bootstrap/*** windows = ($cxx.target.class == 'windows') diff --git a/tests/config.testscript b/tests/config.testscript index dedb552..71e860c 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)\\'" +config_cxx = cc config.cxx=$quote($recall($cxx.path) $cxx.mode, true) status += -d prj init += -d prj @@ -22,7 +22,7 @@ deinit += -d prj { $clone_root_prj; - $* create @cfg cfg-dir $cxx 2>>/"EOE" &cfg-dir/***; + $* create @cfg cfg-dir $config_cxx 2>>/"EOE" &cfg-dir/***; created configuration @cfg $~/cfg-dir/ 1 default,forwarded,auto-synchronized EOE @@ -56,7 +56,7 @@ deinit += -d prj { $clone_root_prj; - $* create -- @cfg $cxx 2>>/"EOE" &prj-cfg/***; + $* create -- @cfg $config_cxx 2>>/"EOE" &prj-cfg/***; created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized EOE @@ -88,7 +88,7 @@ deinit += -d prj { $clone_root_prj; - $* create cfg $cxx 2>>/"EOE" &cfg/***; + $* create cfg $config_cxx 2>>/"EOE" &cfg/***; created configuration $~/cfg/ 1 default,forwarded,auto-synchronized EOE @@ -123,12 +123,12 @@ deinit += -d prj mkdir --no-cleanup cfg; touch --no-cleanup cfg/a; - $* create cfg $cxx 2>>/"EOE" != 0; + $* create cfg $config_cxx 2>>/"EOE" != 0; error: directory $~/cfg/ is not empty info: use --wipe to clean it up but be careful EOE - $* create --wipe cfg $cxx 2>>/"EOE" &cfg/*** + $* create --wipe cfg $config_cxx 2>>/"EOE" &cfg/*** created configuration $~/cfg/ 1 default,forwarded,auto-synchronized EOE } @@ -141,8 +141,8 @@ deinit += -d prj # Pre-create configurations. # - $new -C prj-cfg1 tmp1 $cxx 2>! &prj-cfg1/*** &tmp1/***; - $new -C prj-cfg2 tmp2 $cxx 2>! &prj-cfg2/*** &tmp2/***; + $new -C prj-cfg1 tmp1 $config_cxx 2>! &prj-cfg1/*** &tmp1/***; + $new -C prj-cfg2 tmp2 $config_cxx 2>! &prj-cfg2/*** &tmp2/***; $* add @cfg1 prj-cfg1 2>>/"EOE"; added configuration @cfg1 $~/prj-cfg1/ 1 default,forwarded,auto-synchronized @@ -201,7 +201,7 @@ deinit += -d prj { $clone_root_prj; - $* create -- @cfg $cxx &prj-cfg/*** 2>>/"EOE"; + $* create -- @cfg $config_cxx &prj-cfg/*** 2>>/"EOE"; created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized EOE @@ -233,7 +233,7 @@ deinit += -d prj { $clone_root_prj; - $* create -- @cfg $cxx 2>>/"EOE" &prj-cfg/***; + $* create -- @cfg $config_cxx 2>>/"EOE" &prj-cfg/***; created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized EOE @@ -265,8 +265,8 @@ deinit += -d prj { $clone_root_prj; - $* create -- @cfg1 $cxx 2>! &prj-cfg1/***; - $* create -- @cfg2 $cxx 2>! &prj-cfg2/***; + $* create -- @cfg1 $config_cxx 2>! &prj-cfg1/***; + $* create -- @cfg2 $config_cxx 2>! &prj-cfg2/***; $init --all 2>!; diff --git a/tests/fetch.testscript b/tests/fetch.testscript index 0aa7f1d..b10d3c4 100644 --- a/tests/fetch.testscript +++ b/tests/fetch.testscript @@ -4,10 +4,10 @@ .include common.testscript project.testscript -cxx = cc config.cxx="\\'$recall($cxx.path)\\'" +config_cxx = cc config.cxx=$quote($recall($cxx.path) $cxx.mode, true) new += 2>! -init += $cxx -d prj 2>! +init += $config_cxx -d prj 2>! status += --all -d prj deinit += -d prj diff --git a/tests/init.testscript b/tests/init.testscript index 3fb23a8..61876c2 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)\\'" +config_cxx = cc config.cxx=$quote($recall($cxx.path) $cxx.mode, true) status += -d prj deinit += -d prj @@ -26,7 +26,7 @@ deinit += -d prj { $clone_prj; - $* -C @cfg $cxx 'config.cc.poptions=-DTEST' -- '?sys:libprj/*' 2>>/~"%EOE%" &prj-cfg/***; + $* -C @cfg $config_cxx 'config.cc.poptions=-DTEST' -- '?sys:libprj/*' 2>>/~"%EOE%" &prj-cfg/***; initializing in project $~/prj/ created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized synchronizing: @@ -66,7 +66,7 @@ deinit += -d prj { $clone_prj; - $* -C @cfg -- $cxx 'config.cc.poptions=-DTEST' -- '?sys:libprj/*' 2>>/~"%EOE%" &prj-cfg/***; + $* -C @cfg -- $config_cxx 'config.cc.poptions=-DTEST' -- '?sys:libprj/*' 2>>/~"%EOE%" &prj-cfg/***; initializing in project $~/prj/ created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized synchronizing: @@ -118,8 +118,8 @@ deinit += -d prj # Pre-create configurations. # - $new -C prj-cfg1 tmp $cxx 2>! &prj-cfg1/*** &tmp/***; - $init -C prj-cfg2 -d tmp $cxx 2>! &prj-cfg2/***; + $new -C prj-cfg1 tmp $config_cxx 2>! &prj-cfg1/*** &tmp/***; + $init -C prj-cfg2 -d tmp $config_cxx 2>! &prj-cfg2/***; $* -A @cfg1 '?sys:libprj/*' 2>>/~"%EOE%"; initializing in project $~/prj/ @@ -179,7 +179,7 @@ deinit += -d prj # cp --no-cleanup -pr ../prj ./ &prj/***; - $* -C @cfg $cxx 2>>/~"%EOE%" &prj-cfg/***; + $* -C @cfg $config_cxx 2>>/~"%EOE%" &prj-cfg/***; initializing in project $~/prj/ created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized synchronizing: diff --git a/tests/new.testscript b/tests/new.testscript index f5b105c..8d28597 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)\\'" +config_c = config.c=$quote($recall($c.path) $c.mode, true) +config_cxx = config.cxx=$quote($recall($cxx.path) $cxx.mode, true) status += -d prj @@ -33,7 +33,7 @@ status += -d prj created new executable project prj-foo in $~/prj-foo/ EOE - $build prj-foo/ $cxx 2>>~%EOE% + $build prj-foo/ $config_cxx 2>>~%EOE% %(c\+\+|ld) .+%{2} EOE } @@ -45,7 +45,7 @@ status += -d prj created new library project libprj-foo in $~/libprj-foo/ EOE - $build libprj-foo/ $cxx 2>>~%EOE% + $build libprj-foo/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -57,7 +57,7 @@ status += -d prj created new executable project foo in $~/foo/ EOE - $build foo/ $cxx 2>>~%EOE% + $build foo/ $config_cxx 2>>~%EOE% %(c\+\+|ld|ar) .+%{5} EOE } @@ -69,7 +69,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $cxx 2>>~%EOE% + $build libfoo/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{11} EOE } @@ -81,7 +81,7 @@ status += -d prj created new executable project foo in $~/foo/ EOE - $build foo/ $cxx 2>>~%EOE% + $build foo/ $config_cxx 2>>~%EOE% %(c\+\+|ld|ar) .+%{5} EOE } @@ -93,7 +93,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $cxx 2>>~%EOE% + $build libfoo/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{11} EOE } @@ -122,7 +122,7 @@ status += -d prj %.* EOE - $build foo/ $cxx 2>>~%EOE% + $build foo/ $config_cxx 2>>~%EOE% %(c\+\+|ld) .+%{2} EOE } @@ -136,7 +136,7 @@ status += -d prj test -f foo/README.md == 1; - $build foo/ $cxx 2>>~%EOE% + $build foo/ $config_cxx 2>>~%EOE% %(c\+\+|ld) .+%{2} EOE } @@ -149,7 +149,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $cxx 2>>~%EOE% + $build libfoo/ $config_cxx 2>>~%EOE% %(c\+\+|ar|ld) .+%{10} EOE } @@ -161,7 +161,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $cxx 2>>~%EOE% + $build libfoo/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ld) .+%{3} EOE } @@ -173,7 +173,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $cxx 2>>~%EOE% + $build libfoo/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ld) .+%{5} EOE } @@ -187,7 +187,7 @@ status += -d prj created new executable project prj-foo in $~/prj-foo/ EOE - $build prj-foo/ $c 2>>~%EOE% + $build prj-foo/ $config_c 2>>~%EOE% %(c|ld) .+%{2} EOE } @@ -199,7 +199,7 @@ status += -d prj created new executable project foo in $~/foo/ EOE - $build foo/ $c 2>>~%EOE% + $build foo/ $config_c 2>>~%EOE% %(c|ld|ar) .+%{5} EOE } @@ -212,7 +212,7 @@ status += -d prj created new library project libprj-foo in $~/libprj-foo/ EOE - $build libprj-foo/ $c 2>>~%EOE% + $build libprj-foo/ $config_c 2>>~%EOE% %(version\.in|c|ar|ld) .+%{7} EOE } @@ -225,7 +225,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $c 2>>~%EOE% + $build libfoo/ $config_c 2>>~%EOE% %(version\.in|c|ar|ld) .+%{11} EOE } @@ -282,7 +282,7 @@ status += -d prj created new library package libprj in $~/prj/libprj/ EOE - $build prj/libprj/ $cxx 2>>~%EOE% + $build prj/libprj/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -336,7 +336,7 @@ status += -d prj # test -f prj/libprj/README.md == 1; - $build prj/ $cxx 2>>~%EOE% + $build prj/ $config_cxx 2>>~%EOE% %(c\+\+|ar|ld) .+%{6} EOE } @@ -358,7 +358,7 @@ status += -d prj created new executable source subdirectory prj in $~/prj/prj/ EOE - $build prj/ $cxx 2>>~%EOE% + $build prj/ $config_cxx 2>>~%EOE% %(c\+\+|ar|ld) .+%{6} EOE } @@ -376,7 +376,7 @@ status += -d prj created new library source subdirectory prj in $~/prj/core/prj/ EOE - $build prj/ $cxx 2>>~%EOE% + $build prj/ $config_cxx 2>>~%EOE% %(c\+\+|ar|ld) .+%{8} EOE } @@ -395,7 +395,7 @@ status += -d prj test -f libprj/libprj/prj.cxx; test -f libprj/libprj/prj.hxx; - $build libprj/ $cxx 2>>~%EOE% + $build libprj/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -410,7 +410,7 @@ status += -d prj test -f libprj/libprj/prj.cpp; test -f libprj/libprj/prj.hpp; - $build libprj/ $cxx 2>>~%EOE% + $build libprj/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -425,7 +425,7 @@ status += -d prj test -f libprj/libprj/prj.c++; test -f libprj/libprj/prj.h++; - $build libprj/ $cxx 2>>~%EOE% + $build libprj/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -440,7 +440,7 @@ status += -d prj test -f libprj/libprj/prj.cc; test -f libprj/libprj/prj.hh; - $build libprj/ $cxx 2>>~%EOE% + $build libprj/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -455,7 +455,7 @@ status += -d prj test -f libprj/libprj/prj.c; test -f libprj/libprj/prj.h; - $build libprj/ $cxx 2>>~%EOE% + $build libprj/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -470,7 +470,7 @@ status += -d prj test -f libprj/libprj/prj.cxx; test -f libprj/libprj/prj; - $build libprj/ $cxx 2>>~%EOE% + $build libprj/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -496,7 +496,7 @@ status += -d prj %.+ EOO - $build libprj/ $cxx 2>>~%EOE% + $build libprj/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -511,7 +511,7 @@ status += -d prj test -f libprj/libprj/prj.cpp; test -f libprj/libprj/prj.hxx; - $build libprj/ $cxx 2>>~%EOE% + $build libprj/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -525,7 +525,7 @@ status += -d prj test -f libprj/libprj/prj.cpp; test -f libprj/libprj/prj.hpp; - $build libprj/ $cxx 2>>~%EOE% + $build libprj/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -605,7 +605,7 @@ status += -d prj %.+ EOO - $build prj/ $cxx 2>>~%EOE% + $build prj/ $config_cxx 2>>~%EOE% %(c|ar|ld) .+%{5} EOE } @@ -620,7 +620,7 @@ status += -d prj test -f libprj/buildfile; test -f libprj/libprj/version.h.in == 1; - $build libprj/ $cxx 2>>~%EOE% + $build libprj/ $config_cxx 2>>~%EOE% %(c|ar|ld) .+%{6} EOE } @@ -635,7 +635,7 @@ status += -d prj test -f libprj/build2file; test -d libprj/libprj == 1; - $build libprj/ $cxx 2>>~%EOE% + $build libprj/ $config_cxx 2>>~%EOE% %info: .+ is up to date% EOE } @@ -664,7 +664,7 @@ status += -d prj test -f libprj/libprj/prj; test -f libprj/libprj/prj.cpp; - $build libprj/ $cxx 2>>~%EOE% + $build libprj/ $config_cxx 2>>~%EOE% %(c\+\+|ar|ld) .+%{6} EOE } @@ -680,7 +680,7 @@ status += -d prj test -f libprj/libprj/prj.h; test -f libprj/libprj/prj.c; - $build libprj/ $cxx 2>>~%EOE% + $build libprj/ $config_cxx 2>>~%EOE% %(c|ar|ld) .+%{6} EOE } @@ -738,7 +738,7 @@ status += -d prj CMakeCache.txt EOO - $build prj/libprj/ $cxx 2>>~%EOE% + $build prj/libprj/ $config_cxx 2>>~%EOE% %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -892,7 +892,7 @@ status += -d prj : dir-and-name : { - $* -C prj-config @cfg prj cc $cxx 2>>/~"%EOE%" &prj/*** &prj-config/***; + $* -C prj-config @cfg prj cc $config_cxx 2>>/~"%EOE%" &prj/*** &prj-config/***; created new executable project prj in $~/prj/ created configuration @cfg $~/prj-config/ 1 default,forwarded,auto-synchronized synchronizing: @@ -914,7 +914,7 @@ status += -d prj : character is special). : { - $* -C -@cfg prj cc $cxx 2>>/~"%EOE%" &prj/*** &prj-cfg/***; + $* -C -@cfg prj cc $config_cxx 2>>/~"%EOE%" &prj/*** &prj-cfg/***; created new executable project prj in $~/prj/ created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized synchronizing: diff --git a/tests/publish.testscript b/tests/publish.testscript index b34e8e2..0d35520 100644 --- a/tests/publish.testscript +++ b/tests/publish.testscript @@ -30,10 +30,10 @@ end test.arguments += --repository "$repository" --yes \ --author-name user --author-email user@example.com -cxx = cc config.cxx="\\'$recall($cxx.path)\\'" +config_cxx = cc config.cxx=$quote($recall($cxx.path) $cxx.mode, true) new += 2>! -init += $cxx -d prj 2>! &prj/**/bootstrap/*** +init += $config_cxx -d prj 2>! &prj/**/bootstrap/*** windows = ($cxx.target.class == 'windows') diff --git a/tests/status.testscript b/tests/status.testscript index d1b430e..f128b21 100644 --- a/tests/status.testscript +++ b/tests/status.testscript @@ -4,10 +4,10 @@ .include common.testscript project.testscript -cxx = cc config.cxx="\\'$recall($cxx.path)\\'" +config_cxx = cc config.cxx=$quote($recall($cxx.path) $cxx.mode, true) new += 2>! -init += $cxx -d prj 2>! +init += $config_cxx -d prj 2>! sync += -d prj 2>! deinit += -d prj diff --git a/tests/sync.testscript b/tests/sync.testscript index 666fa86..f875fa1 100644 --- a/tests/sync.testscript +++ b/tests/sync.testscript @@ -4,17 +4,17 @@ .include common.testscript -cxx = cc config.cxx="\\'$recall($cxx.path)\\'" +config_cxx = cc config.cxx=$quote($recall($cxx.path) $cxx.mode, true) new += 2>! -init += $cxx -d prj 2>! +init += $config_cxx -d prj 2>! status += --all --recursive -d prj deinit += -d prj : single-pkg-cfg : { - $new -C @cfg prj $cxx &prj/*** &prj-cfg/***; + $new -C @cfg prj $config_cxx &prj/*** &prj-cfg/***; $new -t lib libprj &libprj/***; diff --git a/tests/test.testscript b/tests/test.testscript index 0437789..4e27d7e 100644 --- a/tests/test.testscript +++ b/tests/test.testscript @@ -4,16 +4,16 @@ .include common.testscript -cxx = cc config.cxx="\\'$recall($cxx.path)\\'" +config_cxx = cc config.cxx=$quote($recall($cxx.path) $cxx.mode, true) new += 2>! -init += cc "'config.cxx=$config.cxx'" -d prj 2>! +init += $config_cxx -d prj 2>! deinit += -d prj : single-pkg-cfg : { - $new -C @cfg prj $cxx &prj/*** &prj-cfg/***; + $new -C @cfg prj $config_cxx &prj/*** &prj-cfg/***; $* -d prj 2>>~%EOE%; %(mkdir|c\+\+|ld|test) .+%{4} diff --git a/tests/update.testscript b/tests/update.testscript index 59442d1..107d367 100644 --- a/tests/update.testscript +++ b/tests/update.testscript @@ -7,16 +7,16 @@ .include common.testscript -cxx = cc config.cxx="\\'$recall($cxx.path)\\'" +config_cxx = cc config.cxx=$quote($recall($cxx.path) $cxx.mode, true) new += 2>! -init += $cxx -d prj 2>! +init += $config_cxx -d prj 2>! deinit += -d prj : single-pkg-cfg : { - $new -C @cfg prj $cxx &prj/*** &prj-cfg/***; + $new -C @cfg prj $config_cxx &prj/*** &prj-cfg/***; $* -d prj 2>>~%EOE%; %(mkdir|c\+\+|ld) .+%{3} -- cgit v1.1