Skip to main content

check-build -- check whether example programs can be built

The check-build tool can be used to build and test different programs in a temporary build directory. The programs are listed in a TOML configuration file, along with the commands to build and test them.

Configuration file structure

The file describing the subdirectories with the programs to be built has the following structure:

The "format" section

The format section contains a single table named version with two keys, major and minor, both integers. The major.minor pair specifies the version of the format specification for the programs.toml file itself.

The only valid combination of values is major = 0 and minor = 1.

The "program" section

This table contains the definitions for the programs that check-build should try to build and run. It may have one or more entries with names corresponding to the names of the subdirectories where the files for each program may be found.

The "program.NAME.prerequisites" section

This table currently only has a single valid key, programs: a list of program names that will be looked for in the current execution search path.

If any of these prerequisites are not met, check-build will not attempt to build the program, but it will report it as skipped, not failed. This may be overridden by the --force command-line option (or the check_build.defs.Config.force boolean variable): if it is specified, then check-build will attempt to build and run the program even if some of its prerequisites are not met.

The "program.NAME.commands" section

This table contains the lists of commands to be executed in order to build and test the program. Each value is a list of commands to be executed, and each command in its turn is a list of strings: a program name and arguments to pass to it.

There are currently three valid keys in this table:

  • clean: not used yet, since check-build always copies the program files to a newly-created temporary directory, so there should be no previously-existing build artifacts
  • build: one or more commands to execute to build the program
  • test: one or more commands to execute to make sure that the program that was just built is operational and correct

The check-build command-line tool

The most common way to use check-build is through the command-line tool: run check-build, specify the path to the TOML configuration file using the -c option, optionally pass the -v / --verbose flag. By default, the check-build tool will try to build and test all the programs defined in the configuration file; pass one or more program names on the command line to only build and test those.

Examples

Given the following contents of the ztest/programs.toml configuration file:

[format.version]
major = 0
minor = 1

[program.pkg-make]
executable = "ztest"

[program.pkg-make.commands]
clean = [["make", "clean"]]
build = [["make"]]
test = [["make", "test"]]

[program.cmake]
executable = "ztest"

[program.cmake.commands]
clean = [["make", "clean"]]
build = [["cmake", "."], ["make"]]
test = [["./ztest"]]

Build and test both programs:

check-build -c ztest/programs.toml

Only build and test the CMake version with some check-build diagnostic messages:

check-build -c ztest/programs.toml -v cmake

Metadata

Release files for check-build 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for check-build 0.1.1
File Size Uploaded
check_build-0.1.1.tar.gz 31.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for check-build 0.1.1
File Interpreter ABI Platform
check_build-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 41.5 kB

Release files / check_build-0.1.1.tar.gz

Download URL check_build-0.1.1.tar.gz
Size 31.9 kB
Tags Source
SHA-256 checksum
How to use checksums
05f458131719ad68657e457e174060264b5ea344efe80a00956317b4fec9ff25
BLAKE2b-256 checksum
How to use checksums
02df0a4defaa62f972d1c13429c385b82158432d4339469f874a3546b1a7832d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / check_build-0.1.1-py3-none-any.whl

Download URL check_build-0.1.1-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a57607560665c03a591c56b2dbec35585e77390960061a15ff9b6e37c638182
BLAKE2b-256 checksum
How to use checksums
7004274c22c60f6a97100535acb27b03fabf33828e36d89c7e3f68d2c6b1a499
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page