Skip to content

Commit

Permalink
chore(cabal): clean up cabal.project (#1210)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhess authored Feb 7, 2024
2 parents 2e790b4 + 7a6b821 commit 3b6d2b9
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $(targets):
wasm32-update:
wasm32-wasi-cabal update

wasm32 = wasm32-build wasm32-build-opt wasm32-configure wasm32-check wasm32-test wasm32-test-opt wasm32-clean
wasm32 = discover-wasm32-tests wasm32-build wasm32-build-opt wasm32-configure wasm32-check wasm32-test wasm32-test-opt wasm32-clean

$(wasm32):
$(MAKE) -C primer $@
Expand Down
15 changes: 14 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
index-state: 2024-02-06T00:00:00Z

jobs: $ncpus

packages:
primer
primer-api
Expand All @@ -13,11 +15,22 @@ if arch(wasm32)
else
optimization: 0

benchmarks: True

tests: True

if !arch(wasm32)
documentation: True
haddock-hoogle: True
haddock-html: True
haddock-quickjump: True
haddock-hyperlink-source: True
haddock-internal: True

allow-newer: hedgehog-classes:hedgehog,hedgehog-classes:pretty-show,hedgehog:pretty-show

package *
ghc-options: -fwrite-ide-info
benchmarks: True

package primer
test-options: "--size-cutoff=32768"
Expand Down
6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,12 @@
# time, because we can't do it via `wasmtime`.
(pkgs.haskell-nix.tool ghcVersion "tasty-discover" { })
];

# The wasm32 compile target can't discover its own Tasty
# tests.
shellHook = ''
make discover-wasm32-tests
'';
};
};

Expand Down
9 changes: 5 additions & 4 deletions primer-api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ wasm32-check: wasm32-test
test:
cabal test

wasm32-test:
discover-wasm32-tests:
tasty-discover test/Test.hs _ test/TestsWasm32.hs --tree-display

wasm32-test: wasm32-build discover-wasm32-tests
wasm32-wasi-cabal build test:primer-api-test
wasmtime --dir test::test "$(wasm32-primer-api-test)"

wasm32-test-opt: wasm32-build-opt
tasty-discover test/Test.hs _ test/TestsWasm32.hs --tree-display
wasm32-test-opt: wasm32-build-opt discover-wasm32-tests
wasm32-wasi-cabal build -O2 test:primer-api-test
wasmtime --dir test::test "$(wasm32-primer-api-test-opt)"

Expand All @@ -53,4 +54,4 @@ realclean:

deps:

.PHONY: build bench configure test docs clean realclean deps
.PHONY: build bench configure test docs clean realclean deps discover-wasm32-tests
7 changes: 4 additions & 3 deletions primer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ wasm32-check: wasm32-test
test:
cabal test

wasm32-test:
discover-wasm32-tests:
tasty-discover test/Test.hs _ test/TestsWasm32.hs --tree-display

wasm32-test: wasm32-build discover-wasm32-tests
wasm32-wasi-cabal build test:primer-test
wasmtime --dir test::test "$(wasm32-primer-test)"

wasm32-test-opt: wasm32-build-opt
tasty-discover test/Test.hs _ test/TestsWasm32.hs --tree-display
wasm32-test-opt: wasm32-build-opt discover-wasm32-tests
wasm32-wasi-cabal build -O2 test:primer-test
wasmtime --dir test::test "$(wasm32-primer-test-opt)"

Expand Down

0 comments on commit 3b6d2b9

Please sign in to comment.