macaw/macaw-ppc/tests/Shared.hs
Daniel Wagner 1dae825c73 DRY
2019-07-17 15:08:57 -04:00

14 lines
309 B
Haskell

{-# LANGUAGE DataKinds #-}
module Shared (
withELF
) where
import qualified Data.ByteString as B
import qualified Data.ElfEdit as E
withELF :: FilePath -> (E.Elf 64 -> IO ()) -> IO ()
withELF fp k = do
bytes <- B.readFile fp
E.parseElfOrDie (error "ELF32 is unsupported in the test suite") k bytes