Skip to content

Adding tests

Bill Williams edited this page Jan 10, 2017 · 1 revision

Adding tests to the test suite

Dyninst's tests are specified in prolog, in the spec-grouped.pl file. This file defines key relationships, such as:

  • a test must contain a mutator (tool) target
  • a test may contain one or more mutatee (application) targets
  • each target is generated from one or more source files
  • a test may only be valid on certain platforms or when certain capabilities are present
  • a test may only be valid in certain modes (create, attach, binary rewriting)
  • a test may require (or forbid) static or dynamic linking of the application

Based on this information, we generate the necessary CMake files for the test suite. Once you have added your test (or modified its specification) in the prolog source, these files are regenerated by make -f Makefile.genspec gen-all. If you have only modified the specification for a single platform, Makefile.genspec will also accept individual platforms as targets. If you have added a new platform, be sure to add that platform as an individual target and part of the gen-all target to Makefile.genspec, as well as committing the generated CMake files.

As prolog is not universally available on non-x86 platforms, we prefer that developers always keep the generated CMake files up to date when they update the specification.

Clone this wiki locally