Newer
Older
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
default:
image: gitup.uni-potsdam.de:4567/maxschro/cofe_up/cofe_up
variables:
GIT_STRATEGY: clone
AUFGABE: "1.5"
PARAMETER: ""
stages:
- clean
- build
- lint
- publish
Clean:
tags:
- lint
stage: clean
script:
- rm -rf data
- mkdir data
artifacts:
when: always
paths:
- results/output.make
- data
Build:
tags:
- lint
stage: build
script:
- echo "Try building"
- rm -rf results
- mkdir results
- make clean
- make 2> results/output.make
- if [ -f results/output.make ]; then if grep -i warning results/output.make > /dev/null; then exit 1; else exit 0;fi;fi
after_script:
- python3 /opt/parser/run.py --input-dir ./results --output-junit output.xml --cf_local "/opt/exercises/gbr/$AUFGABE/messages.xml" --cf_global /opt/exercises/gbr/messages.xml --srcdir ./ --export-errors ./data/make.pkl
allow_failure:
exit_codes:
- 1
artifacts:
when: always
paths:
- results/output.make
- data
reports:
junit: output.xml
Build-Vorlage:
tags:
- lint
stage: build
script:
- echo "Try building"
- rm -rf results
- mkdir results
# remove students Makefile
- find . -iname "makefile" -exec rm {} \;
- cp "/opt/exercises/gbr/$AUFGABE/Makefile.bak" Makefile
- make clean
- make 2> results/output.make
- if [ -f results/output.make ]; then if grep -i warning results/output.make > /dev/null; then exit 4; else exit 0;fi;fi
after_script:
- python3 /opt/parser/run.py --input-dir ./results --output-junit output.xml --cf_local "/opt/exercises/gbr/$AUFGABE/messages.xml" --cf_global /opt/exercises/gbr/messages.xml --srcdir ./ --export-errors ./data/make-template.pkl
allow_failure:
exit_codes:
- 4
artifacts:
when: always
paths:
- results/output.make
- data
reports:
junit: output.xml
Run:
tags:
- lint
stage: lint
script:
- echo "Try building"
- rm -rf results
- mkdir results
# remove students Makefile
- find . -iname "makefile" -exec rm {} \;
- cp "/opt/exercises/gbr/$AUFGABE/Makefile-analyzer.bak" Makefile
- make clean
- make
- echo "-------------------------------------------------"; echo "YOUR PROGRAM IS BEING EXECUTED"; echo "-------------------------------------------------"
- "./prog ${PARAMETER}"
allow_failure: true
artifacts:
when: always
paths:
- prog
- core
StaticAnalyze:
tags:
- lint
stage: lint
script:
- echo "Static analyze with 'SimpleErrorChecker'"
- rm -rf results
- find . -iname "makefile" -exec rm {} \;
- cp "/opt/exercises/gbr/$AUFGABE/Makefile-analyzer.bak" Makefile
- make clean
# need the directory even if the analyzer don't find an error
- mkdir results
- '( scan-build -o ./results -plist-html -load-plugin /root/llvm-static-analyzers/build/SimpleErrorChecker.so -enable-checker alpha.unix.ErrorChecker2 -disable-checker unix.Malloc make 2> /dev/null || true ) | grep "scan-build: No bugs found."'
after_script:
- python3 /opt/parser/run.py --input-dir ./results --output-junit output.xml --cf_local "/opt/exercises/gbr/$AUFGABE/messages.xml" --cf_global /opt/exercises/gbr/messages.xml --srcdir ./ --export-errors ./data/scan-build.pkl
allow_failure:
exit_codes:
- 1
artifacts:
when: always
expose_as: 'StaticAnalyze Report'
paths:
- results
- data
reports:
junit: output.xml
StaticAnalyze2-Header:
tags:
- lint
stage: lint
script:
- echo "Static analyze with 'DefinitionInHeaders'"
- rm -rf results
- find . -iname "makefile" -exec rm {} \;
- cp "/opt/exercises/gbr/$AUFGABE/Makefile-analyzer.bak" Makefile
- make clean
- bear -- make
- mkdir results
- clang-tidy -checks=-*,misc-definitions-in-headers,bugprone-suspicious-include -header-filter=.* *.c >> results/clangCheck.tidy
- clang-tidy -checks=-*,misc-definitions-in-headers,bugprone-suspicious-include -header-filter=.* --export-fixes=rawoutput.txt *.c
- if [ -s rawoutput.txt ]; then exit 2; fi;
after_script:
- python3 /opt/parser/run.py --input-dir ./results --output-junit output.xml --cf_local "/opt/exercises/gbr/$AUFGABE/messages.xml" --cf_global /opt/exercises/gbr/messages.xml --srcdir ./ --export-errors ./data/tidy.pkl
allow_failure:
exit_codes:
- 1
- 2
artifacts:
when: always
expose_as: 'StaticAnalyze2-Header Report'
paths:
- results
- data
reports:
junit: output.xml
UnitTest:
tags:
- lint
stage: lint
variables:
CMOCKA_XML_FILE: "results/%g.cmocka"
script:
- echo "Unittest with CMocka"
- rm -rf results
- find . -iname "makefile" -exec rm {} \;
- cp "/opt/exercises/gbr/$AUFGABE/Makefile-test.bak" Makefile
- cp "/opt/exercises/gbr/$AUFGABE"/test-* ./
- make clean
- mkdir results
- make 2> results/output.makecm
# If make fails, the job stops here. Otherwise we proceed with Unit-Tests
- rm -f /results/output.makecm
- unset ERROR
- |
for i in test*.out; do
if "./$i" > /dev/null 2> "results/$i.make"; then
rm -f "results/$i.make";
else
if [ $? -ge 125 ] && [ $? -lt 255 ]; then
echo "Fehler beim ausfuehren der Unit-Tests, möglicher Segmentation Fault" > results/output.make;
else
rm -f "results/$i.make";
fi;
ERROR=1;
fi;
done
- if [[ -v ERROR ]]; then false; fi
- rm -f results/output.make
after_script:
- python3 /opt/parser/run.py --input-dir ./results --output-junit output.xml --cf_local "/opt/exercises/gbr/$AUFGABE/messages.xml" --cf_global /opt/exercises/gbr/messages.xml --srcdir ./ --export-errors ./data/unit.pkl
allow_failure: true
artifacts:
when: always
paths:
- results
- core
- test*.out
- data
reports:
junit: output.xml
MemoryCheck:
tags:
- lint
stage: lint
script:
- echo "Thread Checks with TSAN"
- rm -rf results
- find . -iname "makefile" -exec rm {} \;
- cp "/opt/exercises/gbr/$AUFGABE/Makefile-asan.bak" Makefile
- make
- echo "Analyze"
- mkdir results
- ASAN_OPTIONS="log_path=results/log.asan" ./prog $PARAMETER
after_script:
- python3 /opt/parser/run.py --input-dir ./results --output-junit output.xml --cf_local "/opt/exercises/gbr/$AUFGABE/messages.xml" --cf_global /opt/exercises/gbr/messages.xml --srcdir ./ --export-errors ./data/asan.pkl
allow_failure:
exit_codes:
- 1
artifacts:
when: always
paths:
- results
- data
reports:
junit: output.xml
Threadanalyzer:
tags:
- lint
stage: lint
script:
- echo "Thread Checks with TSAN"
- rm -rf results
- find . -iname "makefile" -exec rm {} \;
- cp "/opt/exercises/gbr/$AUFGABE/Makefile-tsan.bak" Makefile
- make
- echo "Analyze"
- mkdir results
- TSAN_OPTIONS="log_path=results/log.tsan" ./prog $PARAMETER
after_script:
- python3 /opt/parser/run.py --input-dir ./results --output-junit output.xml --cf_local "/opt/exercises/gbr/$AUFGABE/messages.xml" --cf_global /opt/exercises/gbr/messages.xml --srcdir ./ --export-errors ./data/tsan.pkl
allow_failure:
exit_codes:
- 1
artifacts:
when: always
paths:
- results
- data
reports:
junit: output.xml
pages:
stage: publish
tags:
- lint
script:
- mkdir -p public
- python3 /opt/parser/run.py --print --output-html ./public --template-dir /opt/templates --srcdir ./ --load-errors ./data --create-report --with-gitlab --download-report --export-report ./public/cofee.pkl
allow_failure:
exit_codes:
- 1
artifacts:
paths:
- public
- data
when: always