Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 14 additions & 11 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
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=--disable-benchmarks" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
env:
Expand Down Expand Up @@ -192,6 +192,7 @@ jobs:
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/splitmix-tests" >> cabal.project
cat cabal.project
- name: sdist
run: |
Expand All @@ -205,19 +206,28 @@ jobs:
run: |
PKGDIR_splitmix="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/splitmix-[0-9.]*')"
echo "PKGDIR_splitmix=${PKGDIR_splitmix}" >> "$GITHUB_ENV"
PKGDIR_splitmix_tests="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/splitmix-tests-[0-9.]*')"
echo "PKGDIR_splitmix_tests=${PKGDIR_splitmix_tests}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_splitmix}" >> cabal.project
echo "packages: ${PKGDIR_splitmix_tests}" >> cabal.project
echo "package splitmix" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
echo "package splitmix-tests" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package splitmix" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package splitmix-tests" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package splitmix" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package splitmix-tests" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(splitmix)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(splitmix|splitmix-tests)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
Expand All @@ -230,10 +240,6 @@ jobs:
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
Expand All @@ -251,6 +257,8 @@ jobs:
run: |
cd ${PKGDIR_splitmix} || false
${CABAL} -vnormal check
cd ${PKGDIR_splitmix_tests} || false
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
Expand All @@ -265,34 +273,29 @@ jobs:
run: |
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all --dry-run
cabal-plan topo | sort
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all
$CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.12' all
- name: constraint set bytestring-0.11
run: |
if [ $((HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.11' all --dry-run ; fi
if [ $((HCNUMVER < 90800)) -ne 0 ] ; then cabal-plan topo | sort ; fi
if [ $((HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.11' --dependencies-only -j2 all ; fi
if [ $((HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.11' all ; fi
if [ $((HCNUMVER < 90800)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='bytestring ^>=0.11' all ; fi
- name: constraint set time-1.12
run: |
if [ $((HCNUMVER >= 80800 && HCNUMVER < 91200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='time ^>=1.12' all --dry-run ; fi
if [ $((HCNUMVER >= 80800 && HCNUMVER < 91200)) -ne 0 ] ; then cabal-plan topo | sort ; fi
if [ $((HCNUMVER >= 80800 && HCNUMVER < 91200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='time ^>=1.12' --dependencies-only -j2 all ; fi
if [ $((HCNUMVER >= 80800 && HCNUMVER < 91200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='time ^>=1.12' all ; fi
if [ $((HCNUMVER >= 80800 && HCNUMVER < 91200)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='time ^>=1.12' all ; fi
- name: constraint set time-1.11
run: |
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.11' all --dry-run ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cabal-plan topo | sort ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.11' --dependencies-only -j2 all ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.11' all ; fi
- name: constraint set time-1.10
run: |
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.10' all --dry-run ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then cabal-plan topo | sort ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.10' --dependencies-only -j2 all ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='time ^>=1.10' all ; fi
- name: save cache
if: always()
Expand Down
2 changes: 1 addition & 1 deletion cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
branches: master
docspec: True
benchmarks: False
install-dependencies: False
apt: hugs libhugs-time-bundled libtestu01-0-dev
head-hackage: False

Expand Down
2 changes: 2 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
packages: .
packages: splitmix-tests

tests: True
benchmarks: True
30 changes: 30 additions & 0 deletions splitmix-tests/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Copyright (c) 2017, Oleg Grenrus

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

* Neither the name of Oleg Grenrus nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
File renamed without changes.
1 change: 0 additions & 1 deletion bench/Range.hs → splitmix-tests/bench/Range.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
module Main where

import Data.Bits
import Data.Bits.Compat
import Data.List (unfoldr)
import Data.Word (Word32, Word64)

Expand Down
File renamed without changes.
152 changes: 152 additions & 0 deletions splitmix-tests/splitmix-tests.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
cabal-version: 2.4
name: splitmix-tests
version: 0
synopsis: Fast Splittable PRNG
description:
Pure Haskell implementation of SplitMix described in ...
more tests

license: BSD-3-Clause
license-file: LICENSE
maintainer: Oleg Grenrus <oleg.grenrus@iki.fi>
bug-reports: https://github.com/haskellari/splitmix/issues
category: System, Random
build-type: Simple
tested-with:
GHC ==8.6.5
|| ==8.8.4
|| ==8.10.4
|| ==9.0.2
|| ==9.2.8
|| ==9.4.8
|| ==9.6.7
|| ==9.8.4
|| ==9.10.2
|| ==9.12.2

library
default-language: Haskell2010
hs-source-dirs: src
exposed-modules: Dummy
build-depends: base <5

source-repository head
type: git
location: https://github.com/haskellari/splitmix.git

benchmark comparison
type: exitcode-stdio-1.0
default-language: Haskell2010
ghc-options: -Wall
hs-source-dirs: bench
main-is: Bench.hs
build-depends:
, base <5
, containers >=0.6.0.1 && <0.8
, criterion >=1.6.0.0 && <1.7
, random
, splitmix
, tf-random >=0.5 && <0.6

benchmark simple-sum
type: exitcode-stdio-1.0
default-language: Haskell2010
ghc-options: -Wall
hs-source-dirs: bench
main-is: SimpleSum.hs
build-depends:
, base <5
, random
, splitmix

benchmark range
type: exitcode-stdio-1.0
default-language: Haskell2010
ghc-options: -Wall
hs-source-dirs: bench
main-is: Range.hs
build-depends:
, base <5
, clock >=0.8.4 && <0.9
, splitmix

test-suite splitmix-tests
type: exitcode-stdio-1.0
default-language: Haskell2010
ghc-options: -Wall
hs-source-dirs: tests
main-is: splitmix-tests.hs
other-modules:
MiniQC
Uniformity

build-depends:
, base <5
, containers >=0.4.0.0 && <0.8
, HUnit >=1.6.0.0 && <1.7
, math-functions >=0.3.3.0 && <0.4
, splitmix
, test-framework >=0.8.2.0 && <0.9
, test-framework-hunit >=0.3.0.2 && <0.4

test-suite montecarlo-pi
type: exitcode-stdio-1.0
default-language: Haskell2010
ghc-options: -Wall
hs-source-dirs: tests
main-is: SplitMixPi.hs
build-depends:
, base <5
, splitmix

test-suite montecarlo-pi-32
type: exitcode-stdio-1.0
default-language: Haskell2010
ghc-options: -Wall
hs-source-dirs: tests
main-is: SplitMixPi32.hs
build-depends:
, base <5
, splitmix

test-suite splitmix-dieharder
default-language: Haskell2010
type: exitcode-stdio-1.0
ghc-options: -Wall -threaded -rtsopts
hs-source-dirs: tests
main-is: Dieharder.hs
build-depends:
, async >=2.2.1 && <2.3
, base <5
, bytestring >=0.10.8.2 && <0.13
, deepseq
, process >=1.6.0.0 && <1.7
, splitmix
, tf-random >=0.5 && <0.6
, vector >=0.13.2.0 && <0.14

test-suite splitmix-testu01
if !os(linux)
buildable: False

default-language: Haskell2010
type: exitcode-stdio-1.0
ghc-options: -Wall -threaded -rtsopts
hs-source-dirs: tests
main-is: TestU01.hs
c-sources: tests/cbits/testu01.c
extra-libraries: testu01
build-depends:
, base <5
, splitmix

test-suite initialization
default-language: Haskell2010
type: exitcode-stdio-1.0
ghc-options: -Wall -threaded -rtsopts
hs-source-dirs: tests
main-is: Initialization.hs
build-depends:
, base <5
, HUnit >=1.6.0.0 && <1.7
, splitmix
1 change: 1 addition & 0 deletions splitmix-tests/src/Dummy.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module Dummy () where
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions tests/TestU01.hs → splitmix-tests/tests/TestU01.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
{-# LANGUAGE ScopedTypeVariables #-}
module Main (main) where

import Prelude ()
import Prelude.Compat

import Data.Char (isSpace)
import Data.IORef (IORef, newIORef, readIORef, writeIORef)
import Data.Maybe (fromMaybe)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading