Welcome to mirror list, hosted at ThFree Co, Russian Federation.

run_tests.cpp « build_style « qt - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7edb143d1ede897d78132a35c806d62933417a92 (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
#include "run_tests.h"

#include "platform/platform.hpp"

#include "build_common.h"

namespace
{

QString GetStyleTestPath()
{
  QString const resourceDir = GetPlatform().ResourcesDir().c_str();
  return resourceDir + "style_tests.app/Contents/MacOS/style_tests";
}

} // namespace

namespace build_style
{

pair<bool, QString> RunCurrentStyleTests()
{
  QString const resourceDir = GetPlatform().ResourcesDir().c_str();

  QStringList params;
  params << GetStyleTestPath()
         << QString("--user_resource_path=\"") + resourceDir + "\""
         << QString("--data_path=\"") + resourceDir + "\"";
  QString const cmd = params.join(' ');

  auto const res = ExecProcess(cmd);

  // Unfortunately test process returns 0 even if some test failed,
  // therefore phrase 'All tests passed.' is looked to be sure that everything is OK.
  return make_pair(res.second.contains("All tests passed."), res.second);
}

} // namespace build_style