Skip to content

Preparing for running lexer tests on bots #15988

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

Merged
merged 5 commits into from
Jul 26, 2014
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
16 changes: 11 additions & 5 deletions mk/grammar.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SG = $(S)src/grammar/
B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/
L = $(B)lib/rustlib/$(CFG_BUILD)/lib
LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/
RUSTC = $(B)bin/rustc
RUSTC = $(STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD))

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

check-lexer: $(BG) $(BG)RustLexer.class $(BG)verify
ifdef CFG_JAVAC
ifdef CFG_ANTLR4
ifdef CFG_GRUN
check-lexer: $(BG) $(BG)RustLexer.class $(BG)verify
$(info Verifying libsyntax against the reference lexer ...)
$(Q)$(SG)check.sh $(S) "$(BG)" \
"$(CFG_GRUN)" "$(BG)verify" "$(BG)RustLexer.tokens"
else
$(info grun not available, skipping lexer test...)
$(info cfg: grun not available, skipping lexer test...)
check-lexer:

endif
else
$(info antlr4 not available, skipping lexer test...)
$(info cfg: antlr4 not available, skipping lexer test...)
check-lexer:

endif
else
$(info javac not available, skipping lexer test...)
$(info cfg: javac not available, skipping lexer test...)
check-lexer:

endif
15 changes: 14 additions & 1 deletion mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -171,28 +171,41 @@ endif
# Main test targets
######################################################################

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

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

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

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

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

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

check-syntax: check-lexer
# Some less critical tests that are not prone to breakage.
# Not run as part of the normal test suite, but tested by bors on checkin.
check-secondary: check-lexer check-pretty

# check + check-secondary.
check-all: check check-secondary

# Pretty-printing tests.
check-pretty: check-stage2-T-$(CFG_BUILD)-H-$(CFG_BUILD)-pretty-exec

.PHONY: cleantmptestlogs cleantestlibs

Expand Down