x86emul/test: split generic and testcase specific parts
authorJan Beulich <jbeulich@suse.com>
Fri, 24 Feb 2017 16:22:13 +0000 (17:22 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 24 Feb 2017 16:22:13 +0000 (17:22 +0100)
commit1f24be6c945c8f8e25547aed4a56c092133df713
tree28ce33d46e504d137f08cbce0113859baa7e62f0
parent1d74282c455f58d924520dc55f82f47274e73c92
x86emul/test: split generic and testcase specific parts

Both the build logic and the invocation have their blowfish specific
aspects abstracted out here. Additionally
- run native execution (if suitable) first (as that one failing
  suggests a problem with the to be tested code itself, in which case
  having the emulator have a go over it is kind of pointless)
- move the 64-bit tests up in blobs[] so 64-bit native execution will
  also precede 32-bit emulation (on 64-bit systems only of course)
- instead of -msoft-float (we'd rather not have the compiler generate
  such code), pass -fno-asynchronous-unwind-tables and -g0 (reducing
  binary size of the helper images as well as [slightly] compilation
  time)
- skip tests with zero length blobs (these can result from failed
  compilation, but not failing the build in this case seems desirable:
  it may allow partial testing - e.g. with older compilers - and
  permits manually removing certain tests from the generated headers
  without having to touch actual source code)
- constrain rIP to the actual blob range rather than looking for the
  specific (fake) return address put on the stack
- also print the opcode when x86_emulate() fails
- print at least three progress dots (for relatively short tests)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/tests/x86_emulator/Makefile
tools/tests/x86_emulator/blowfish.mk [deleted file]
tools/tests/x86_emulator/test_x86_emulator.c
tools/tests/x86_emulator/testcase.mk [new file with mode: 0644]