summaryrefslogtreecommitdiffstats
path: root/coin/instructions/cmake_setup_running_tests_env_vars.yaml
blob: f2c290a3dfd4897c93bd94fb83f6e2247d9e8c6c (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
type: Group
instructions:
  # Informs qtestblacklist.cpp that tests are run in the CI.
  # A related QT_BUILD_ENVIRONMENT env var is set during an integration's build phase.
  - type: EnvironmentVariable
    variableName: QTEST_ENVIRONMENT
    variableValue: "ci"
  - type: WriteFile
    fileContents: |
        #!/usr/bin/python3
        import subprocess
        import calendar
        import datetime
        import time
        import sys
        import os
        import re
        from os.path import expanduser
        home = expanduser("~")

        file=os.path.basename(sys.argv[1])
        timestamp = str(round(time.time() * 1000))
        results_file = home + "/work/testresults/" + file +"-" + timestamp + ".xml,xml"
        testargs = ["-o", results_file, "-o", "-,txt"]
        if re.search("testlib.selftests.tst_selftests", sys.argv[1]):
            testargs = []
        exit(subprocess.call([sys.argv[1]] + testargs))
    filename: "{{.SourceDir}}/coin_ctest_runner.py"
    fileMode: 755
  - type: ExecuteCommand
    command: "chmod 755 {{.SourceDir}}/coin_ctest_runner.py"
    maxTimeInSeconds: 10
    maxTimeBetweenOutput: 10
    userMessageOnFailure: >
      Failed to change file permission.
    disable_if:
      condition: property
      property: host.os
      equals_value: Windows
  - type: Group
    instructions:
      - type: EnvironmentVariable
        variableName: TESTS_ENV_PREFIX
        variableValue: "{{.Env.ENV_PREFIX}}"
    enable_if:
      condition: and
      conditions:
        - condition: property
          property: host.os
          equals_property: target.os
        - condition: property
          property: target.osVersion
          not_equals_value: QEMU
  - type: Group
    instructions:
      - type: EnvironmentVariable
        variableName: TESTS_ENV_PREFIX
        variableValue: "{{.Env.TARGET_ENV_PREFIX}}"
    disable_if:
      condition: and
      conditions:
        - condition: property
          property: host.os
          equals_property: target.os
        - condition: property
          property: target.osVersion
          not_equals_value: QEMU