File: testscript

package info (click to toggle)
ghc 9.6.6-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 158,216 kB
  • sloc: haskell: 648,228; ansic: 81,656; cpp: 11,808; javascript: 8,444; sh: 5,831; fortran: 3,527; python: 3,277; asm: 2,523; makefile: 2,298; yacc: 1,570; lisp: 532; xml: 196; perl: 145; csh: 2
file content (70 lines) | stat: -rwxr-xr-x 1,711 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
set -eux

ghcflags="-rtsopts -threaded -Werror -Wwarn=deprecations ${GHC_FLAGS-}"
testflags="CreateDirectoryIfMissing001.num-repeats=100000 +RTS -N2"
stack="stack --no-terminal ${STACK_FLAGS-}"

# overridable hook
before_prepare() {
    :
}

prepare() {
    before_prepare
    if [ -f configure.ac ]; then
        autoreconf -i
    fi
    if [ "${STACK_RESOLVER-}" ]; then

        cat >stack.yaml <<EOF
resolver: $STACK_RESOLVER
packages: [.]
extra-deps: [${STACK_EXTRA_DEPS-}]
flags: ${STACK_PACKAGE_FLAGS-}
EOF
        $stack ghc -- --version
        $stack --version
        $stack ls dependencies

    else

        cat >cabal.project <<EOF
packages: *.cabal
package directory
  ghc-options: $ghcflags
  flags: ${CABAL_PACKAGE_FLAGS-}
EOF
        ghc --version
        cabal --version
        tools/retry cabal update
        cabal v2-configure -v2 --enable-tests
        cabal v2-freeze
        cat cabal.project.freeze

    fi
}

build() {
    if [ "${STACK_RESOLVER-}" ]; then
        $stack test --haddock --no-haddock-deps --keep-going \
            --ghc-options "$ghcflags" \
            --test-arguments "$testflags"
        $stack sdist
    else
        testflags=`printf " %s" "$testflags" | sed "s/ / --test-option=/g"`
        cabal v2-test --keep-going --test-show-details=streaming $testflags
        cabal check
        cabal v2-sdist
        cabal v1-install --force-reinstalls --run-tests dist-newstyle/sdist/*-*.tar.gz
    fi

    version=`sed -n 's/^version:[[:space:]]*//p' directory.cabal`
    grep -q "## $version (" changelog.md || {
        echo >&2 "Error: Please describe version $version in changelog.md."
        return 1
    }
}

eval "${TESTSCRIPT_OVERRIDES-}"
"$@"