Skip to content

Commit c966b97

Browse files
committed
Update run_tests.py and perf_tests.cpp:
- Refine Valgrind command to use `--show-leak-kinds=all` for broader leak reporting. - Add `PrintTo` functions in `perf_tests.cpp` to enhance test output readability.
1 parent 502d2d7 commit c966b97

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

modules/core/performance/tests/perf_tests.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ struct ParamTestCase {
9898
std::string expected_output;
9999
};
100100

101+
inline void PrintTo(const ParamTestCase& param, std::ostream* os) {
102+
*os << "{ input = " << static_cast<int>(param.input) << ", expected = " << param.expected_output << " }";
103+
}
104+
101105
class GetStringParamNameParamTest : public ::testing::TestWithParam<ParamTestCase> {};
102106

103107
TEST_P(GetStringParamNameParamTest, ReturnsExpectedString) {
@@ -118,6 +122,11 @@ struct TaskTypeTestCase {
118122
std::string label;
119123
};
120124

125+
inline void PrintTo(const TaskTypeTestCase& param, std::ostream* os) {
126+
*os << "{ type = " << static_cast<int>(param.type) << ", expected = " << param.expected << ", label = " << param.label
127+
<< " }";
128+
}
129+
121130
class GetStringTaskTypeTest : public ::testing::TestWithParam<TaskTypeTestCase> {
122131
protected:
123132
std::string temp_path;

scripts/run_tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ def __init__(self):
3131
self.__ppc_env = None
3232
self.work_dir = None
3333

34-
self.valgrind_cmd = ("valgrind --leak-check=full --show-leak-kinds=definite "
35-
"--errors-for-leak-kinds=definite --error-exitcode=1")
34+
self.valgrind_cmd = "valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all"
3635

3736
if platform.system() == "Windows":
3837
self.mpi_exec = "mpiexec"

0 commit comments

Comments
 (0)