cccl icon indicating copy to clipboard operation
cccl copied to clipboard

Refactor `lit`-based testing infrastructure to eliminate redudnancy with cmake-provided information

Open jrhemstad opened this issue 2 months ago • 2 comments

There's a lot of stuff that lit does that is redundant with what cmake already does for us.

We should boil away as much of that as we can and just use cmake for that such that lit just does:

  • Build/Test files for a given directory
  • Test file meta-language
    • .pass or .fail file name convention for pass/fail at compile/runtime
    • Compiler/CTK version/feature specific comments

From first principles, we want using lit to look like:

  1. Invoke cmake to generate site config file
  2. Invoke lit using config file (SITE_CONFIG=*config file* lit /path/to/file(s))
    • It will then compile/run all files in the given path

For files following the convention:

  • X.pass.cpp -> should pass compile & runtime
  • X.fail.cpp -> should fail compile
  • X.runfail.cpp -> should fail at runtime

With support in the test files themselves for "meta-comments", e.g., things like the UNSUPPORTED: key

  • https://github.com/NVIDIA/cccl/blob/050b57c3199088674e0d7ddabdcdd32001a4c032/libcudacxx/test/libcudacxx/cuda/barrier/arrive_tx_cta.pass.cpp#L11-L12

jrhemstad avatar Oct 08 '25 18:10 jrhemstad

Would it be possible to add X.compile.pass.cpp for tests that should be just compiled? This is a common case for e. g. testing deduction guides

davebayer avatar Oct 09 '25 08:10 davebayer

Attempting to document lit behavior here: https://github.com/NVIDIA/cccl/issues/6556

alliepiper avatar Nov 07 '25 22:11 alliepiper