From 9238232ea5f1372f50dfba0eadc04df133f03ae3 Mon Sep 17 00:00:00 2001 From: Clo91eaf Date: Mon, 16 Dec 2024 19:16:24 +0800 Subject: [PATCH] [tests] all coverage is closed by default in ci report Signed-off-by: Clo91eaf --- tests/builder.nix | 6 +++++- tests/mlir/default.nix | 6 ++---- 2 files changed, 7 insertions(+), 5 deletions(-) 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