update vctest
This commit is contained in:
parent
17dcbe98ab
commit
4a6689104a
@ -151,7 +151,8 @@ static void display_segfault_valgrind(
|
|||||||
if (pos == std::string::npos) {
|
if (pos == std::string::npos) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (line.find("If you") != std::string::npos) {
|
if (line.find("If you") != std::string::npos ||
|
||||||
|
line.find("HEAP SUMMARY:") != std::string::npos) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ss << line.substr(pos + 3) << "\n";
|
ss << line.substr(pos + 3) << "\n";
|
||||||
@ -175,11 +176,13 @@ static bool run_test(const Config& config, const fs::path& path, bool memcheck =
|
|||||||
using std::chrono::milliseconds;
|
using std::chrono::milliseconds;
|
||||||
|
|
||||||
auto outputFile = config.workingDir / "output.txt";
|
auto outputFile = config.workingDir / "output.txt";
|
||||||
|
auto memcheckLogFile = config.workingDir / "memcheck.txt";
|
||||||
|
|
||||||
auto name = path.stem();
|
auto name = path.stem();
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
if (memcheck) {
|
if (memcheck) {
|
||||||
ss << config.memchecker << " ";
|
ss << config.memchecker << " --log-file="
|
||||||
|
<< fix_path(memcheckLogFile.string()) << " ";
|
||||||
}
|
}
|
||||||
ss << fs::canonical(config.executable) << " --headless";
|
ss << fs::canonical(config.executable) << " --headless";
|
||||||
ss << " --test " << fix_path(path.string());
|
ss << " --test " << fix_path(path.string());
|
||||||
@ -200,7 +203,8 @@ static bool run_test(const Config& config, const fs::path& path, bool memcheck =
|
|||||||
if (code) {
|
if (code) {
|
||||||
if (memcheck) {
|
if (memcheck) {
|
||||||
// valgrind-specific output
|
// valgrind-specific output
|
||||||
display_segfault_valgrind(outputFile, name, std::cerr);
|
display_segfault_valgrind(memcheckLogFile, name, std::cerr);
|
||||||
|
fs::remove(memcheckLogFile);
|
||||||
fs::remove(outputFile);
|
fs::remove(outputFile);
|
||||||
} else {
|
} else {
|
||||||
display_test_output(outputFile, name, std::cerr);
|
display_test_output(outputFile, name, std::cerr);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user