diff --git a/tests/builder.nix b/tests/builder.nix index 8ab89053d..30c8c83b9 100644 --- a/tests/builder.nix +++ b/tests/builder.nix @@ -51,7 +51,11 @@ let mkdir -p $out/bin cp ${pname}.elf $out/bin - cp ${pname}.cover $out + if [ -f ${pname}.cover ]; then + cp ${pname}.cover $out/ + else + echo "-assert *" > $out/${pname}.cover + fi ${jqBin} --null-input \ --arg name ${pname} \ diff --git a/tests/mlir/default.nix b/tests/mlir/default.nix index 0ce7161aa..f612b1fb7 100644 --- a/tests/mlir/default.nix +++ b/tests/mlir/default.nix @@ -55,11 +55,9 @@ let ${caseName}.c $pname.S ${t1main} \ -o $pname.elf - if [ ! -f ${sourcePath}/${caseName}.json ]; then - echo "Error: ${sourcePath}/${caseName}.json not found" >&2 - else + if [ -f "${sourcePath}/${caseName}.json" ]; then ${jq}/bin/jq -r '[.assert[] | "+assert " + .name] + [.tree[] | "+tree " + .name] + [.module[] | "+module " + .name] | .[]' \ - ${sourcePath}/${caseName}.json > $pname.cover + "${sourcePath}/${caseName}.json" > $pname.cover fi runHook postBuild