summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-04-13 17:36:30 +0100
committerBen Gamari <ben@smart-cactus.org>2022-05-18 11:16:59 -0400
commit0283a09b785e034af491847575d104f948e05846 (patch)
treef495e216308959a652cfa8270ea43b520d317ca8
parent1b15e4e8a7f80511cbd1b1f1c7699604aa5e1bf4 (diff)
downloadhaskell-0283a09b785e034af491847575d104f948e05846.tar.gz
ci: Add test to check that release jobs have profiled libs
(cherry picked from commit 2c00d9048873f3d6d7e188dd1ef7f670a83a5c94)
-rwxr-xr-x.gitlab/ci.sh9
-rw-r--r--bindisttest/Makefile6
2 files changed, 14 insertions, 1 deletions
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh
index 6eab87a99a..a807e362e2 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -492,7 +492,7 @@ function test_make() {
check_release_build
- run "$MAKE" test_bindist TEST_PREP=YES
+ run "$MAKE" test_bindist TEST_PREP=YES TEST_PROF=${RELEASE_JOB:-}
(unset $(compgen -v | grep CI_*);
run "$MAKE" V=0 VERBOSE=1 test \
THREADS="$cores" \
@@ -588,6 +588,13 @@ function test_hadrian() {
fail "Test compiler has a different BIGNUM_BACKEND ($test_compiler_backend) thean requested ($BIGNUM_BACKEND)"
fi
+ # If we are doing a release job, check the compiler can build a profiled executable
+ if [ "${RELEASE_JOB:-}" == "yes" ]; then
+ echo "main = print ()" > proftest.hs
+ run ${test_compiler} -prof proftest.hs || fail "hadrian profiled libs test"
+ rm proftest.hs
+ fi
+
run_hadrian \
test \
--summary-junit=./junit.xml \
diff --git a/bindisttest/Makefile b/bindisttest/Makefile
index e49172c77d..3df55a9167 100644
--- a/bindisttest/Makefile
+++ b/bindisttest/Makefile
@@ -50,6 +50,12 @@ endif
$(CONTEXT_DIFF) output expected_output
# Without --no-user-package-db we might pick up random packages from ~/.ghc
$(BIN_DIST_INST_DIR)/bin/ghc-pkg check --no-user-package-db
+ifeq "$(TEST_PROF)" "yes"
+ $(BIN_DIST_INST_DIR)/bin/ghc --make -prof HelloWorld
+ ./HelloWorld > output
+ $(CONTEXT_DIFF) output expected_output
+endif
+
clean distclean:
"$(RM)" $(RM_OPTS_REC) $(BIN_DIST_INST_SUBDIR)