Skip to content

Commit

Permalink
Fix test without embed declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
dalance committed May 13, 2024
1 parent af1d7d2 commit 564db9e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/emitter/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,7 @@ impl VerylWalker for Emitter {
test_name
);
self.token(&arg.hash.hash_token.replace(&text));
self.newline();
self.attribute.push(AttributeType::Test);
}
}
Expand Down
11 changes: 11 additions & 0 deletions testcases/sv/48_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module veryl_testcase_Module48;
endmodule

`ifdef __veryl_test_veryl_testcase_test1__

module test1;
initial begin
$display("hello");
Expand All @@ -16,6 +17,7 @@ endmodule
`endif

`ifdef __veryl_test_veryl_testcase_test2__

module test2;
// parse error
initial
Expand All @@ -24,10 +26,19 @@ endmodule
`endif

`ifdef __veryl_test_veryl_testcase_test3__

module test3;
// elaborate error
tri logic a;
always_comb a = 1;
endmodule

`endif

`ifdef __veryl_test_veryl_testcase_test4__
module veryl_testcase_test4;
initial begin
$display("test4");
end
endmodule
`endif
7 changes: 7 additions & 0 deletions testcases/veryl/48_test.veryl
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ module test3;
always_comb a = 1;
endmodule
}}}

#[test(test4)]
module test4 {
initial {
$display("test4");
}
}

0 comments on commit 564db9e

Please sign in to comment.