Commit dd12a0f
authored
Improve groupby test utils to include the original location of failure (#20718)
Currently, many groupby tests call to `test_single_agg()` and other utility functions in `groupby_test_util.*` (`test_sum_agg()` and `test_single_scan()`) to execute the test. When a failure happens, GTest only issues a trace location to somewhere in `test_single_agg()` while there is not any information about the actual failed test. That makes debugging a bit tricky.
This PR reimplements thesef test functions, adding one more parameter `std::source_location const& location = std::source_location::current()` to carry the caller's information. With this, GTest will report an additional line containing the location of the failed test. For example:
```
Google Test trace:
cudf/cpp/tests/groupby/groupby_test_util.cpp:75: <-- line of failure
cudf/cpp/tests/groupby/groupby_test_util.cpp:36: Original failure location: cudf/cpp/tests/groupby/sum_tests.cpp:192
```
Authors:
- Nghia Truong (https://github.com/ttnghia)
Approvers:
- Paul Mattione (https://github.com/pmattione-nvidia)
- David Wendt (https://github.com/davidwendt)
URL: #207181 parent 027c2c2 commit dd12a0f
File tree
2 files changed
+28
-11
lines changed- cpp/tests/groupby
2 files changed
+28
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
89 | | - | |
| 93 | + | |
| 94 | + | |
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
| |||
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
98 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
99 | 109 | | |
100 | 110 | | |
101 | 111 | | |
| |||
109 | 119 | | |
110 | 120 | | |
111 | 121 | | |
112 | | - | |
| 122 | + | |
| 123 | + | |
113 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
114 | 128 | | |
115 | 129 | | |
116 | 130 | | |
117 | | - | |
118 | 131 | | |
119 | 132 | | |
120 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
24 | | - | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | | - | |
| 41 | + | |
| 42 | + | |
0 commit comments