Skip to content

Commit 44fd609

Browse files
committed
raise_error: don't rely on module ordering in test
1 parent 0e11271 commit 44fd609

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/bugpoint/raise_error.ys

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,37 @@ logger -check-expected
2222

2323
# raise_error with int exits with status
2424
design -load read
25+
setattr -mod -unset raise_error def other
26+
dump
2527
bugpoint -suffix error -yosys ../../yosys -command raise_error -expect-return 7
2628
select -assert-mod-count 1 =*
2729
select -assert-mod-count 1 top
2830

2931
# raise_error -always still uses 'raise_error' attribute if possible
3032
design -load read
33+
setattr -mod -unset raise_error def other
3134
bugpoint -suffix error -yosys ../../yosys -command "raise_error -always" -expect-return 7
3235
select -assert-mod-count 1 =*
3336
select -assert-mod-count 1 top
3437

3538
# raise_error with string prints message and exits with 1
3639
design -load read
37-
rename top abc
40+
setattr -mod -unset raise_error top def
3841
bugpoint -suffix error -yosys ../../yosys -command raise_error -grep "help me" -expect-return 1
3942
select -assert-mod-count 1 =*
4043
select -assert-mod-count 1 other
4144

4245
# raise_error with no value exits with 1
4346
design -load read
44-
rename def zzy
47+
setattr -mod -unset raise_error top
4548
delete other
4649
bugpoint -suffix error -yosys ../../yosys -command raise_error -expect-return 1
4750
select -assert-mod-count 1 =*
48-
select -assert-mod-count 1 zzy
51+
select -assert-mod-count 1 def
4952

5053
# raise_error -stderr prints to stderr and exits with 1
5154
design -load read
52-
rename top abc
55+
setattr -mod -unset raise_error top def
5356
bugpoint -suffix error -yosys ../../yosys -command "raise_error -stderr" -err-grep "help me" -expect-return 1
5457
select -assert-mod-count 1 =*
5558
select -assert-mod-count 1 other

0 commit comments

Comments
 (0)