Skip to content

About

Tests for Dyninst that don't fit in the framework of the test suite

Resources

Stars

0 stars

Watchers

10 watching

Forks

Repository files navigation

External Tests for Dyninst

These are tests for Dyninst which do not fit within the framework of the test suite.

Building

Before building any of these examples, you need an existing build of Dyninst (see the Dyninst wiki for details).

To configure the build, you can use

cmake . -DDyninst_DIR=path/to/Dyninst/install/lib/cmake/Dyninst
cmake --build .

Running

Most of the tests are designed to examine some aspect of compiling or linking Dyninst. There are, however, a few tests that have a runtime aspect. These tests can be run using CTest like so:

ctest .

A test that cannot run in this configuration, or on this host, is still listed, and ctest reports it as Skipped. ctest -V shows the reason.

Adding a test

Every test is added with dyninst_add_test, from cmake/common/ctest/DyninstAddTest.cmake. It always creates the test: if the test cannot be built or run in this configuration, ctest reports it as skipped and says why. Tests are written in C++.

dyninst_add_test(e_parser
  SOURCE_FILES parser.cpp
  DEPS Dyninst::symtabAPI
)

cmake/common is a copy of Dyninst's, kept unchanged so that a test is written the same way in both repositories; a change to it is made in Dyninst and copied here, and the Shared CMake files workflow checks that it still matches Dyninst's. cmake/common/README.md describes the functions in full: their keywords, defining a requirement, skipping, and where a test's output goes. There are no test types here, so tests have no TYPE.

Requirements

The requirements are defined in cmake/DyninstTestRequirements.cmake, each with the reason a test prints when it is not met:

Requirement Met when
static_exe DYNINST_ENABLE_STATIC_TESTS
static_rewrite the host is not aarch64

Formatting the CMake files

The CMake files are formatted with gersemi, at the version in cmake/dependencies.versions and with the settings in .gersemirc. After configuring, cmake --build . --target cmake-check lists the files that are not formatted, and --target cmake-reformat formats them. The targets come from cmake/common; cmake/common/README.md describes them.

About

Tests for Dyninst that don't fit in the framework of the test suite

Resources

Stars

0 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages