aboutsummaryrefslogtreecommitdiff
path: root/tests/config.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-03-03 20:15:06 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-03-04 19:18:25 +0300
commitd08619f0952d4ec472d0ce6dcd90cfac7f62dce6 (patch)
tree0f45772951ca26374dff2ee6d251c3149e9207b7 /tests/config.testscript
parentedfeacac8a8f08f3b022cc561cc992d5a12fcf51 (diff)
Add support for --stdout-format to bdep-config-list command
Diffstat (limited to 'tests/config.testscript')
-rw-r--r--tests/config.testscript48
1 files changed, 47 insertions, 1 deletions
diff --git a/tests/config.testscript b/tests/config.testscript
index f4ce520..c08c3bf 100644
--- a/tests/config.testscript
+++ b/tests/config.testscript
@@ -39,6 +39,27 @@ deinit += -d prj
@cfg $~/cfg-dir/ 1 target default,forwarded,auto-synchronized
EOO
+ # While at it, test printing the configurations list in the JSON format.
+ #
+ $* list @cfg --stdout-format 'json' >>/~"%EOO%";
+ [
+ {
+ "id": 1,
+ "path": "$~/cfg-dir",
+ "name": "cfg",
+ "type": "target",
+ "default": true,
+ "forward": true,
+ "auto-sync": true,
+ "packages": [
+ {
+ "name": "prj"
+ }
+ ]
+ }
+ ]
+ EOO
+
$update @cfg 2>>~%EOE%;
%(mkdir|c\+\+|ld) .+%{3}
EOE
@@ -254,9 +275,34 @@ deinit += -d prj
$* add @host-cfg 2>!;
- $* add @cfg 2>>/"EOE"
+ $* add @cfg 2>>/"EOE";
added configuration @cfg $~/prj-cfg/ 5 target default,forwarded,auto-synchronized
EOE
+
+ # While at it, test printing the configurations list in the JSON format.
+ #
+ $* list --stdout-format 'json' >>/~"%EOO%"
+ [
+ {
+ "id": 5,
+ "path": "$~/prj-cfg",
+ "name": "cfg",
+ "type": "target",
+ "default": true,
+ "forward": true,
+ "auto-sync": true
+ },
+ {
+ "id": 4,
+ "path": "$~/prj-host-cfg",
+ "name": "host-cfg",
+ "type": "host",
+ "default": true,
+ "forward": true,
+ "auto-sync": true
+ }
+ ]
+ EOO
}
: move