25 lines
		
	
	
		
			534 B
		
	
	
	
		
			V
		
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			534 B
		
	
	
	
		
			V
		
	
	
import os
 | 
						|
 | 
						|
fn test_all_samples_can_be_compiled() {
 | 
						|
	vexe := @VEXE
 | 
						|
	vroot := os.dir(vexe)
 | 
						|
	samples := os.walk_ext('$vroot/vlib/gg/testdata', '.vv')
 | 
						|
	mut fails := []string{}
 | 
						|
	for program_source in samples {
 | 
						|
		compile_cmd := '"$vexe" "$program_source"'
 | 
						|
		res := os.execute(compile_cmd)
 | 
						|
		if res.exit_code != 0 {
 | 
						|
			eprintln('>>> FAIL $compile_cmd')
 | 
						|
			fails << compile_cmd
 | 
						|
		}
 | 
						|
		println('OK $compile_cmd')
 | 
						|
	}
 | 
						|
	if fails.len > 0 {
 | 
						|
		eprintln('> Failed summary:')
 | 
						|
		for f in fails {
 | 
						|
			eprintln('   failed cmd: $f')
 | 
						|
		}
 | 
						|
		assert false
 | 
						|
	}
 | 
						|
}
 |