Skip to content

Commit f3a63be

Browse files
committed
Try to fix "runghc ./Setup test"
1 parent 825af30 commit f3a63be

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# NOTE: `cabal` will take care to build the local `alex` executable and place it into $PATH for us to pick up
2-
ALEX:=$(shell which alex)
1+
# NOTE: `cabal test` will take care to build the local `alex`
2+
# executable and place it into $PATH for us to pick up.
3+
#
4+
# If it doesn't look like the alex binary in $PATH comes from the
5+
# build tree, then we'll fall back to pointing to
6+
# ../dist/build/alex/alex to support running tests via "runghc
7+
# Setup.hs test".
8+
#
9+
ALEX=$(shell which alex)
10+
ifeq "$(filter $(dir $(shell pwd))%,$(ALEX))" ""
11+
ALEX=../dist/build/alex/alex
12+
endif
13+
314
# NOTE: This assumes that a working `ghc` is on $PATH; this may not necessarily be the same GHC used by `cabal` for building `alex`.
415
HC=ghc
516
HC_OPTS=-Wall -fno-warn-missing-signatures -fno-warn-unused-imports -fno-warn-tabs -Werror

0 commit comments

Comments
 (0)