run-tests.sh: extract checkFlakeSupport
Required by the following commit.
This commit is contained in:
parent
96df81a4d0
commit
77d8c00c53
@ -246,12 +246,25 @@ vmTestNixExpr() {
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
flake() {
|
checkFlakeSupport() {
|
||||||
if [[ $(nix flake 2>&1) != *"requires a sub-command"* ]]; then
|
testName=$1
|
||||||
echo "Skipping flake test. Nix flake support is not enabled."
|
if [[ ! -v hasFlakes ]]; then
|
||||||
|
if [[ $(nix flake 2>&1) == *"requires a sub-command"* ]]; then
|
||||||
|
hasFlakes=1
|
||||||
else
|
else
|
||||||
nix flake check "$scriptDir/.."
|
hasFlakes=
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
if [[ ! $hasFlakes ]]; then
|
||||||
|
echo "Skipping test '$testName'. Nix flake support is not enabled."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
flake() {
|
||||||
|
if ! checkFlakeSupport "flake"; then return; fi
|
||||||
|
|
||||||
|
nix flake check "$scriptDir/.."
|
||||||
}
|
}
|
||||||
|
|
||||||
# A basic subset of tests to keep the total runtime within
|
# A basic subset of tests to keep the total runtime within
|
||||||
|
Loading…
Reference in New Issue
Block a user