aboutsummaryrefslogtreecommitdiff
path: root/tests/runtest/nt.py
blob: 1eb127bfb044c37bc9dedc24b48d20655494b138 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# Testing for the 'lnt runtest nt' module.
#
# Check a basic nt run.
# RUN: lnt runtest nt \
# RUN:   --sandbox %t.SANDBOX \
# RUN:   --test-suite %S/Inputs/test-suite \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --no-timestamp > %t.log 2> %t.err
# RUN: FileCheck --check-prefix CHECK-STDOUT < %t.log %s
# RUN: FileCheck --check-prefix CHECK-BASIC < %t.err %s
# RUN: FileCheck --check-prefix CHECK-REPORT < %t.SANDBOX/build/report.json %s
# CHECK-REPORT: "run_order": "154331"
# CHECK-REPORT: "Name": "nts.{{[^.]+}}.exec"
# CHECK-REPORT: "Name": "nts.{{[^.]+}}.compile"
#
# CHECK-STDOUT: Import succeeded.
# CHECK-STDOUT: Added Machines: 1
# CHECK-STDOUT: Added Runs    : 1
# CHECK-STDOUT: Added Tests   : 130
#
# CHECK-BASIC: inferred C++ compiler under test
# CHECK-BASIC: checking source versions
# CHECK-BASIC: using nickname
# CHECK-BASIC: starting test
# CHECK-BASIC: configuring
# CHECK-BASIC: building test-suite tools
# CHECK-BASIC: executing "nightly tests" with -j1
# CHECK-BASIC: loading nightly test data
# CHECK-BASIC: capturing machine information
# CHECK-BASIC: generating report
# CHECK-BASIC: submitting result to dummy instance
#
# Use the same sandbox again with --no-configure
# RUN: lnt runtest nt \
# RUN:   --sandbox %t.SANDBOX \
# RUN:   --test-suite %S/Inputs/test-suite \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --no-timestamp --no-configure > %t.log 2> %t.err
# RUN: FileCheck --check-prefix CHECK-NOCONF < %t.err %s
# CHECK-NOCONF-NOT: configuring
#
# Check a basic nt run on a test-suite without binary hash support.
# RUN: lnt runtest nt \
# RUN:   --sandbox %t.SANDBOX-NO-HASH \
# RUN:   --test-suite %S/Inputs/test-suite-nohash \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --no-timestamp > %t.log 2> %t.err
# RUN: FileCheck --check-prefix CHECK-STDOUT < %t.log %s
# RUN: FileCheck --check-prefix CHECK-BASIC < %t.err %s
# RUN: FileCheck --check-prefix CHECK-REPORT < %t.SANDBOX-NO-HASH/build/report.json %s
#
# Manually set a run order.
# RUN: lnt runtest nt \
# RUN:   --sandbox %t.SANDBOX \
# RUN:   --test-suite %S/Inputs/test-suite \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --no-timestamp --run-order=123 > %t.log 2> %t.err
# RUN: FileCheck --check-prefix CHECK-RESULTS < %t.SANDBOX/build/report.json %s
# CHECK-RESULTS: "run_order": "123"
#
# Change the machine name. Don't use LLVM.
# RUN: lnt runtest nt \
# RUN:   --sandbox %t.SANDBOX \
# RUN:   --test-suite %S/Inputs/test-suite \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --no-auto-name foo > %t.log 2> %t.err
# RUN: FileCheck --check-prefix CHECK-AUTONAME < %t.err %s
# CHECK-AUTONAME: using nickname: 'foo'

# Run without LLVM.
# RUN: lnt runtest nt \
# RUN:   --sandbox %t.SANDBOX \
# RUN:   --test-suite %S/Inputs/test-suite \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --no-timestamp --without-llvm > %t.log 2> %t.err

# Check cflag handling

## With a lone cflag
# RUN: lnt runtest nt \
# RUN:   --sandbox %t.SANDBOX \
# RUN:   --test-suite %S/Inputs/test-suite \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --cflag '-Wall' \
# RUN:   --no-timestamp > %t.log 2> %t.err
# RUN: FileCheck --check-prefix CHECK-CFLAG1 < %t.err %s
# CHECK-CFLAG1: inferred C++ compiler under test
# CHECK-CFLAG1: TARGET_FLAGS: -Wall

## With a couple of cflags
# RUN: lnt runtest nt \
# RUN:   --sandbox %t.SANDBOX \
# RUN:   --test-suite %S/Inputs/test-suite \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --cflag '-Wall' \
# RUN:   --cflag '-mfloat-abi=hard' \
# RUN:   --cflag '-O3' \
# RUN:   --no-timestamp > %t.log 2> %t.err
# RUN: FileCheck --check-prefix CHECK-CFLAG2 < %t.err %s
# CHECK-CFLAG2: inferred C++ compiler under test
# CHECK-CFLAG2: TARGET_FLAGS: -Wall -mfloat-abi=hard -O3

## With a cflags
# RUN: lnt runtest nt \
# RUN:   --sandbox %t.SANDBOX \
# RUN:   --test-suite %S/Inputs/test-suite \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --cflags '-Wall -mfloat-abi=hard -O3' \
# RUN:   --no-timestamp > %t.log 2> %t.err
# RUN: FileCheck --check-prefix CHECK-CFLAG3 < %t.err %s
# CHECK-CFLAG3: inferred C++ compiler under test
# CHECK-CFLAG3: TARGET_FLAGS: -Wall -mfloat-abi=hard -O3

