Skip to content
Snippets Groups Projects
Verified Commit fb23c9ec authored by Bryan R's avatar Bryan R
Browse files

Add BUILD_MODE argument

This expands the number of modes from two to four, allowing one to
separate running the build from running tests.

This change is backwards-compatible. No existing behavior is changed.
parent a7a158bf
No related branches found
No related tags found
1 merge request!248Separate job for tests
......@@ -115,20 +115,53 @@ extra_package pandoc
build_tool_package alex
build_tool_package happy
# Quick build configuration
# =========================
# $BUILD_MODE controls how head.hackage runs.
# ===========================================
#
# If $QUICK is defined we build the "quick" configuration, which builds a small
# subset of the overall package set. We do this during the merge request
# validation pipeline.
# Four build modes exist: FULL, QUICK, TEST, and COMPAT.
#
# FULL.
# ------
# Build all patched + extra packages.
#
# QUICK.
# ------
# Build the "quick" configuration, which builds a small subset of the overall
# package set. We do this during the merge request validation pipeline. Note: If
# "$QUICK" is non-null, it is used as a backwards-compat synonym for
# BUILD_MODE=QUICK.
#
# TEST.
# -----
# Just build the local test packages and run the tests.
#
# COMPAT: FULL + TEST.
# --------------------
# Backwards-compat default build mode.
#
: ${BUILD_MODE:=COMPAT}
if [ -n "$QUICK" ]; then
only_package Cabal
only_package microlens
only_package free
only_package optparse-applicative
BUILD_MODE=QUICK
fi
# Testing specific local packages
test_package system-test "$(pwd)/../tests/ghc-debug/test/"
test_package ghc-tests "$(pwd)/../tests/ghc-tests"
case "$BUILD_MODE" in
FULL) ;;
QUICK)
only_package tasty
only_package Cabal
only_package microlens
only_package free
only_package optparse-applicative
;;
TEST)
# FIXME: I specify a single "only_package" to prevent all the other
# packages from being built. Morally, I really want to say "build
# nothing at all besides the tests".
only_package tasty
test_package system-test "$(pwd)/../tests/ghc-debug/test/"
test_package ghc-tests "$(pwd)/../tests/ghc-tests"
;;
COMPAT)
test_package system-test "$(pwd)/../tests/ghc-debug/test/"
test_package ghc-tests "$(pwd)/../tests/ghc-tests"
;;
esac
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