Skip to content

Commit

Permalink
Add Metal tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Feb 17, 2023
1 parent 87481f6 commit 52a160c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Binary file added test/macmetal/dummy
Binary file not shown.
14 changes: 14 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,27 @@ function test_fat_libfoo(file)
@test n64 == 1
end

function test_metal(file)
oh = readmeta(open(file, "r"))
@test isa(oh, FatMachOHandle)
@test length(oh) == 2

arch = oh[1]
@test arch.header isa MachO.MachOHeader64
@test findfirst(Sections(arch), "__TEXT,__compute") !== nothing

arch = oh[2]
@test arch.header isa MachO.MetallibHeader
end

# Run ELF tests
test_libfoo_and_fooifier("./linux32/fooifier", "./linux32/libfoo.so")
test_libfoo_and_fooifier("./linux64/fooifier", "./linux64/libfoo.so")

# Run MachO tests
test_libfoo_and_fooifier("./mac64/fooifier", "./mac64/libfoo.dylib")
test_fat_libfoo("./mac64/libfoo_fat.dylib")
test_metal("./macmetal/dummy")

# Run COFF tests
test_libfoo_and_fooifier("./win32/fooifier.exe", "./win32/libfoo.dll")
Expand Down

0 comments on commit 52a160c

Please sign in to comment.