#! /usr/bin/env bash verbose=n function error () { echo "$*" 1>&2; exit 1; } function fail () { if [ "$verbose" = "y" ]; then b $* else b -q $* 2>/dev/null fi if [ $? -eq 0 ]; then error "succeeded: b $*" fi return 0 } function test () { # There is no way to get the exit code in process substitution # so ruin the output. # diff -u - <(b -q $* || echo "") if [ $? -ne 0 ]; then error "failed: b $*" fi } fail foo=bar[] # error: unexpected [ in variable assignment 'foo=bar[]' fail foo=[string]bar # error: typed override of variable foo fail "!foo=bar" "!foo=BAR" # error: multiple global overrides of variable foo fail "foo=bar" "foo=BAR" # error: multiple project overrides of variable foo fail "%foo=bar" "%foo=BAR" # error: multiple project overrides of variable foo test --buildfile simple foo=bar ./ ./ <<< "bar" # Multiple bootstraps of the same project. # Visibility/qualification. # test !v=X <