From 1669ed09b313c3af315d98e21700e7a03fb05c8f Mon Sep 17 00:00:00 2001 From: Peter Lebbing Date: Sun, 26 Mar 2023 12:45:32 +0200 Subject: [PATCH] Temp --- .ci/gitlab/test.yml | 211 +++++++++++++++++----------------- .gitlab-ci.yml | 125 ++++++++++---------- tests/src/Test/Tasty/Clash.hs | 6 +- 3 files changed, 176 insertions(+), 166 deletions(-) diff --git a/.ci/gitlab/test.yml b/.ci/gitlab/test.yml index 6aa65d9629..edc97a4b93 100644 --- a/.ci/gitlab/test.yml +++ b/.ci/gitlab/test.yml @@ -68,108 +68,113 @@ build: # Tests run on shared runners: -cores:unittests: - extends: .test-nocache - script: - - ./dist-newstyle/build/*/*/clash-cores-*/t/unittests/build/unittests/unittests --hide-successes - -cosim:unittests: - extends: .test-nocache - script: - - ./dist-newstyle/build/*/*/clash-cosim-*/build/test/test - -prelude:unittests: - extends: .test-nocache - script: - - ./dist-newstyle/build/*/*/clash-prelude-*/t/unittests/build/unittests/unittests --hide-successes - -lib:doctests: - extends: .test-nocache - script: - - ./dist-newstyle/build/*/*/clash-lib-*/t/doctests/build/doctests/doctests -j${THREADS} - -lib:unittests: - extends: .test-nocache - script: - - ./dist-newstyle/build/*/*/clash-lib-*/t/unittests/build/unittests/unittests --hide-successes - -prelude:doctests: - extends: .test-nocache - script: - - .ci/retry-ghc-heisenbug/script -v ./dist-newstyle/build/*/*/clash-prelude-*/t/doctests/build/doctests/doctests -j${THREADS} - -# Tests run on local fast machines: - -# Normally, this job is small. But it is flaky on GHC 9.2; it sometimes fails -# and we don't know yet why. When it fails, it recompiles things it should have -# picked up from the 'build' issue and then it is a larger job, so we keep it on -# local runners for now. -build-clash-dev: - extends: .test-cache-local - script: - - .ci/build_clash_dev.sh - -suite:vhdl: - extends: .test-cache-local - script: - - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .VHDL --hide-successes --no-vivado - -suite:verilog: +#cores:unittests: +# extends: .test-nocache +# script: +# - ./dist-newstyle/build/*/*/clash-cores-*/t/unittests/build/unittests/unittests --hide-successes +# +#cosim:unittests: +# extends: .test-nocache +# script: +# - ./dist-newstyle/build/*/*/clash-cosim-*/build/test/test +# +#prelude:unittests: +# extends: .test-nocache +# script: +# - ./dist-newstyle/build/*/*/clash-prelude-*/t/unittests/build/unittests/unittests --hide-successes +# +#lib:doctests: +# extends: .test-nocache +# script: +# - ./dist-newstyle/build/*/*/clash-lib-*/t/doctests/build/doctests/doctests -j${THREADS} +# +#lib:unittests: +# extends: .test-nocache +# script: +# - ./dist-newstyle/build/*/*/clash-lib-*/t/unittests/build/unittests/unittests --hide-successes +# +#prelude:doctests: +# extends: .test-nocache +# script: +# - .ci/retry-ghc-heisenbug/script -v ./dist-newstyle/build/*/*/clash-prelude-*/t/doctests/build/doctests/doctests -j${THREADS} +# +## Tests run on local fast machines: +# +## Normally, this job is small. But it is flaky on GHC 9.2; it sometimes fails +## and we don't know yet why. When it fails, it recompiles things it should have +## picked up from the 'build' issue and then it is a larger job, so we keep it on +## local runners for now. +#build-clash-dev: +# extends: .test-cache-local +# script: +# - .ci/build_clash_dev.sh +# +#suite:vhdl: +# extends: .test-cache-local +# script: +# - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .VHDL --hide-successes --no-vivado + +suite:tests-lib: extends: .test-cache-local script: - - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .Verilog --hide-successes --no-vivado - -suite:systemverilog: - extends: .test-cache-local - script: - - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .SystemVerilog --hide-successes --no-modelsim --no-vivado - -# Vivado is quite slow, so we only run a subset of the tests on development branches -# with it. The full testsuite gets run with Vivado every night on 'master'. -suite:cores: - extends: .test-cache-local - script: - - source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh - - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p Cores --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys - tags: - - local - - vivado-2022.1-standard - -ffi:interface-tests: - extends: .test-cache-local - script: - - ./dist-newstyle/build/*/*/clash-ffi-*/x/ffi-interface-tests/build/ffi-interface-tests/ffi-interface-tests --smallcheck-max-count 2000 - -ffi:example: - extends: .test-cache-local - script: - - cabal build clash # ensure clash has been built (avoids some legacy cabal issue) - - cd clash-ffi/example && ./run-iverilog.sh - - -# Tests run on local fast machines with Vivado installed. We only run these at night -# to save resources - as Vivado is quite slow to execute. -.test-cache-local-nightly: - extends: .test-cache-local - rules: - - if: $CI_PIPELINE_SOURCE == "schedule" # When schedueled (at night) - - if: $CI_PIPELINE_SOURCE == "trigger" # When triggered (manual triggers) - - if: '$CI_COMMIT_TAG != null' # When tags are set (releases) - -suite:vivado:vhdl: - extends: .test-cache-local-nightly - script: - - source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh - - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .VHDL --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys - tags: - - local - - vivado-2022.1-standard - -suite:vivado:verilog: - extends: .test-cache-local-nightly - script: - - source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh - - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .Verilog --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys - tags: - - local - - vivado-2022.1-standard + - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p '/[clash-lib test]/' + +#suite:verilog: +# extends: .test-cache-local +# script: +# - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .Verilog --hide-successes --no-vivado +# +#suite:systemverilog: +# extends: .test-cache-local +# script: +# - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .SystemVerilog --hide-successes --no-modelsim --no-vivado +# +## Vivado is quite slow, so we only run a subset of the tests on development branches +## with it. The full testsuite gets run with Vivado every night on 'master'. +#suite:cores: +# extends: .test-cache-local +# script: +# - source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh +# - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p Cores --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys +# tags: +# - local +# - vivado-2022.1-standard +# +#ffi:interface-tests: +# extends: .test-cache-local +# script: +# - ./dist-newstyle/build/*/*/clash-ffi-*/x/ffi-interface-tests/build/ffi-interface-tests/ffi-interface-tests --smallcheck-max-count 2000 +# +#ffi:example: +# extends: .test-cache-local +# script: +# - cabal build clash # ensure clash has been built (avoids some legacy cabal issue) +# - cd clash-ffi/example && ./run-iverilog.sh +# +# +## Tests run on local fast machines with Vivado installed. We only run these at night +## to save resources - as Vivado is quite slow to execute. +#.test-cache-local-nightly: +# extends: .test-cache-local +# rules: +# - if: $CI_PIPELINE_SOURCE == "schedule" # When schedueled (at night) +# - if: $CI_PIPELINE_SOURCE == "trigger" # When triggered (manual triggers) +# - if: '$CI_COMMIT_TAG != null' # When tags are set (releases) +# +#suite:vivado:vhdl: +# extends: .test-cache-local-nightly +# script: +# - source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh +# - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .VHDL --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys +# tags: +# - local +# - vivado-2022.1-standard +# +#suite:vivado:verilog: +# extends: .test-cache-local-nightly +# script: +# - source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh +# - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .Verilog --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys +# tags: +# - local +# - vivado-2022.1-standard diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07c0db0f57..d6f327d661 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ default: include: - '/.ci/gitlab/common.yml' - - '/.ci/gitlab/publish.yml' +# - '/.ci/gitlab/publish.yml' # - '/.ci/gitlab/benchmark.yml' variables: @@ -32,67 +32,68 @@ tests: strategy: depend parallel: matrix: - - GHC_VERSION: [8.8.4, 8.10.7, 9.0.2, 9.2.5] - - GHC_VERSION: 8.6.5 - MULTIPLE_HIDDEN: "no" - -stack-build: - extends: .common-local - needs: [] - stage: test - variables: - GHC_VERSION: 8.10.7 - script: - - .ci/stack_build.sh - -nix-build: - image: nixos/nix:2.10.1 - needs: [] - stage: test - before_script: - - nix-env -i gawk - script: - - nix-build -j$(./.ci/effective_cpus.sh) - tags: - - local - -haddock: - extends: .common-local - needs: [] - stage: test - variables: - GHC_VERSION: 9.0.2 - artifacts: - paths: - - hadocs/*/* - expire_in: 1 month - script: - - .ci/build_docs.sh - -# # Run benchmarks for isclashfastyet.com -# benchmark-8.10.2: -# extends: .benchmark - -# "Publish" a release candidate -hackage-release-candidate: - extends: .hackage - - variables: - HACKAGE_RELEASE: "no" - - rules: - - if: $CI_PIPELINE_SOURCE == "schedule" - - if: $CI_PIPELINE_SOURCE == "trigger" - -# Release new version of Clash to Hackage -hackage-release: - extends: .hackage - - variables: - HACKAGE_RELEASE: "yes" - - rules: - - if: '$CI_COMMIT_TAG != null' # tags + - GHC_VERSION: 9.0.2 + #- GHC_VERSION: [8.8.4, 8.10.7, 9.0.2, 9.2.5] + #- GHC_VERSION: 8.6.5 + # MULTIPLE_HIDDEN: "no" + +#stack-build: +# extends: .common-local +# needs: [] +# stage: test +# variables: +# GHC_VERSION: 8.10.7 +# script: +# - .ci/stack_build.sh +# +#nix-build: +# image: nixos/nix:2.10.1 +# needs: [] +# stage: test +# before_script: +# - nix-env -i gawk +# script: +# - nix-build -j$(./.ci/effective_cpus.sh) +# tags: +# - local +# +#haddock: +# extends: .common-local +# needs: [] +# stage: test +# variables: +# GHC_VERSION: 9.0.2 +# artifacts: +# paths: +# - hadocs/*/* +# expire_in: 1 month +# script: +# - .ci/build_docs.sh +# +## # Run benchmarks for isclashfastyet.com +## benchmark-8.10.2: +## extends: .benchmark +# +## "Publish" a release candidate +#hackage-release-candidate: +# extends: .hackage +# +# variables: +# HACKAGE_RELEASE: "no" +# +# rules: +# - if: $CI_PIPELINE_SOURCE == "schedule" +# - if: $CI_PIPELINE_SOURCE == "trigger" +# +## Release new version of Clash to Hackage +#hackage-release: +# extends: .hackage +# +# variables: +# HACKAGE_RELEASE: "yes" +# +# rules: +# - if: '$CI_COMMIT_TAG != null' # tags # Work around https://gitlab.com/gitlab-org/gitlab/-/issues/216629 # diff --git a/tests/src/Test/Tasty/Clash.hs b/tests/src/Test/Tasty/Clash.hs index a937744338..20fb57c22a 100644 --- a/tests/src/Test/Tasty/Clash.hs +++ b/tests/src/Test/Tasty/Clash.hs @@ -298,6 +298,7 @@ instance IsTest ClashBinaryTest where buildArgs oDir = [ "-package", "clash-testsuite" + , "-rtsopts" , "-main-is", cbModName <> ".main" <> show cbBuildTarget , "-o", oDir "out" , "-i" <> cbSourceDirectory @@ -307,7 +308,10 @@ instance IsTest ClashBinaryTest where ] execProgram oDir = - TestHeisenbugProgram (oDir "out") (oDir:cbExtraExecArgs) NoGlob PrintStdErr False Nothing [] + TestHeisenbugProgram (oDir "out") + ( [ "+RTS", "-xm20000000", "-RTS" ] + <> (oDir:cbExtraExecArgs)) + NoGlob PrintStdErr False Nothing [] testOptions = coerce (testOptions @TestProgram)