Skip to content

Commit fe9f530

Browse files
committed
Add testing for --debug lexer
1 parent b82bdd1 commit fe9f530

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
/examples/*.bin
1515
/examples/*.exe
1616
/old-*/
17-
/tests/*.[gn].hs
18-
/tests/*.[gn].bin
19-
/tests/*.[gn].exe
17+
/tests/*.[dgn].hs
18+
/tests/*.[dgn].bin
19+
/tests/*.[dgn].exe
2020
.cabal-sandbox
2121
.stack-work
2222
cabal.sandbox.config

tests/Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,12 @@ TEST_ALEX_OPTS=
102102
%.g.hs : %.x
103103
$(ALEX) $(TEST_ALEX_OPTS) -g $< -o $@
104104

105-
CLEAN_FILES += *.n.hs *.g.hs *.info *.hi *.o *.bin *.exe
105+
%.d.hs : %.x
106+
$(ALEX) $(TEST_ALEX_OPTS) --debug $< -o $@
106107

107-
ALL_TEST_HS = $(shell echo $(TESTS) $(TEXT_TESTS) | sed -e 's/\([^\. ]*\)\.\(l\)\{0,1\}x/\1.n.hs \1.g.hs/g')
108+
CLEAN_FILES += *.n.hs *.g.hs *.d.hs *.info *.hi *.o *.bin *.exe
109+
110+
ALL_TEST_HS = $(shell echo $(TESTS) $(TEXT_TESTS) | sed -e 's/\([^\. ]*\)\.\(l\)\{0,1\}x/\1.n.hs \1.g.hs \1.d.hs/g')
108111

109112
ALL_TESTS = $(patsubst %.hs, %.run, $(ALL_TEST_HS))
110113

@@ -128,4 +131,6 @@ interact:
128131
# :set args --template=.. simple.x -o simple.n.hs
129132

130133
debug :
131-
@echo HC_OPTS=$(HC_OPTS)
134+
@echo ALEX = $(ALEX)
135+
@echo HC_OPTS = $(HC_OPTS)
136+
@echo ALL_TESTS = $(ALL_TESTS)

0 commit comments

Comments
 (0)