Enhance index test selection filtering

This commit is contained in:
Jacob Dufault 2017-12-28 09:55:17 -08:00
parent 4781e9a53d
commit 719c6c9ae9
2 changed files with 104 additions and 102 deletions

View File

@ -454,7 +454,8 @@ Command line options:
--test-unit Run unit tests.
--test-index <opt_filter_path>
Run index tests. opt_filter_path can be used to specify which
test to run. If not provided all tests are run.
test to run (ie, "foo" will run all tests which contain "foo"
in the path). If not provided all tests are run.
--log-stdin-stdout-to-stderr
Print stdin and stdout messages to stderr. This is a aid for
developing new language clients, as it makes it easier to figure

View File

@ -132,10 +132,12 @@ void RunIndexTests(const std::string& filter_path) {
continue;
}
{
if (!EndsWith(path, filter_path))
if (path.find(filter_path) == std::string::npos)
continue;
if (!filter_path.empty())
std::cout << "Running " << path << std::endl;
// Parse expected output from the test, parse it into JSON document.
std::vector<std::string> lines_with_endings = ReadLinesWithEnding(path);
TextReplacer text_replacer;
@ -245,7 +247,6 @@ void RunIndexTests(const std::string& filter_path) {
}
}
}
}
}
// TODO: ctor/dtor, copy ctor