## With a cflags with a quoted space and escaped spaces
# RUN: lnt runtest nt \
# RUN:   --sandbox %t.SANDBOX \
# RUN:   --test-suite %S/Inputs/test-suite \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --cflags "-Wall -test=escaped\ space -some-option='stay with me' -O3" \
# RUN:   --no-timestamp > %t.log 2> %t.err
# RUN: FileCheck --check-prefix CHECK-CFLAG4 < %t.err %s
# CHECK-CFLAG4: inferred C++ compiler under test
# CHECK-CFLAG4: TARGET_FLAGS: -Wall '-test=escaped space' '-some-option=stay with me' -O3

## With cflag and cflags
# RUN: lnt runtest nt \
# RUN:   --sandbox %t.SANDBOX \
# RUN:   --test-suite %S/Inputs/test-suite \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --cflag '--target=armv7a-none-eabi' \
# RUN:   --cflag '-Weverything' \
# RUN:   --cflags '-Wall -test=escaped\ space -some-option="stay with me" -O3' \
# RUN:   --no-timestamp > %t.log 2> %t.err
# RUN: FileCheck --check-prefix CHECK-CFLAG5 < %t.err %s
# CHECK-CFLAG5: inferred C++ compiler under test
# CHECK-CFLAG5: TARGET_FLAGS: --target=armv7a-none-eabi -Weverything -Wall '-test=escaped space'
# CHECK-CFLAG5: '-some-option=stay with me' -O3

# Qemu flag handling
# RUN: lnt runtest nt \
# RUN:   --sandbox %t.SANDBOX \
# RUN:   --test-suite %S/Inputs/test-suite \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --qemu-user-mode TEST \
# RUN:   --qemu-flag '-soundhw gus' \
# RUN:   --qemu-flag '-net nic' \
# RUN:   --qemu-flags '-device gus,irq=5 -test=escaped\ space -some-option="stay with me"' \
# RUN:   --no-timestamp > %t.log 2> %t.err
# RUN: FileCheck --check-prefix CHECK-QEMU-FLAG1 < %t.err %s
# CHECK-QEMU-FLAG1: QEMU_USER_MODE_COMMAND: TEST -soundhw gus -net nic -device gus,irq=5
# CHECK-QEMU-FLAG1: '-test=escaped space' '-some-option=stay with me'

# Check submission to a server through url works:
# RUN: rm -rf %{test_exec_root}/runtest/nt_server_instance
# RUN: mkdir -p %{test_exec_root}/runtest/nt_server_instance
# RUN: rsync -av --exclude .svn %S/Inputs/rerun_server_instance/ \
# RUN:   %{test_exec_root}/runtest/nt_server_instance
# RUN: %{shared_inputs}/server_wrapper.sh \
# RUN:   %{test_exec_root}/runtest/nt_server_instance 9089 \
# RUN:   lnt runtest nt --submit "http://localhost:9089/db_default/submitRun" \
# RUN:   --sandbox %t.SANDBOX \
# RUN:   --test-suite %S/Inputs/rerun-test-suite1 \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --no-timestamp --rerun --run-order 1 > %t.log 2> %t.err
# RUN: FileCheck --check-prefix CHECK-SUBMIT-STDOUT < %t.log %s
# RUN: FileCheck --check-prefix CHECK-SUBMIT-STDERR < %t.err %s

# CHECK-SUBMIT-STDOUT: Import succeeded.
# CHECK-SUBMIT-STDOUT: PASS : 345

# CHECK-SUBMIT-STDERR: inferred C++ compiler under test
# CHECK-SUBMIT-STDERR: checking source versions
# CHECK-SUBMIT-STDERR: using nickname
# CHECK-SUBMIT-STDERR: starting test
# CHECK-SUBMIT-STDERR: configuring
# CHECK-SUBMIT-STDERR: building test-suite tools
# CHECK-SUBMIT-STDERR: executing "nightly tests" with -j1
# CHECK-SUBMIT-STDERR: loading nightly test data
# CHECK-SUBMIT-STDERR: capturing machine information
# CHECK-SUBMIT-STDERR: generating report
# CHECK-SUBMIT-STDERR: submitting result to
# CHECK-SUBMIT-STDERR: Rerunning 0 of 69 benchmarks.

# Check submission to a server through server instance works:
# RUN: rsync -av --exclude .svn %S/Inputs/rerun_server_instance/ \
# RUN:   %{test_exec_root}/runtest/nt_server_instance
# RUN: %{shared_inputs}/server_wrapper.sh \
# RUN:   %{test_exec_root}/runtest/nt_server_instance 9089 \
# RUN:   lnt runtest nt --submit "http://localhost:9089/db_default/submitRun" \
# RUN:   --commit 1 \
# RUN:   --sandbox %t.SANDBOX \
# RUN:   --test-suite %S/Inputs/rerun-test-suite1 \
# RUN:   --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
# RUN:   --no-timestamp --rerun --run-order 2 > %t.log 2> %t.err
# RUN: FileCheck --check-prefix CHECK-SUBMIT-STDOUT < %t.log %s
# RUN: FileCheck --check-prefix CHECK-SUBMIT-STDERR < %t.err %s