File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -2665,20 +2665,22 @@ mod tests {
2665
2665
2666
2666
#[ test]
2667
2667
fn test_library_load ( ) {
2668
- // This test is not yet implemented for Windows
2669
- let check_path = match std:: env:: consts:: OS {
2670
- // "linux" => Some("test_resources/library/linux/test_op.so"),
2671
- // TODO: The test op needs to be recompiled for macos.
2672
- // "macos" => Some("test_resources/library/macos/test_op.so"),
2673
- _ => Some ( "test_resources/library/test_op.so" ) ,
2674
- } ;
2675
- if let Some ( path) = check_path {
2676
- let lib = Library :: load ( path) . unwrap ( ) ;
2677
- let ops: Vec < OpDef > = lib. op_list ( ) . clone ( ) . into ( ) ;
2678
- assert ! ( ops. len( ) == 1 ) ;
2679
- let op = & ops[ 0 ] ;
2680
- assert ! ( op. name( ) == "TestOpList" ) ;
2681
- } ;
2668
+ // This test is implemented for linux only
2669
+ if std:: env:: consts:: OS != "linux" {
2670
+ return ;
2671
+ }
2672
+ let lib_path = "test_resources/library/test_op.so" ;
2673
+ assert ! (
2674
+ std:: path:: Path :: new( lib_path) . exists( ) ,
2675
+ "`{}` was not found. Build the lib and try again : `{}`" ,
2676
+ lib_path,
2677
+ "(cd test_resources/library && ./build-test-op)"
2678
+ ) ;
2679
+ let lib = Library :: load ( lib_path) . unwrap ( ) ;
2680
+ let ops: Vec < OpDef > = lib. op_list ( ) . clone ( ) . into ( ) ;
2681
+ assert ! ( ops. len( ) == 1 ) ;
2682
+ let op = & ops[ 0 ] ;
2683
+ assert ! ( op. name( ) == "TestOpList" ) ;
2682
2684
}
2683
2685
2684
2686
#[ test]
You can’t perform that action at this time.
0 commit comments