3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-05 19:00:26 +00:00
yosys/tests/bugpoint/err.ys
Krystine Sherwin 8d5dbae06e
raise_error.cc: Option for direct to stderr
Add more to help text to describe usage.
Add test for no value (should `exit(1)`).
2025-07-29 11:39:50 +12:00

52 lines
1.2 KiB
Text

read_verilog -noblackbox << EOF
(* raise_error=7 *)
module top();
endmodule
(* raise_error="help me" *)
module other();
endmodule
(* raise_error *)
module def();
endmodule
EOF
select -assert-mod-count 3 =*
design -stash read
# raise_error with int exits with status
design -load read
bugpoint -yosys ../../yosys -command raise_error -expect-return 7
select -assert-mod-count 1 =*
select -assert-mod-count 1 top
# raise_error with string prints message
design -load read
rename top abc
bugpoint -yosys ../../yosys -command raise_error -grep "help me"
select -assert-mod-count 1 =*
select -assert-mod-count 1 other
# raise_error with no value exits with 1
design -load read
rename def zzy
bugpoint -yosys ../../yosys -command raise_error -expect-return 1
select -assert-mod-count 1 =*
select -assert-mod-count 1 zzy
# raise_error -stderr exits with 1
design -load read
rename top abc
delete def
bugpoint -yosys ../../yosys -command "raise_error -stderr" -expect-return 1
select -assert-mod-count 1 =*
select -assert-mod-count 1 other
#TODO
# raise_error -stderr prints to stderr
design -load read
rename top abc
delete def
# bugpoint -yosys ../../yosys -command "raise_error -stderr" -grep "help me"
# select -assert-mod-count 1 =*
# select -assert-mod-count 1 other