diff options
author | Artem Pavlenko <artem@mapnik.org> | 2020-02-14 16:56:46 +0000 |
---|---|---|
committer | Artem Pavlenko <artem@mapnik.org> | 2020-02-14 16:56:46 +0000 |
commit | 145c053a02d918d74002ea690dac398ee588a374 (patch) | |
tree | c645ffaec12822f0668858181248cd7365fc4e20 /test/ios/ios_test_runner.cpp | |
parent | 37a4660ca367f141b9e0dedf3932c74f0ee0c920 (diff) | |
parent | 59294aaef333bdd455bd13d6bab6fca730379b52 (diff) | |
download | qtlocation-mapboxgl-145c053a02d918d74002ea690dac398ee588a374.tar.gz |
Merge branch 'master' into galinelle_setStyle++_updatedupstream/galinelle_setStyle++_updated
Diffstat (limited to 'test/ios/ios_test_runner.cpp')
-rw-r--r-- | test/ios/ios_test_runner.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/ios/ios_test_runner.cpp b/test/ios/ios_test_runner.cpp new file mode 100644 index 0000000000..c99d8c3f30 --- /dev/null +++ b/test/ios/ios_test_runner.cpp @@ -0,0 +1,31 @@ +#include <ios_test_runner.hpp> + +#include <mbgl/test.hpp> + +#include <mbgl/util/logging.hpp> + +#include <unistd.h> +#include <vector> + +#define EXPORT __attribute__((visibility("default"))) + +EXPORT +bool TestRunner::startTest(const std::string& basePath) { + std::vector<std::string> arguments = {"mbgl-test-runner", "--gtest_output=xml:" + basePath + "/test/results.xml"}; + std::vector<char*> argv; + for (const auto& arg : arguments) { + argv.push_back(const_cast<char*>(arg.data())); + } + argv.push_back(nullptr); + + if (chdir(basePath.c_str())) { + mbgl::Log::Error(mbgl::Event::General, "Failed to change the directory to " + basePath); + return false; + } + + mbgl::Log::Info(mbgl::Event::General, "Start TestRunner"); + int status = mbgl::runTests(static_cast<uint32_t>(argv.size()), argv.data()); + mbgl::Log::Info(mbgl::Event::General, "TestRunner finished with status: '%d'", status); + + return status == 0; +} |