diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-11-09 11:45:02 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-11-09 11:45:02 +0200 |
commit | accbdae9b6e985d663d8af57375c7861ecd755a1 (patch) | |
tree | 6e6016a1a6ebdaccf2ef67b29c4236aa23914573 /old-tests | |
parent | 6158e136e105aae2f032a159ce807db68abee281 (diff) |
Add support for relative to base scope command line variable overrides
Currently, if we say:
$ b dir/ ./foo=bar
The scope the foo=bar is set on is relative to CWD, not dir/. While this
may seem wrong at first, this is the least surprising behavior when we
take into account that there can be multiple dir/'s.
Sometimes, however, we do want the override directory to be treated relative
to (every) target's base scope that we are building. To support this we are
extending the '.' and '..' special directory names (which are still resolved
relative to CWD) with '...', which means "relative to the base scope of every
target in the buildspec". For example:
$ b dir/ .../foo=bar
Is equivalent to:
$ b dir/ dir/foo=bar
And:
$ b liba/ libb/ .../tests/foo=bar
Is equivalent to:
$ b liba/ libb/ liba/tests/foo=bar libb/tests/foo=bar
Diffstat (limited to 'old-tests')
-rwxr-xr-x | old-tests/variable/override/test.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/old-tests/variable/override/test.sh b/old-tests/variable/override/test.sh index 76409d8..baef1ca 100755 --- a/old-tests/variable/override/test.sh +++ b/old-tests/variable/override/test.sh @@ -93,6 +93,16 @@ p/d : X p/d/t : X EOF +test .../v=X <<EOF +/ : +. : X +d : X +d/t : X +p : X +p/d : X +p/d/t : X +EOF + test ./p/v=X <<EOF / : . : @@ -103,6 +113,16 @@ p/d : X p/d/t : X EOF +test .../p/v=X <<EOF +/ : +. : +d : +d/t : +p : X +p/d : X +p/d/t : X +EOF + test v=X --buildfile loader ./p/ <<EOF / : . : X @@ -113,6 +133,16 @@ p/d : X p/d/t : X EOF +test .../v=X --buildfile loader ./p/ <<EOF +/ : +. : +d : +d/t : +p : X +p/d : X +p/d/t : X +EOF + test /v=X <<EOF / : . : X |