From f35389f4690e297c8f3cc0229f213aaaecc882b1 Mon Sep 17 00:00:00 2001 From: Yegor Timoshenko Date: Sun, 24 Dec 2017 13:57:47 +0000 Subject: [PATCH] tests/eval-test: exit on failed evaluation, skip some paths --- tests/eval-test.sh | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/tests/eval-test.sh b/tests/eval-test.sh index d3eb3a1..72d6341 100755 --- a/tests/eval-test.sh +++ b/tests/eval-test.sh @@ -1,8 +1,27 @@ #!/bin/sh -cd $(dirname $0) +cd $(dirname $0)/.. -for profile in $(find .. -name \*.nix); do - echo $profile >&2 - nixos-rebuild -I nixos-config=eval-test.nix -I nixos-hardware-profile=$profile dry-build +skip_paths=( + ./inversepath/usbarmory/* + ./tests/* +) + +find=(find . -name *.nix) + +for path in ${skip_paths[@]}; do + find+=(-not -path $path) +done + +for profile in `${find[@]}`; do + echo evaluating $profile >&2 + + nixos-rebuild \ + -I nixos-config=tests/eval-test.nix \ + -I nixos-hardware-profile=$profile \ + dry-build + + if [ $? -ne 0 ]; then + exit 1 + fi done