[render-test] Add configurable rootPath, ignorePath via CLI arguments (#15832)
* [render-test] Add configurable path via CLI arguments * [render-test] Change ignore path config
This commit is contained in:
@@ -44,12 +44,12 @@ int runRenderTests(int argc, char** argv) {
|
||||
bool shuffle;
|
||||
uint32_t seed;
|
||||
std::string testRootPath;
|
||||
std::string ignoresPath;
|
||||
std::vector<TestPaths> testPaths;
|
||||
|
||||
std::tie(recycleMap, shuffle, seed, testRootPath, testPaths) = parseArguments(argc, argv);
|
||||
const std::string::size_type rootLength = testRootPath.length();
|
||||
std::tie(recycleMap, shuffle, seed, testRootPath, ignoresPath, testPaths) = parseArguments(argc, argv);
|
||||
|
||||
const auto ignores = parseIgnores();
|
||||
const auto ignores = parseIgnores(testRootPath, ignoresPath);
|
||||
|
||||
if (shuffle) {
|
||||
printf(ANSI_COLOR_YELLOW "Shuffle seed: %d" ANSI_COLOR_RESET "\n", seed);
|
||||
@@ -60,7 +60,7 @@ int runRenderTests(int argc, char** argv) {
|
||||
}
|
||||
|
||||
mbgl::util::RunLoop runLoop;
|
||||
TestRunner runner;
|
||||
TestRunner runner(testRootPath);
|
||||
|
||||
std::vector<TestMetadata> metadatas;
|
||||
metadatas.reserve(testPaths.size());
|
||||
@@ -68,7 +68,7 @@ int runRenderTests(int argc, char** argv) {
|
||||
TestStatistics stats;
|
||||
|
||||
for (auto& testPath : testPaths) {
|
||||
TestMetadata metadata = parseTestMetadata(testPath);
|
||||
TestMetadata metadata = parseTestMetadata(testPath, testRootPath);
|
||||
|
||||
if (!recycleMap) {
|
||||
runner.reset();
|
||||
@@ -78,6 +78,7 @@ int runRenderTests(int argc, char** argv) {
|
||||
std::string& status = metadata.status;
|
||||
std::string& color = metadata.color;
|
||||
|
||||
const std::string::size_type rootLength = getTestPath(testRootPath).length();
|
||||
id = testPath.defaultExpectations();
|
||||
id = id.substr(rootLength + 1, id.length() - rootLength - 2);
|
||||
|
||||
@@ -166,4 +167,4 @@ int runRenderTests(int argc, char** argv) {
|
||||
return stats.failedTests + stats.erroredTests == 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user