diff options
author | Matthew Kenigsberg <matthewkenigsberg@gmail.com> | 2020-10-23 08:20:38 -0500 |
---|---|---|
committer | Matthew Kenigsberg <matthewkenigsberg@gmail.com> | 2020-11-11 10:27:02 -0600 |
commit | d52b12c0a53f88b8ea9238d604f293b54c8ae51a (patch) | |
tree | f5de0e3210388a59e40898ba9bd8c631b1bae4f1 /tests | |
parent | 8abb80a478116b10bf37162c71f602262de412a9 (diff) |
Test nix build --json
Diffstat (limited to 'tests')
-rw-r--r-- | tests/build.sh | 12 | ||||
-rw-r--r-- | tests/local.mk | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/tests/build.sh b/tests/build.sh new file mode 100644 index 000000000..aa54b88eb --- /dev/null +++ b/tests/build.sh @@ -0,0 +1,12 @@ +source common.sh + +expectedJSONRegex='\[\{"drvPath":".*multiple-outputs-a.drv","outputs":\{"first":".*multiple-outputs-a-first","second":".*multiple-outputs-a-second"}},\{"drvPath":".*multiple-outputs-b.drv","outputs":\{"out":".*multiple-outputs-b"}}]' +nix build -f multiple-outputs.nix --json a.all b.all | jq --exit-status ' + (.[0] | + (.drvPath | match(".*multiple-outputs-a.drv")) and + (.outputs.first | match(".*multiple-outputs-a-first")) and + (.outputs.second | match(".*multiple-outputs-a-second"))) + and (.[1] | + (.drvPath | match(".*multiple-outputs-b.drv")) and + (.outputs.out | match(".*multiple-outputs-b"))) +' diff --git a/tests/local.mk b/tests/local.mk index a1929f96d..ce94ec80e 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -35,7 +35,8 @@ nix_tests = \ recursive.sh \ describe-stores.sh \ flakes.sh \ - content-addressed.sh + content-addressed.sh \ + build.sh # parallel.sh # build-remote-content-addressed-fixed.sh \ |