Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2c1f7ca
add gitignore
chris-martin Feb 16, 2019
3b79c7c
add cabal project file
chris-martin Feb 16, 2019
7905740
add stack.yaml
chris-martin Feb 16, 2019
a37f10d
Fix compatibility with QuickCheck 2.12
felixonmars Jan 20, 2019
957ec63
Migrade to patience 0.2 (#1)
felixonmars Dec 4, 2018
81c0fb3
raise ansi-terminal upper bound
chris-martin Feb 16, 2019
772031d
upgrade HUnit
chris-martin Feb 16, 2019
54b3f07
remove trailing spaces
chris-martin Feb 16, 2019
35ae86d
replace tabs with 2 spaces in import lists
chris-martin Feb 16, 2019
b7b8b80
reformat type definitions
chris-martin Feb 16, 2019
5ab3741
reformat class definitions
chris-martin Feb 16, 2019
5c4b198
reformat instances
chris-martin Feb 16, 2019
6e659c0
reformat Test.Chell.Main
chris-martin Feb 17, 2019
44c25e8
reformat Test.Chell.Output
chris-martin Feb 17, 2019
5737d5a
reformat Test.Chell.Types
chris-martin Feb 17, 2019
c7698c0
reformat Test.Chell
chris-martin Feb 17, 2019
df46b2c
reformat Test.Chell.HUnit
chris-martin Feb 17, 2019
040b271
reformat Test.Chell.QuickCheck
chris-martin Feb 17, 2019
9eecb50
add cabal descriptions
chris-martin Feb 17, 2019
4bdf017
generate Travis CI config
chris-martin Feb 16, 2019
dffe389
create readme
chris-martin Feb 17, 2019
7c91e5e
update maintainer, homepage, and bug-reports
chris-martin Feb 17, 2019
335849c
readme: fix example code
chris-martin Feb 17, 2019
1b35d03
readme: update history
chris-martin Feb 17, 2019
72292c3
add "category: Testing"
chris-martin Feb 17, 2019
06b7f56
update source-repository
chris-martin Feb 17, 2019
6553753
add changelogs and bump versions
chris-martin Feb 17, 2019
d2d1545
chell.cabal: allow newer patience
vaibhavsagar Aug 29, 2019
22ad814
Merge pull request #1 from vaibhavsagar/bump-patience
argumatronic Aug 31, 2019
6cacf60
Fix version bounds and enable github actions CI
chris-martin Jan 14, 2022
b54e535
bump versions
chris-martin Jan 14, 2022
5fbc050
add default-language
chris-martin Jan 14, 2022
e48eb91
miscellaneous updates and cleanup
chris-martin Jul 11, 2023
73d53a1
Support GHC 9.8
Vekhir Jan 31, 2024
6d48ddf
Allow base < 4.22, Haskell-CI for GHC 9.2 - 9.12.0
andreasabel Nov 13, 2024
9ffcae7
Allow ansi-terminal-1.1
andreasabel Nov 13, 2024
5e26ea8
Support GHC 9.12.1
andreasabel Jan 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
use flake

watch_file **/*.cabal cabal.project.freeze **/*.nix flake.lock
238 changes: 238 additions & 0 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' 'cabal.project'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.19.20241223
#
# REGENDATA ("0.19.20241223",["github","cabal.project"])
#
name: Haskell-CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-20.04
timeout-minutes:
60
container:
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.12.1
compilerKind: ghc
compilerVersion: 9.12.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.8.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.6
compilerKind: ghc
compilerVersion: 9.6.6
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.4.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.8
compilerKind: ghc
compilerVersion: 9.2.8
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- name: apt-get install
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
- name: Install GHCup
run: |
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Set PATH and environment variables
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: env
run: |
env
- name: write cabal config
run: |
mkdir -p $CABAL_DIR
cat >> $CABAL_CONFIG <<EOF
remote-build-reporting: anonymous
write-ghc-environment-files: never
remote-repo-cache: $CABAL_DIR/packages
logs-dir: $CABAL_DIR/logs
world-file: $CABAL_DIR/world
extra-prog-path: $CABAL_DIR/bin
symlink-bindir: $CABAL_DIR/bin
installdir: $CABAL_DIR/bin
build-summary: $CABAL_DIR/logs/build.log
store-dir: $CABAL_DIR/store
install-dirs user
prefix: $CABAL_DIR
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
EOF
cat $CABAL_CONFIG
- name: versions
run: |
$HC --version || true
$HC --print-project-git-commit-id || true
$CABAL --version || true
- name: update cabal index
run: |
$CABAL v2-update -v
- name: install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v4
with:
path: source
- name: initial cabal.project for sdist
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/chell" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/chell-hunit" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/chell-quickcheck" >> cabal.project
cat cabal.project
- name: sdist
run: |
mkdir -p sdist
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
- name: unpack
run: |
mkdir -p unpacked
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
- name: generate cabal.project
run: |
PKGDIR_chell="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/chell-[0-9.]*')"
echo "PKGDIR_chell=${PKGDIR_chell}" >> "$GITHUB_ENV"
PKGDIR_chell_hunit="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/chell-hunit-[0-9.]*')"
echo "PKGDIR_chell_hunit=${PKGDIR_chell_hunit}" >> "$GITHUB_ENV"
PKGDIR_chell_quickcheck="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/chell-quickcheck-[0-9.]*')"
echo "PKGDIR_chell_quickcheck=${PKGDIR_chell_quickcheck}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_chell}" >> cabal.project
echo "packages: ${PKGDIR_chell_hunit}" >> cabal.project
echo "packages: ${PKGDIR_chell_quickcheck}" >> cabal.project
echo "package chell" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package chell-hunit" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package chell-quickcheck" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(chell|chell-hunit|chell-quickcheck)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: restore cache
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
- name: install dependencies
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
- name: build w/o tests
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: build
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
- name: cabal check
run: |
cd ${PKGDIR_chell} || false
${CABAL} -vnormal check
cd ${PKGDIR_chell_hunit} || false
${CABAL} -vnormal check
cd ${PKGDIR_chell_quickcheck} || false
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: unconstrained build
run: |
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist
dist-*
.ghc.*
result
result-*
.stack-work/
stack*.yaml.lock
1 change: 1 addition & 0 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
branches: master
3 changes: 3 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packages: chell, chell-hunit, chell-quickcheck

flags: +color-output
2 changes: 0 additions & 2 deletions chell-hunit/Setup.hs

This file was deleted.

37 changes: 20 additions & 17 deletions chell-hunit/Test/Chell/HUnit.hs
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
module Test.Chell.HUnit
( hunit
) where
module Test.Chell.HUnit (hunit) where

import qualified Test.Chell as Chell
import Test.HUnit.Lang (Assertion, performTestCase)
import Test.HUnit.Lang (Assertion, Result (..), performTestCase)

-- | Convert a sequence of HUnit assertions (embedded in IO) to a Chell
-- 'Chell.Test'.
--
-- @
--import Test.Chell
--import Test.Chell.HUnit
--import Test.HUnit
-- import Test.Chell
-- import Test.Chell.HUnit
-- import Test.HUnit
--
--test_Addition :: Test
--test_addition = hunit \"addition\" $ do
-- test_Addition :: Test
-- test_addition = hunit \"addition\" $ do
-- 1 + 2 \@?= 3
-- 2 + 3 \@?= 5
-- @
hunit :: String -> Assertion -> Chell.Test
hunit name io = Chell.test name chell_io where
chell_io _ = do
result <- performTestCase io
return $ case result of
Nothing -> Chell.TestPassed []
Just err -> parseError err
parseError (True, msg) = Chell.TestFailed [] [Chell.failure { Chell.failureMessage = msg }]
parseError (False, msg) = Chell.TestAborted [] msg
hunit name io = Chell.test name chell_io
where
chell_io _ =
do
result <- performTestCase io
return $
case result of
Success -> Chell.TestPassed []
Failure _ msg ->
Chell.TestFailed
[]
[Chell.failure {Chell.failureMessage = msg}]
Error _ msg -> Chell.TestAborted [] msg
33 changes: 33 additions & 0 deletions chell-hunit/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## 0.3.0.2

Miscellaneous updates and cleanup

Published by: Chris Martin

Date: 2023-07-11

## 0.3.0.1

Support up to GHC 9.2

Tighten various version bounds

Published by: Chris Martin

Date: 2021-01-14

## 0.3

Add support for `HUnit` 1.3 through 1.6

Drop support for `HUnit` 1.1 through 1.2

Published by: Chris Martin

Date: 2019-02-16

## 0.2.1

Published by: John Millikin

Date: 2014-05-18
Loading