NVIDIA / NVIDIA/cccl

[BUG]: Multi-file c2h tests are not run

Open
#8,587 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

### Is this a duplicate?

- [x] I confirmed there appear to be no [duplicate issues](https://github.com/NVIDIA/cccl/issues) for this bug and that I agree to the [Code of Conduct](CODE_OF_CONDUCT.md)

### Type of Bug

Silent Failure

### Component

General CCCL

### Describe the bug

When a c2h test consists of multiple source files, not all `C2H_TEST` test cases are ran.

### How to Reproduce

File 1:
```cpp
#include "testing.cuh"

C2H_TEST("A1", "[A1]")
{
puts("A1");
}

C2H_TEST("A2", "[A2]")
{
puts("A2");
}
```
File 2:
```cpp
#include "testing.cuh"

C2H_TEST("B1", "[B1]")
{
puts("B1");
}

C2H_TEST("B2", "[B2]")
{
puts("B2");
}

C2H_TEST("B3", "[B3]")
{
puts("B3");
}
```
When added via `cudax_add_catch2_test`, compiled and ran, the output is:
```bash
./bin/cudax.test.bug
Randomness seeded to: 1186874317
A2
A1
A2
A1
B3
===============================================================================
test cases: 5 | 5 passed
assertions: - none -

```
Instead of `B1` and `B2` tests, the `A1` and `A2` tests are rerun. This pattern is consistent even when added more files.

### Expected behavior

All tests should be ran.

### Reproduction link

_No response_

### Operating System

_No response_

### nvidia-smi output

_No response_

### NVCC version

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.