Skip to content

Commit 0d53597

Browse files
committed
auto merge of #15988 : brson/rust/antlrprep, r=cmr
Add `check-secondary`, which runs the pretty and lexer tests so we can run them on a dedicated bot. Leaves the pretty tests running under `check` until the bots are switched over. Also fixes some issues. r? @cmr
2 parents cf61980 + 3382ffe commit 0d53597

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

mk/grammar.mk

+11-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SG = $(S)src/grammar/
1313
B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/
1414
L = $(B)lib/rustlib/$(CFG_BUILD)/lib
1515
LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/
16-
RUSTC = $(B)bin/rustc
16+
RUSTC = $(STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD))
1717

1818
# Run the reference lexer against libsyntax and compare the tokens and spans.
1919
# If "// ignore-lexer-test" is present in the file, it will be ignored.
@@ -37,19 +37,25 @@ $(BG)RustLexer.class: $(SG)RustLexer.g4
3737
$(BG)verify: $(SG)verify.rs rustc-stage2-H-$(CFG_BUILD) $(LD)stamp.regex_macros $(LD)stamp.rustc
3838
$(Q)$(RUSTC) -O --out-dir $(BG) -L $(L) $(SG)verify.rs
3939

40-
check-lexer: $(BG) $(BG)RustLexer.class $(BG)verify
4140
ifdef CFG_JAVAC
4241
ifdef CFG_ANTLR4
4342
ifdef CFG_GRUN
43+
check-lexer: $(BG) $(BG)RustLexer.class $(BG)verify
4444
$(info Verifying libsyntax against the reference lexer ...)
4545
$(Q)$(SG)check.sh $(S) "$(BG)" \
4646
"$(CFG_GRUN)" "$(BG)verify" "$(BG)RustLexer.tokens"
4747
else
48-
$(info grun not available, skipping lexer test...)
48+
$(info cfg: grun not available, skipping lexer test...)
49+
check-lexer:
50+
4951
endif
5052
else
51-
$(info antlr4 not available, skipping lexer test...)
53+
$(info cfg: antlr4 not available, skipping lexer test...)
54+
check-lexer:
55+
5256
endif
5357
else
54-
$(info javac not available, skipping lexer test...)
58+
$(info cfg: javac not available, skipping lexer test...)
59+
check-lexer:
60+
5561
endif

mk/tests.mk

+14-1
Original file line numberDiff line numberDiff line change
@@ -171,28 +171,41 @@ endif
171171
# Main test targets
172172
######################################################################
173173

174+
# The main testing target. Tests lots of stuff.
174175
check: cleantmptestlogs cleantestlibs check-notidy tidy
175176

177+
# As above but don't bother running tidy.
176178
check-notidy: cleantmptestlogs cleantestlibs all check-stage2
177179
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
178180

181+
# A slightly smaller set of tests for smoke testing.
179182
check-lite: cleantestlibs cleantmptestlogs \
180183
$(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
181184
check-stage2-rpass \
182185
check-stage2-rfail check-stage2-cfail check-stage2-rmake
183186
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
184187

188+
# Only check the 'reference' tests: rpass/cfail/rfail/rmake.
185189
check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass \
186190
check-stage2-rfail check-stage2-cfail check-stage2-rmake
187191
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
188192

193+
# Only check the docs.
189194
check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
190195
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
191196

192197
# NOTE: Remove after reprogramming windows bots
193198
check-fast: check-lite
194199

195-
check-syntax: check-lexer
200+
# Some less critical tests that are not prone to breakage.
201+
# Not run as part of the normal test suite, but tested by bors on checkin.
202+
check-secondary: check-lexer check-pretty
203+
204+
# check + check-secondary.
205+
check-all: check check-secondary
206+
207+
# Pretty-printing tests.
208+
check-pretty: check-stage2-T-$(CFG_BUILD)-H-$(CFG_BUILD)-pretty-exec
196209

197210
.PHONY: cleantmptestlogs cleantestlibs
198211

0 commit comments

Comments
 (0)