File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -283,4 +283,37 @@ def test_delete_rpath_fat
283283 delete_if_exists ( actual )
284284 end
285285 end
286+
287+ def test_merge_machos
288+ filenames = SINGLE_ARCHES . map { |a | fixture ( a , "hello.bin" ) }
289+ merged_filename = "merged_machos.bin"
290+
291+ # merge a bunch of single-arch Mach-Os and save them as a universal
292+ MachO ::Tools . merge_machos ( merged_filename , *filenames )
293+
294+ # ensure that we can load the merged machos
295+ file = MachO ::FatFile . new ( merged_filename )
296+
297+ assert file
298+ assert_instance_of MachO ::FatFile , file
299+ assert_equal filenames . size , file . machos . size
300+ ensure
301+ delete_if_exists ( merged_filename )
302+ end
303+
304+ def test_merge_machos_fat
305+ filenames = FAT_ARCH_PAIRS . map { |a | fixture ( a , "hello.bin" ) }
306+ merged_filename = "merged_universals.bin"
307+
308+ # merge a bunch of universal Mach-Os and save them as one universal
309+ MachO ::Tools . merge_machos ( merged_filename , *filenames )
310+
311+ # ensure that we can load the merged machos
312+ file = MachO ::FatFile . new ( merged_filename )
313+
314+ assert file
315+ assert_instance_of MachO ::FatFile , file
316+ ensure
317+ delete_if_exists ( merged_filename )
318+ end
286319end
You can’t perform that action at this time.
0 commit comments