Tests for compiler-rt
  • Shell 88.3%
  • C++ 8.9%
  • C 2.8%
Find a file
Jesus Checa Hidalgo 6e7caab25c broken-symlinks: Rewrite the test to not install in a chroot
Installing the package into a chroot from the repos is a flaky approach
as it's not guaranteed that the package in the repos is the same as the
one being tested. Also, it's unnecessarily time consuming.
Now the test checks the symlinks in the rpm and checks that they are
resolved to a file owned by either compiler-rt or one of its
dependencies.
2024-04-25 11:46:26 +02:00
.fmf Init repo: 2022-08-23 15:32:55 +02:00
plans Update testplan to new metadata. 2024-03-08 13:10:47 +01:00
tests broken-symlinks: Rewrite the test to not install in a chroot 2024-04-25 11:46:26 +02:00
README.md Fix Readme formatting 2024-04-02 08:51:06 +02:00

compiler-rt Tests

This repository contains tests for compiler-rt.

Usage

Tests are executed using TMT (Test Management Tool). The repository includes a TMT plan that runs all the tests by default. All the tests support the following context dimensions:

  • distro
  • arch
  • collection (only applicable to RHEL 7)

To run the tests:

# Run in the default virtual environment
tmt -c distro=<distro> -c arch=<arch> run -avv

# Run on a scheduled system
tmt -c distro=<distro> -c arch=<arch> run -avv provision -h connect -g <ip_or_hostname>

# Run specific tests
tmt -c distro=<distro> -c arch=<arch> run -avv provision -h connect -g <ip_or_hostname> test -n <regex>

Adding New Tests

Please consider the following when adding new tests:

  • Test scripts must be named test.sh. If a different test is needed, you need to overwrite the test: key in the test main.fmf.
  • Tests must be placed under tests/<test_name>. Additionally they can be placed into subdirectories if grouping make sense. E.g. tests/regression/<test_name>.
  • This repository has a common configuration under tests/main.fmf, inherited by all tests. When adding new ones, be careful not to overwrite existing keys from the inherited tests/main.fmf.
  • When setting FMF metadata keys, do merge values instead overwriting them. E.g. use require+: instead require:. For advanced use and more examples check FMF documentation.

After creating the new test, consider running tmt <context> tests show <test-name> to review that the resulting metadata such as requires, enable or test keys are as expected. For example:

$ tmt -c distro=fedora-39 tests show sanity
/tests/sanity
                 summary compiler-rt sanity test with signed int overflow
                 contact Jesus Checa Hidalgo <jcheca@redhat.com>
               component 'llvm-toolset' and 'compiler-rt'
                    test ./test.sh
                    path /tests/sanity
               framework shell
                  manual false
                     tty false
                 require 'clang' and 'compiler-rt'
                duration 5m
                 enabled true
                  result respect
                    tier 1

$ $ tmt -c collection=llvm-toolset-15.0 tests show sanity
/tests/sanity
                 summary compiler-rt sanity test with signed int overflow
                 contact Jesus Checa Hidalgo <jcheca@redhat.com>
               component 'llvm-toolset' and 'compiler-rt'
                    test scl enable llvm-toolset-15.0 -- ./test.sh
                    path /tests/sanity
               framework shell
                  manual false
                     tty false
                 require llvm-toolset-15.0-clang
                         llvm-toolset-15.0-compiler-rt
                duration 5m
                 enabled true
                  result respect
                    tier 1


Templates

Use the following templates when creating new tests.

FMF template. Uncomment needed fields, remove the rest.

summary: Descriptive summary for the test
# Maximum duration for the test
duration: 2m
# Short tests should be tier <= 1 so they're used for gating.
tier: 1
# Add an additional contact(s) if applicable
# contact+:
#   - Somebody <somebody@redhat.com>
# Additional requires
# require+:
#   - rpm-build
# Adjustments based on context dimensions
# adjust+:
#   - when: collection is defined
#     enabled: false
#     because: Test not supported in collections
# link+:
#   - verifies: https://issues.redhat.com/browse/...
# tag+:
#   - sometag