@@ -1141,9 +1141,21 @@ def create_test_serialisation(self, tests: T.List['Test']) -> T.List[TestSeriali
1141
1141
cmd_args .extend (self .construct_target_rel_paths (a , t .workdir ))
1142
1142
else :
1143
1143
raise MesonException ('Bad object in test command.' )
1144
+
1145
+ t_env = t .env
1146
+ if not machine .is_windows () and not machine .is_cygwin () and not machine .is_darwin ():
1147
+ ld_lib_path : T .Set [str ] = set ()
1148
+ for d in depends :
1149
+ if isinstance (d , build .BuildTarget ):
1150
+ for l in d .get_all_link_deps ():
1151
+ if isinstance (l , build .SharedLibrary ):
1152
+ ld_lib_path .add (os .path .join (self .environment .get_build_dir (), l .get_subdir ()))
1153
+ if ld_lib_path :
1154
+ t_env .prepend ('LD_LIBRARY_PATH' , list (ld_lib_path ), ':' )
1155
+
1144
1156
ts = TestSerialisation (t .get_name (), t .project_name , t .suite , cmd , is_cross ,
1145
1157
exe_wrapper , self .environment .need_exe_wrapper (),
1146
- t .is_parallel , cmd_args , t . env ,
1158
+ t .is_parallel , cmd_args , t_env ,
1147
1159
t .should_fail , t .timeout , t .workdir ,
1148
1160
extra_paths , t .protocol , t .priority ,
1149
1161
isinstance (exe , build .Target ),
0 commit comments