@@ -29,7 +29,7 @@ setup_user() {
29
29
chown -R $u :$u ./
30
30
}
31
31
32
- setup () {
32
+ setup_helper () {
33
33
setup_user
34
34
for shared_file in config.log confdefs.h conftest.err; do
35
35
chmod a+rw $shared_file || true
@@ -149,7 +149,7 @@ compile_assertions_finished () {
149
149
}
150
150
151
151
@test " Run as root discouraged" {
152
- setup
152
+ setup_helper
153
153
run su root -c " ./configure"
154
154
discourage_root=" checking domjudge-user... configure: error: installing/running as root is STRONGLY DISCOURAGED, use --with-domjudge-user=root to override."
155
155
assert_line " $discourage_root "
@@ -204,7 +204,7 @@ compile_assertions_finished () {
204
204
}
205
205
206
206
@test " Run as normal user" {
207
- setup
207
+ setup_helper
208
208
run ./configure --with-domjudge-user=$u
209
209
assert_line " checking domjudge-user... $u "
210
210
run su $u -c " ./configure"
@@ -227,7 +227,7 @@ compile_assertions_finished () {
227
227
}
228
228
229
229
@test " /opt configured" {
230
- setup
230
+ setup_helper
231
231
run run_configure
232
232
assert_line " * prefix..............: /opt/domjudge"
233
233
assert_line " * documentation.......: /opt/domjudge/doc"
@@ -254,7 +254,7 @@ compile_assertions_finished () {
254
254
}
255
255
256
256
@test " Prefix configured" {
257
- setup
257
+ setup_helper
258
258
run run_configure --prefix=/tmp
259
259
refute_line " * prefix..............: /opt/domjudge"
260
260
refute_line " * documentation.......: /opt/domjudge/doc"
@@ -276,7 +276,7 @@ compile_assertions_finished () {
276
276
}
277
277
278
278
@test " Check FHS" {
279
- setup
279
+ setup_helper
280
280
run run_configure --enable-fhs
281
281
refute_line " * prefix..............: /opt/domjudge"
282
282
refute_line " * documentation.......: /opt/domjudge/doc"
@@ -311,7 +311,7 @@ compile_assertions_finished () {
311
311
}
312
312
313
313
@test " Alternative dirs together with FHS" {
314
- setup
314
+ setup_helper
315
315
run run_configure --enable-fhs --with-domserver_webappdir=/run/webapp --with-domserver_tmpdir=/tmp/domserver --with-judgehost_tmpdir=/srv/tmp --with-judgehost_judgedir=/srv/judgings --with-judgehost_chrootdir=/srv/chroot/domjudge
316
316
assert_line " * prefix..............: /usr/local"
317
317
assert_line " * documentation.......: /usr/local/share/doc/domjudge"
@@ -343,7 +343,7 @@ compile_assertions_finished () {
343
343
}
344
344
345
345
@test " Alternative dirs together with defaults" {
346
- setup
346
+ setup_helper
347
347
run run_configure " --with-judgehost_tmpdir=/srv/tmp --with-judgehost_judgedir=/srv/judgings --with-judgehost_chrootdir=/srv/chroot --with-domserver_logdir=/log"
348
348
assert_line " * prefix..............: /opt/domjudge"
349
349
assert_line " * documentation.......: /opt/domjudge/doc"
@@ -360,7 +360,7 @@ compile_assertions_finished () {
360
360
}
361
361
362
362
@test " Default URL not set, docs mention" {
363
- setup
363
+ setup_helper
364
364
run run_configure
365
365
assert_line " checking baseurl... https://example.com/domjudge/"
366
366
assert_line " Warning: base URL is unconfigured; generating team documentation will"
@@ -377,7 +377,7 @@ compile_assertions_finished () {
377
377
}
378
378
379
379
@test " Change users" {
380
- setup
380
+ setup_helper
381
381
run run_configure
382
382
assert_line " * default user........: domjudge-bats-user"
383
383
assert_line " * runguard user.......: domjudge-run"
@@ -397,7 +397,7 @@ compile_assertions_finished () {
397
397
}
398
398
399
399
@test " No docs" {
400
- setup
400
+ setup_helper
401
401
run run_configure
402
402
assert_line " * documentation.......: /opt/domjudge/doc"
403
403
run run_configure --enable-doc-build
@@ -411,7 +411,7 @@ compile_assertions_finished () {
411
411
# Fails as libraries are not found
412
412
skip
413
413
fi
414
- setup
414
+ setup_helper
415
415
run run_configure
416
416
assert_line " * domserver...........: /opt/domjudge/domserver"
417
417
assert_regex " ^ \* webserver group\.\.\.\.\.: (www-data|apache|nginx)$"
@@ -428,7 +428,7 @@ compile_assertions_finished () {
428
428
# Fails as libraries are not found
429
429
skip
430
430
fi
431
- setup
431
+ setup_helper
432
432
run run_configure --disable-domserver-build
433
433
refute_line " * domserver...........: /opt/domjudge/domserver"
434
434
for group in www-data apache nginx; do
@@ -447,7 +447,7 @@ compile_assertions_finished () {
447
447
# Fails as libraries are not found
448
448
skip
449
449
fi
450
- setup
450
+ setup_helper
451
451
run run_configure --disable-judgehost-build
452
452
assert_line " * domserver...........: /opt/domjudge/domserver"
453
453
assert_regex " ^ \* webserver group\.\.\.\.\.: (www-data|apache|nginx)$"
0 commit comments