mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-26 09:31:59 +00:00
Reduce verbosity of index tests. Make it easier to identify failures.
This commit is contained in:
parent
5ace7e7062
commit
8468ef09c3
24
src/test.cc
24
src/test.cc
@ -132,9 +132,6 @@ void RunIndexTests(const std::string& filter_path) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
float memory_before = GetProcessMemoryUsedInMb();
|
|
||||||
float memory_after = -1.;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
if (!EndsWith(path, filter_path))
|
if (!EndsWith(path, filter_path))
|
||||||
continue;
|
continue;
|
||||||
@ -198,6 +195,7 @@ void RunIndexTests(const std::string& filter_path) {
|
|||||||
// Get output from index operation.
|
// Get output from index operation.
|
||||||
IndexFile* db = FindDbForPathEnding(expected_path, dbs);
|
IndexFile* db = FindDbForPathEnding(expected_path, dbs);
|
||||||
if (!db->diagnostics_.empty()) {
|
if (!db->diagnostics_.empty()) {
|
||||||
|
std::cout << "For " << path << std::endl;
|
||||||
for (const lsDiagnostic& diagnostic : db->diagnostics_) {
|
for (const lsDiagnostic& diagnostic : db->diagnostics_) {
|
||||||
std::cout << " ";
|
std::cout << " ";
|
||||||
if (diagnostic.severity)
|
if (diagnostic.severity)
|
||||||
@ -223,7 +221,7 @@ void RunIndexTests(const std::string& filter_path) {
|
|||||||
expected.Parse(expected_output.c_str());
|
expected.Parse(expected_output.c_str());
|
||||||
|
|
||||||
if (actual == expected) {
|
if (actual == expected) {
|
||||||
std::cout << "[PASSED] " << path << std::endl;
|
// std::cout << "[PASSED] " << path << std::endl;
|
||||||
} else {
|
} else {
|
||||||
DiffDocuments(path, expected_path, expected, actual);
|
DiffDocuments(path, expected_path, expected, actual);
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
@ -246,26 +244,8 @@ void RunIndexTests(const std::string& filter_path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memory_after = GetProcessMemoryUsedInMb();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float memory_cleanup = GetProcessMemoryUsedInMb();
|
|
||||||
std::cerr << "[memory] before=" << memory_before
|
|
||||||
<< "mb, after=" << memory_after
|
|
||||||
<< "mb, cleanup=" << memory_cleanup << "mb" << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cerr << "[final presleep] " << GetProcessMemoryUsedInMb() << "mb"
|
|
||||||
<< std::endl;
|
|
||||||
// std::this_thread::sleep_for(std::chrono::seconds(10));
|
|
||||||
// std::cerr << "[final postsleep] " << GetProcessMemoryUsedInMb() << "mb" <<
|
|
||||||
// std::endl;
|
|
||||||
std::cerr << std::endl;
|
|
||||||
std::cerr << std::endl;
|
|
||||||
std::cerr << std::endl;
|
|
||||||
std::cerr << std::endl;
|
|
||||||
std::cerr << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: ctor/dtor, copy ctor
|
// TODO: ctor/dtor, copy ctor
|
||||||
|
Loading…
Reference in New Issue
Block a user