mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-04 12:07:12 +00:00 
			
		
		
		
	lib: add igt.cocci
Small start but useful to collect refactorings/simplifications for common igt patterns. Please add more if you stumble over some so that we can occasionally run this to clean up the tests. I haven't figured out yet how to do the assert_cmpint->assert_eq transformation. Run this with spatch --sp-file lib/igt.cocci --in-place tests/*.c Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
		
							parent
							
								
									3448b5ad4b
								
							
						
					
					
						commit
						66b31b6e19
					
				
							
								
								
									
										17
									
								
								lib/igt.cocci
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								lib/igt.cocci
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,17 @@
 | 
			
		||||
@@
 | 
			
		||||
expression Ec;
 | 
			
		||||
expression list[n] Ep;
 | 
			
		||||
@@
 | 
			
		||||
- if (Ec) {
 | 
			
		||||
- fprintf( stderr,  Ep );
 | 
			
		||||
- igt_fail(...);
 | 
			
		||||
- }
 | 
			
		||||
+ igt_assert_f(Ec, Ep);
 | 
			
		||||
@@
 | 
			
		||||
expression Ec;
 | 
			
		||||
expression list[n] Ep;
 | 
			
		||||
@@
 | 
			
		||||
- if (Ec) {
 | 
			
		||||
- igt_skip(Ep);
 | 
			
		||||
- }
 | 
			
		||||
+ igt_skip_on_f(Ec, Ep);
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user