Skip to content
Snippets Groups Projects
Commit 830be013 authored by Ben Gamari's avatar Ben Gamari
Browse files

gitlab-ci: Introduce ONLY_TESTS variable

When using ci.sh manually it is often useful to run just a subset of
tests.
parent 69bfbc21
No related merge requests found
Pipeline #27756 failed
......@@ -45,6 +45,7 @@ Environment variables affecting both build systems:
VERBOSE Set to non-empty for verbose build output
MSYSTEM (Windows-only) Which platform to build form (MINGW64 or MINGW32).
ONLY_TESTS Select a subset of tests to run
Environment variables determining build configuration of Make system:
......@@ -430,10 +431,15 @@ function determine_metric_baseline() {
}
function test_make() {
local tests=""
if [[ -n "$ONLY_TESTS" ]]; then
tests="TEST=$ONLY_TESTS"
fi
run "$MAKE" test_bindist TEST_PREP=YES
run "$MAKE" V=0 test \
THREADS="$cores" \
JUNIT_FILE=../../junit.xml
JUNIT_FILE=../../junit.xml \
"$tests"
}
function build_hadrian() {
......@@ -450,6 +456,11 @@ function build_hadrian() {
}
function test_hadrian() {
local tests=""
if [[ -n "$ONLY_TESTS" ]]; then
tests="--only=$ONLY_TESTS"
fi
cd _build/bindist/ghc-*/
run ./configure --prefix="$TOP"/_build/install
run "$MAKE" install
......@@ -458,7 +469,8 @@ function test_hadrian() {
run_hadrian \
test \
--summary-junit=./junit.xml \
--test-compiler="$TOP"/_build/install/bin/ghc
--test-compiler="$TOP"/_build/install/bin/ghc \
"$tests"
}
function cabal_test() {
......@@ -498,13 +510,15 @@ function clean() {
function run_hadrian() {
if [ -z "$BIGNUM_BACKEND" ]; then BIGNUM_BACKEND="gmp"; fi
if [ -n "$VERBOSE" ]; then HADRIAN_ARGS="$HADRIAN_ARGS -V"; fi
run hadrian/build-cabal \
--flavour="$BUILD_FLAVOUR" \
-j"$cores" \
--broken-test="$BROKEN_TESTS" \
--bignum=$BIGNUM_BACKEND \
$HADRIAN_ARGS \
$@
local args=(
"--flavour=$BUILD_FLAVOUR"
"-j$cores"
"--broken-test=$BROKEN_TESTS"
"--bignum=$BIGNUM_BACKEND"
"${HADRIAN_ARGS[@]}"
"$@"
)
run hadrian/build-cabal "${args[@]}"
}
# A convenience function to allow debugging in the CI environment.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment