macaw/x86/tests
2017-12-01 15:09:07 -08:00
..
submodules added needed submodules 2017-11-09 15:00:23 -08:00
x64 Add x86 specific code. 2017-09-27 15:54:43 -07:00
ElfX64Linux.hs Fix failing x86 tests broken by last commit. 2017-12-01 15:09:07 -08:00
Main.hs Add x86 specific code. 2017-09-27 15:54:43 -07:00
README.rst Add x86 specific code. 2017-09-27 15:54:43 -07:00
stack.ghc-8.0.2.yaml added Cabal to stack.yaml dependencies 2017-11-09 16:13:05 -08:00
stack.yaml still fixing travis 2017-11-09 10:59:47 -08:00

This directory contains some automated tests for macaw-x86_.
The macaw tests currently live in this repository because this is
where our x86_64 semantics are defined.  Separating those semantics
out is difficult at this point.  The tests currently cover the code
discovery implementation in macaw.  Specifically, they check:

1) That the correct number of functions are found,
2) Each function starts at the expected address,
3) Each function contains the correct number of basic blocks,
4) Each basic block starts at the expected address

The ``Makefile`` in the tests directory rebuilds the test files from
source.  The resulting binaries are checked in to the repository so
that Mac OS users can run the tests without having to have a Linux
build toolchain available.  Additionally, having the binaries in the
repository keeps the code layout stable.  Expected addresses are
hard-coded into the expected results of the test suite; regenerating
the binaries on a different system or with a different compiler could
change the offsets in the test binaries, which would require the
expected results to be tweaked.  This is unfortunate, but difficult to
avoid in a robust way.

Note that the tests are bare-bones and do not link against libc.  They
issue the exit system call directly to terminate.  This lets us get
small and comprehensible test cases.

.. _macaw-86: https://gitlab-ext.galois.com/macaw/macaw-x86