File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -1175,7 +1175,7 @@ fn main() {
11751175                test_type :  tester:: TestType :: UnitTest , 
11761176            } , 
11771177            testfn :  tester:: TestFn :: DynTestFn ( Box :: new ( move  || { 
1178-                 // Run WGSL test. 
1178+                 // Run WGSL side of the  test. 
11791179                let  runner = get_runner ( lib_clone. pipeline_type ) ; 
11801180                let  out_wgsl = runner
11811181                    . run ( 
@@ -1187,9 +1187,10 @@ fn main() {
11871187                        & lib_clone. path , 
11881188                    ) 
11891189                    . expect ( "WGSL run failed" ) ; 
1190-                 // Compile shaders  to Rust (formerly spirv) . 
1190+                 // Compile Rust  to SpirV . 
11911191                let  rust_shaders =
11921192                    compile_spirv_shaders ( & lib_clone) . expect ( "Failed to compile SPIR-V shaders" ) ; 
1193+                 // Run Rust side of the test. 
11931194                let  out_rust = runner
11941195                    . run ( 
11951196                        & device, 
@@ -1202,6 +1203,17 @@ fn main() {
12021203                    . expect ( "Rust run failed" ) ; 
12031204                let  data_wgsl = fs:: read ( & out_wgsl) . expect ( "Failed to read WGSL output file" ) ; 
12041205                let  data_rust = fs:: read ( & out_rust) . expect ( "Failed to read Rust output file" ) ; 
1206+ 
1207+                 // Fail if any output is empty. 
1208+                 if  data_wgsl. is_empty ( )  || data_rust. is_empty ( )  { 
1209+                     panic ! ( 
1210+                         "Empty output for {}: WGSL: {} bytes, Rust: {} bytes. Likely a bug in the test or harness." , 
1211+                         test_name, 
1212+                         data_wgsl. len( ) , 
1213+                         data_rust. len( ) 
1214+                     ) ; 
1215+                 } 
1216+ 
12051217                if  data_wgsl != data_rust { 
12061218                    panic ! ( 
12071219                        "Output mismatch for {}:\n WGSL output: {:?}\n Rust output: {:?}" , 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments