File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 267267
268268# # Tests for LazyLibrary
269269@testset  " LazyLibrary" begin ; mktempdir () do  dir
270+     #  We require `codesign` to run these tests
271+     if  Sys. isapple () &&  Sys. which (" codesign" ===  nothing 
272+         @warn (" Unable to run `LazyLibrary` tests on macOS without `codesign` tool!" 
273+         return 
274+     end 
275+ 
270276    #  Create custom-named libccalltest libraries, to avoid failing these tests
271277    #  because some other test has already loaded `libccalltest` via `ccall()` or somesuch
272278    lct_name  =  " libcc4llt3st" 
283289    str_replace (lct_path, " libccalltest" =>  lct_name)
284290    str_replace (lctd_path, " libccalltest" =>  lct_name)
285291
292+     #  If we're on macOS, we need to codesign after modifying these libraries.
293+     if  Sys. isapple ()
294+         function  read_stderr (cmd)
295+             io =  IOBuffer ()
296+             run (pipeline (cmd; stderr = io))
297+             return  String (take! (io))
298+         end 
299+         out =  read_stderr (` codesign --sign - --option=runtime --timestamp --force $(lct_path) ` 
300+         @test  endswith (out, " replacing existing signature\n " 
301+         out =  read_stderr (` codesign --sign - --option=runtime --timestamp --force $(lctd_path) ` 
302+         @test  endswith (out, " replacing existing signature\n " 
303+     end 
304+ 
286305    default_rtld_flags =  Base. Libc. Libdl. default_rtld_flags
287306    #  Ensure that our modified copy of `libccalltest` is not currently loaded
288307    @test  ! any (contains .(dllist (), lct_path))
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments