diff options
author | zmiao <miao.zhao@mapbox.com> | 2019-10-23 12:04:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-23 12:04:23 +0300 |
commit | 2385f4cd86261cdfc6253de5fed217bfc06fa6c8 (patch) | |
tree | 8d5e98b83efce930ff8b9454d75c3eedc8513a22 /render-test/parser.hpp | |
parent | 99feb9bb306ddf06c228f0b6bbfb88abead6b33a (diff) | |
download | qtlocation-mapboxgl-2385f4cd86261cdfc6253de5fed217bfc06fa6c8.tar.gz |
[render-test] Add configurable rootPath, ignorePath via CLI arguments (#15832)
* [render-test] Add configurable path via CLI arguments
* [render-test] Change ignore path config
Diffstat (limited to 'render-test/parser.hpp')
-rw-r--r-- | render-test/parser.hpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/render-test/parser.hpp b/render-test/parser.hpp index 3c857b7e1e..1985b9cffc 100644 --- a/render-test/parser.hpp +++ b/render-test/parser.hpp @@ -12,7 +12,7 @@ using ErrorMessage = std::string; using JSONReply = mbgl::variant<mbgl::JSDocument, ErrorMessage>; -using ArgumentsTuple = std::tuple<bool, bool, uint32_t, std::string, std::vector<TestPaths>>; +using ArgumentsTuple = std::tuple<bool, bool, uint32_t, std::string, std::string, std::vector<TestPaths>>; JSONReply readJson(const mbgl::filesystem::path&); std::string serializeJsonValue(const mbgl::JSValue&); @@ -23,17 +23,21 @@ std::vector<std::string> readExpectedJSONEntries(const mbgl::filesystem::path& b TestMetrics readExpectedMetrics(const mbgl::filesystem::path& path); +const std::string getTestPath(const std::string& rootTestPath); +const mbgl::filesystem::path getValidPath(const std::string& basePath, const std::string& subPath); + ArgumentsTuple parseArguments(int argc, char** argv); -std::vector<std::pair<std::string, std::string>> parseIgnores(); +std::vector<std::pair<std::string, std::string>> parseIgnores(const std::string& testRootPath, + const std::string& ignoresPath); -TestMetadata parseTestMetadata(const TestPaths& paths); +TestMetadata parseTestMetadata(const TestPaths& paths, const std::string& testRootPath); std::string createResultPage(const TestStatistics&, const std::vector<TestMetadata>&, bool shuffle, uint32_t seed); -std::string localizeURL(const std::string& url); +std::string localizeURL(const std::string& url, const std::string& testPath); std::string toJSON(const mbgl::Value& value, unsigned indent, bool singleLine); std::string toJSON(const std::vector<mbgl::Feature>& features, unsigned indent, bool singleLine); -void localizeSourceURLs(mbgl::JSValue& root, mbgl::JSDocument& document); -void localizeStyleURLs(mbgl::JSValue& root, mbgl::JSDocument& document);
\ No newline at end of file +void localizeSourceURLs(mbgl::JSValue& root, mbgl::JSDocument& document, const std::string& testPath); +void localizeStyleURLs(mbgl::JSValue& root, mbgl::JSDocument& document, const std::string& testPath); |