summaryrefslogtreecommitdiff
path: root/render-test
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2020-01-08 13:46:05 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-01-08 14:58:05 +0200
commitd148908cf14c78505ebc924a1783bbd44de0e399 (patch)
tree2441498c751dbc4bcb5e85ef636f9795cb3c8648 /render-test
parent5a0f43037fc77d200a3759e15b258fc4e5717b43 (diff)
downloadqtlocation-mapboxgl-d148908cf14c78505ebc924a1783bbd44de0e399.tar.gz
[render-test] Make the manifest mandatory
At the moment we have an invalid path as default.
Diffstat (limited to 'render-test')
-rw-r--r--render-test/manifest_parser.cpp4
-rw-r--r--render-test/render_test.cpp10
2 files changed, 6 insertions, 8 deletions
diff --git a/render-test/manifest_parser.cpp b/render-test/manifest_parser.cpp
index 18b4b98cdd..4d2952c761 100644
--- a/render-test/manifest_parser.cpp
+++ b/render-test/manifest_parser.cpp
@@ -282,8 +282,8 @@ mbgl::optional<Manifest> ManifestParser::parseManifest(const std::string& manife
expectedMetricPaths.emplace_back("/sdcard/baselines/");
#endif
testPaths.emplace_back(testPath,
- getTestExpectations(defaultExpectationPath, testId, expectationPaths),
- getTestExpectations(defaultExpectationPath, testId, expectedMetricPaths));
+ getTestExpectations(defaultExpectationPath, testId, expectationPaths),
+ getTestExpectations(defaultExpectationPath, testId, expectedMetricPaths));
}
}
diff --git a/render-test/render_test.cpp b/render-test/render_test.cpp
index c6595a7b7f..c4ea7e64ab 100644
--- a/render-test/render_test.cpp
+++ b/render-test/render_test.cpp
@@ -43,8 +43,7 @@ void operator delete(void* ptr, size_t) noexcept {
namespace {
-using ArgumentsTuple = std::
- tuple<bool, bool, bool, uint32_t, std::string, TestRunner::UpdateResults, std::string>;
+using ArgumentsTuple = std::tuple<bool, bool, bool, uint32_t, std::string, TestRunner::UpdateResults, std::string>;
ArgumentsTuple parseArguments(int argc, char** argv) {
const static std::unordered_map<std::string, TestRunner::UpdateResults> updateResultsFlags = {
{"default", TestRunner::UpdateResults::DEFAULT},
@@ -62,7 +61,7 @@ ArgumentsTuple parseArguments(int argc, char** argv) {
argumentParser, "online", "Toggle online mode (by default tests will run offline)", {'o', "online"});
args::ValueFlag<uint32_t> seedValue(argumentParser, "seed", "Shuffle seed (default: random)", {"seed"});
args::ValueFlag<std::string> testPathValue(
- argumentParser, "manifestPath", "Test manifest file path", {'p', "manifestPath"});
+ argumentParser, "manifestPath", "Test manifest file path", {'p', "manifestPath"}, args::Options::Required);
args::ValueFlag<std::string> testFilterValue(argumentParser, "filter", "Test filter regex", {'f', "filter"});
args::MapFlag<std::string, TestRunner::UpdateResults> testUpdateResultsValue(
argumentParser,
@@ -95,7 +94,7 @@ ArgumentsTuple parseArguments(int argc, char** argv) {
exit(2);
}
- mbgl::filesystem::path manifestPath{testPathValue ? args::get(testPathValue) : std::string{TEST_RUNNER_ROOT_PATH}};
+ mbgl::filesystem::path manifestPath = args::get(testPathValue);
if (!mbgl::filesystem::exists(manifestPath) || !manifestPath.has_filename()) {
mbgl::Log::Error(mbgl::Event::General,
"Provided test manifest file path '%s' does not exist",
@@ -130,8 +129,7 @@ int runRenderTests(int argc, char** argv, std::function<void()> testStatus) {
std::string testFilter;
TestRunner::UpdateResults updateResults;
- std::tie(recycleMap, shuffle, online, seed, manifestPath, updateResults, testFilter) =
- parseArguments(argc, argv);
+ std::tie(recycleMap, shuffle, online, seed, manifestPath, updateResults, testFilter) = parseArguments(argc, argv);
ProxyFileSource::setOffline(!online);