summaryrefslogtreecommitdiff
path: root/.gitlab
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-08-06 20:33:17 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-25 21:10:56 -0400
commit5b78e8658c3f5042967cbe9d30a5a630946c4fd7 (patch)
treedc30be11cb6f2f0ff30464932f77ec8d5f04a235 /.gitlab
parentdd6640316865d84075b00013b8b97076705e5c44 (diff)
downloadhaskell-5b78e8658c3f5042967cbe9d30a5a630946c4fd7.tar.gz
ci: Add ad-hoc performance testing rule
Diffstat (limited to '.gitlab')
-rwxr-xr-x.gitlab/ci.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh
index c28755ecb8..00471115e4 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -395,6 +395,34 @@ function test_hadrian() {
--test-compiler="$TOP"/_build/install/bin/ghc
}
+function cabal_test() {
+ if [ -z "$OUT" ]; then
+ fail "OUT not set"
+ fi
+
+ start_section "Cabal test: $OUT"
+ mkdir -p "$OUT"
+ run "$HC" \
+ -hidir tmp -odir tmp -fforce-recomp \
+ -ddump-to-file -dumpdir "$OUT/dumps" -ddump-timings \
+ +RTS --machine-readable "-t$OUT/rts.log" -RTS \
+ -package mtl -ilibraries/Cabal/Cabal libraries/Cabal/Cabal/Setup.hs \
+ $@
+ rm -Rf tmp
+ end_section "Cabal test: $OUT"
+}
+
+function run_perf_test() {
+ if [ -z "$HC" ]; then
+ fail "HC not set"
+ fi
+
+ mkdir -p out
+ OUT=out/Cabal-O0 cabal_test -O0
+ OUT=out/Cabal-O1 cabal_test -O1
+ OUT=out/Cabal-O2 cabal_test -O2
+}
+
function clean() {
rm -R tmp
run "$MAKE" --quiet clean || true
@@ -465,6 +493,7 @@ case $1 in
push_perf_notes
exit $res ;;
run_hadrian) run_hadrian $@ ;;
+ perf_test) run_perf_test ;;
clean) clean ;;
shell) shell $@ ;;
*) fail "unknown mode $1" ;;