Skip to content

Commit

Permalink
[tests] add cover demo
Browse files Browse the repository at this point in the history
Signed-off-by: Clo91eaf <[email protected]>
  • Loading branch information
Clo91eaf committed Jan 6, 2025
1 parent 575aef8 commit 53d4202
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/mlir/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, findAndBuild
, getTestRequiredFeatures
, t1main
, jq
}:

let
Expand Down Expand Up @@ -54,6 +55,13 @@ let
${caseName}.c $pname.S ${t1main} \
-o $pname.elf
if [ -f ${caseName}.json ]; then
${jq}/bin/jq -r '[.assert[] | "+assert " + .name] + [.tree[] | "+tree " + .name] + [.module[] | "+module " + .name] | .[]' \
${caseName}.json > $pname.cover
else
echo "-assert *" > $pname.cover
fi
runHook postBuild
'';

Expand Down
10 changes: 10 additions & 0 deletions tests/mlir/hello/hello.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"assert": [
{
"name": "vmv_v_i",
"description": "single instruction vmv.v.i"
}
],
"tree": [],
"module": []
}

0 comments on commit 53d4202

Please sign in to comment.