aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-03-27 10:39:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-03-27 10:40:58 +0200
commit2cc2772263d17a9b2755990d53e992a94d37e29d (patch)
tree1ad8e98e564485ae87ebae9a6e3546798eeda7b4 /tests
parentee128a8d4c3d5739b31fbb9e935b319176837cc8 (diff)
Implement project configuration reporting, similar to build system modules
Diffstat (limited to 'tests')
-rw-r--r--tests/directive/config.testscript64
1 files changed, 64 insertions, 0 deletions
diff --git a/tests/directive/config.testscript b/tests/directive/config.testscript
index d10f45d..f77a098 100644
--- a/tests/directive/config.testscript
+++ b/tests/directive/config.testscript
@@ -162,3 +162,67 @@ test.arguments =
error: invalid bool value 'junk' in variable config.test.fancy
EOE
}
+
+: report
+:
+{
+ .include ../common.testscript
+
+ +cat <<EOI >+build/bootstrap.build
+ using config
+ EOI
+
+ +cat <<EOI >=build/root.build
+ config [bool] config.test.a
+ config [bool] config.test.b ?= false
+ config [bool, config.report=false] config.test.c ?= true
+ config [strings, config.report=multiline] config.test.d ?= 1 2 3
+ config [string, config.report.variable=e] config.test.e ?= abc
+ config [ config.report] f
+ config [bool] config.test.n ?= [null]
+
+ e = "'$config.test.e'"
+ f = ($config.test.b || $config.test.c)
+
+ EOI
+
+ # This must be a single, serial test since we are sharing config.build.
+ #
+ : test
+ :
+ cat <<EOI >=buildfile;
+ ./:
+ EOI
+
+ # Unconfigured.
+ #
+ $* noop -v 2>>~/EOO/;
+ /config test@.+/
+ b false
+ d
+ 1
+ 2
+ 3
+ e 'abc'
+ f true
+ n [null]
+ EOO
+
+ # Configured.
+ #
+ $* configure config.test.a=true config.test.e=xyz config.test.n=true;
+ $* noop -v;
+ $* noop -V 2>>~/EOO/;
+ /config test@.+/
+ a true
+ b false
+ d
+ 1
+ 2
+ 3
+ e 'xyz'
+ f true
+ n true
+ EOO
+ $* disfigure
+}