llvm-lit module for first-class utest.h unit test support
This module allows you to run a utest testsuite as part of a larger lit testsuite. This is useful when you want to mix API unit tests with functional testing of your driver programs.
Installation
pip install lit-utest
Requirements
lit is required. Your tests should be utest.h-based or behave like it.
Usage
In each of your main utest test files, set the build command:
// UTEST: cc %s -o %utest_bin
This works just like the built-in ShTest RUN: line, but introduces the special UTEST keyword to lit. The runner executes this command and the runs the resultant %utest_bin output file. All lit substitutions are available for use as usual.
Once your build commands have been added to your unit tests, configure lit with the UTestRunner in lit.local.cfg:
import lit_utest config.test_format = lit_utest.UTestRunner()
lit will now expect all discovered tests in the subdirectory to behave as utest tests, and ignore those without a UTEST: build command. It runs each unit test separately using utest’s --filter switch, and collects the results and prints them in the way you’d expect lit to do:
-- Testing: 3 tests, 3 threads -- XFAIL: lit_utest :: shell_tests/runline.xfail.test (1 of 3) PASS: lit_utest :: shell_tests/runline.test (2 of 3) PASS: lit_utest :: utest_tests/test.c (3 of 3) *** MICRO-TEST: lit_utest :: utest_tests/test.c[MyTestF.c2] -> PASS *** MICRO-TEST: lit_utest :: utest_tests/test.c[MyTestF.c] -> PASS *** MICRO-TEST: lit_utest :: utest_tests/test.c[MyTestI.c/0] -> PASS *** MICRO-TEST: lit_utest :: utest_tests/test.c[MyTestI.c/1] -> PASS *** MICRO-TEST: lit_utest :: utest_tests/test.c[MyTestI.c2/0] -> PASS [...]
For examples, see the test directory, where we eat our own dogfood.
Compatibility
This module should work in all places upstream lit is supported, but I will make no extra effort to support python < 2.7
Unlicence
utest.h is Public Domain, llvm is either NCSA or Apache-2 license depending on the version, so it makes sense to dedicate this work to the PUBLIC DOMAIN.
Metadata
Release files for lit-utest 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lit_utest-0.1.1.tar.gz | 3.5 kB | Without provenance | Details for lit_utest-0.1.1.tar.gz |
Release files / lit_utest-0.1.1.tar.gz
| Download URL | lit_utest-0.1.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f7a65522b4550ebbaabc1b83a60de47cfcead4fd21129b5ae2ac47989803a1f
|
|
BLAKE2b-256 checksum How to use checksums |
a8bc6c998922f20b25ba74729433d7a12efe97fa243febea530a2dc35c7a2fa3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.2
|
Security for lit-utest 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.