tests: extract fn instantiateTestsFromStr
Fn `instantiateTests` now takes an array of strings. It is used in the following commit.
This commit is contained in:
+1
-1
@@ -193,7 +193,7 @@ buildTests() {
|
|||||||
# TODO-EXTERNAL:
|
# TODO-EXTERNAL:
|
||||||
# Simplify and switch to pure build when `nix build` can instantiate flake function outputs
|
# Simplify and switch to pure build when `nix build` can instantiate flake function outputs
|
||||||
# shellcheck disable=SC2207
|
# shellcheck disable=SC2207
|
||||||
drvs=($(nixInstantiate "pkgs.instantiateTests \"${tests[*]}\""))
|
drvs=($(nixInstantiate "pkgs.instantiateTestsFromStr \"${tests[*]}\""))
|
||||||
for i in "${!tests[@]}"; do
|
for i in "${!tests[@]}"; do
|
||||||
testName=${tests[$i]}
|
testName=${tests[$i]}
|
||||||
drv=${drvs[$i]}
|
drv=${drvs[$i]}
|
||||||
|
|||||||
+9
-10
@@ -459,16 +459,15 @@ in {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
instantiateTestsFromStr = testNamesStr: instantiateTests (lib.splitString " " testNamesStr);
|
||||||
|
|
||||||
instantiateTests = testNames:
|
instantiateTests = testNames:
|
||||||
let
|
map (name:
|
||||||
testNames' = lib.splitString " " testNames;
|
let
|
||||||
in
|
test = tests.${name};
|
||||||
map (name:
|
in
|
||||||
let
|
builtins.seq (builtins.trace "Evaluating test '${name}'" test.outPath)
|
||||||
test = tests.${name};
|
test
|
||||||
in
|
) testNames;
|
||||||
builtins.seq (builtins.trace "Evaluating test '${name}'" test.outPath)
|
|
||||||
test
|
|
||||||
) testNames';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user