summaryrefslogtreecommitdiff
path: root/render-test/manifest_parser.hpp
blob: 2d11c9633e2e54c97590c18dc8413163e7efc121 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once

#include "metadata.hpp"

#include <mbgl/util/optional.hpp>
#include <mbgl/util/rapidjson.hpp>

#include <cstdlib>
#include <regex>
#include <string>
#include <utility>
#include <vector>

class Manifest {
public:
    Manifest();
    ~Manifest();
    const std::vector<std::pair<std::string, std::string>>& getIgnores() const;
    const std::vector<TestPaths>& getTestPaths() const;
    const std::string& getTestRootPath() const;
    const std::string& getManifestPath() const;
    const std::string& getResultPath() const;
    const std::string& getCachePath() const;
    const std::string& getAccessToken() const;
    const std::set<std::string>& getProbes() const;
    void doShuffle(uint32_t seed);

private:
    friend class ManifestParser;
    std::string manifestPath;
    std::string testRootPath;
    std::string resultPath;
    std::string cachePath;
    std::string accessToken;
    std::vector<std::pair<std::string, std::string>> ignores;
    std::vector<TestPaths> testPaths;
    std::set<std::string> probes;
};

class ManifestParser {
public:
    static mbgl::optional<Manifest> parseManifest(const std::string& manifestPath,
                                                  std::string testFilter);
};