diff options
author | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-09-02 17:46:15 +0300 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-09-04 10:37:50 +0300 |
commit | 631bc4f6a3ff7518787a8a3db76b252e96198a07 (patch) | |
tree | 95d527bb7da3d31f6d7810e0f26fa16d7bc07e9f /expression-test/expression_test_runner.hpp | |
parent | c7be3d52a709c98e93384bdcabc5cebc7adb9dac (diff) | |
download | qtlocation-mapboxgl-631bc4f6a3ff7518787a8a3db76b252e96198a07.tar.gz |
[core] Add native expression test runner
Diffstat (limited to 'expression-test/expression_test_runner.hpp')
-rw-r--r-- | expression-test/expression_test_runner.hpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/expression-test/expression_test_runner.hpp b/expression-test/expression_test_runner.hpp new file mode 100644 index 0000000000..596d5c11b6 --- /dev/null +++ b/expression-test/expression_test_runner.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include <vector> +#include <string> + +class TestData; + +struct TestRunOutput { + TestRunOutput(std::string id_) : id(std::move(id_)) {} + std::string id; + bool passed = false; + std::string text; + std::string expression; + std::string serialized; +}; + +class TestStats { +public: + std::size_t testCount() const { + return passed.size() + failed.size() + errored.size() + + ignorePassed.size() + ignoreFailed.size(); + } + + std::vector<TestRunOutput> passed; + std::vector<TestRunOutput> failed; + std::vector<TestRunOutput> errored; + std::vector<TestRunOutput> ignorePassed; + std::vector<TestRunOutput> ignoreFailed; + std::vector<std::string> ids; +}; + +TestRunOutput runExpressionTest(TestData&, const std::string& rootPath, const std::string& id); |