mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	raise_error.cc: Option for direct to stderr
Add more to help text to describe usage. Add test for no value (should `exit(1)`).
This commit is contained in:
		
							parent
							
								
									134da811f7
								
							
						
					
					
						commit
						8d5dbae06e
					
				
					 2 changed files with 57 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -7,7 +7,8 @@ endmodule
 | 
			
		|||
module other();
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
module zzy();
 | 
			
		||||
(* raise_error *)
 | 
			
		||||
module def();
 | 
			
		||||
endmodule
 | 
			
		||||
EOF
 | 
			
		||||
select -assert-mod-count 3 =*
 | 
			
		||||
| 
						 | 
				
			
			@ -25,3 +26,27 @@ 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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue