Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cabal): clean up cabal.project #1210

Merged
merged 5 commits into from
Feb 7, 2024
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
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
Loading