File tree Expand file tree Collapse file tree
libdd-otel-thread-ctx-ffi/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,15 +18,27 @@ use std::process::Command;
1818const SYMBOL : & str = "otel_thread_ctx_v1" ;
1919
2020fn cdylib_path ( ) -> PathBuf {
21- PathBuf :: from ( env ! ( "CDYLIB_PROFILE_DIR" ) ) . join ( "liblibdd_otel_thread_ctx_ffi.so" )
21+ let path = PathBuf :: from ( env ! ( "CDYLIB_PROFILE_DIR" ) ) . join ( "liblibdd_otel_thread_ctx_ffi.so" ) ;
22+ assert ! (
23+ path. exists( ) ,
24+ "cdylib not found at {}: \
25+ ensure `cargo build -p libdd-otel-thread-ctx-ffi` has been run for this profile",
26+ path. display( )
27+ ) ;
28+ assert ! (
29+ std:: fs:: File :: open( & path) . is_ok( ) ,
30+ "cdylib exists at {} but could not be opened for reading" ,
31+ path. display( )
32+ ) ;
33+ path
2234}
2335
2436fn readelf ( args : & [ & str ] , path : & PathBuf ) -> String {
2537 let out = Command :: new ( "readelf" )
2638 . args ( args)
2739 . arg ( path)
2840 . output ( )
29- . expect ( "failed to run readelf — is binutils installed?" ) ;
41+ . expect ( "failed to run readelf. Is binutils installed?" ) ;
3042 String :: from_utf8_lossy ( & out. stdout ) . into_owned ( )
3143}
3244
You can’t perform that action at this time.
0 commit comments