2011-05-01 15:18:52 -05:00
|
|
|
######################################################################
|
|
|
|
# Testing variables
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
ALL_TEST_INPUTS = $(wildcard $(S)src/test/*/*.rs \
|
|
|
|
$(S)src/test/*/*/*.rs \
|
|
|
|
$(S)src/test/*/*.rc)
|
|
|
|
|
2011-06-25 14:23:27 -05:00
|
|
|
RPASS_RC := $(wildcard $(S)src/test/run-pass/*.rc)
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
RPASS_RS := $(wildcard $(S)src/test/run-pass/*.rs)
|
2011-06-25 14:23:27 -05:00
|
|
|
RFAIL_RC := $(wildcard $(S)src/test/run-fail/*.rc)
|
|
|
|
RFAIL_RS := $(wildcard $(S)src/test/run-fail/*.rs)
|
|
|
|
CFAIL_RC := $(wildcard $(S)src/test/compile-fail/*.rc)
|
|
|
|
CFAIL_RS := $(wildcard $(S)src/test/compile-fail/*.rs)
|
2011-08-01 16:10:59 -05:00
|
|
|
BENCH_RS := $(wildcard $(S)src/test/bench/*.rs)
|
|
|
|
PRETTY_RS := $(wildcard $(S)src/test/pretty/*.rs)
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-09-13 17:06:21 -05:00
|
|
|
# perf tests are the same as bench tests only they run under
|
|
|
|
# a performance monitor.
|
|
|
|
PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
|
|
|
|
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
RPASS_TESTS := $(RPASS_RC) $(RPASS_RS)
|
|
|
|
RFAIL_TESTS := $(RFAIL_RC) $(RFAIL_RS)
|
|
|
|
CFAIL_TESTS := $(CFAIL_RC) $(CFAIL_RS)
|
2011-08-01 15:15:36 -05:00
|
|
|
BENCH_TESTS := $(BENCH_RS)
|
2011-09-13 17:06:21 -05:00
|
|
|
PERF_TESTS := $(PERF_RS)
|
2011-08-01 16:10:59 -05:00
|
|
|
PRETTY_TESTS := $(PRETTY_RS)
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-06-29 17:12:02 -05:00
|
|
|
FT := run_pass_stage2
|
|
|
|
FT_LIB := $(call CFG_LIB_NAME,$(FT))
|
|
|
|
FT_DRIVER := $(FT)_driver
|
|
|
|
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
# The arguments to all test runners
|
|
|
|
ifdef TESTNAME
|
|
|
|
TESTARGS += $(TESTNAME)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CHECK_XFAILS
|
|
|
|
TESTARGS += --ignored
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Arguments to the cfail/rfail/rpass/bench tests
|
|
|
|
ifdef CFG_VALGRIND
|
|
|
|
CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
|
|
|
|
endif
|
2011-06-29 17:12:02 -05:00
|
|
|
|
2011-09-13 17:06:21 -05:00
|
|
|
# Arguments to the perf tests
|
|
|
|
ifdef CFG_PERF_TOOL
|
|
|
|
CTEST_PERF_RUNTOOL = --runtool "$(CFG_PERF_TOOL)"
|
|
|
|
endif
|
|
|
|
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
CTEST_TESTARGS := $(TESTARGS)
|
2011-05-01 15:18:52 -05:00
|
|
|
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
ifdef VERBOSE
|
|
|
|
CTEST_TESTARGS += --verbose
|
|
|
|
endif
|
2011-05-04 19:32:05 -05:00
|
|
|
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
# The standard library test crate
|
|
|
|
STDTEST_CRATE := $(S)src/test/stdtest/stdtest.rc
|
|
|
|
STDTEST_INPUTS := $(wildcard $(S)src/test/stdtest/*rs)
|
2011-05-04 19:32:05 -05:00
|
|
|
|
2011-07-31 18:45:09 -05:00
|
|
|
# Run the compiletest runner itself under valgrind
|
|
|
|
ifdef CTEST_VALGRIND
|
2011-11-28 23:23:42 -06:00
|
|
|
CFG_RUN_CTEST=$(call CFG_RUN_TEST,$(2),$(3))
|
2011-07-31 18:45:09 -05:00
|
|
|
else
|
2011-11-22 13:25:51 -06:00
|
|
|
CFG_RUN_CTEST=$(call CFG_RUN,$(TLIB$(1)_T_$(3)_H_$(3)),$(2))
|
2011-07-31 18:45:09 -05:00
|
|
|
endif
|
2011-05-04 19:32:05 -05:00
|
|
|
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
######################################################################
|
|
|
|
# Main test targets
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
check: tidy check-stage2 \
|
2011-05-04 19:32:05 -05:00
|
|
|
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
check-full: tidy check-stage1 check-stage2 check-stage3 \
|
2011-05-11 11:37:23 -05:00
|
|
|
|
2011-10-31 14:57:50 -05:00
|
|
|
# Run the tidy script in multiple parts to avoid huge 'echo' commands
|
2011-11-18 16:03:11 -06:00
|
|
|
ifdef CFG_NOTIDY
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
tidy:
|
2011-11-18 16:03:11 -06:00
|
|
|
else
|
|
|
|
tidy:
|
|
|
|
@$(call E, check: formatting)
|
|
|
|
$(Q)echo \
|
|
|
|
$(addprefix $(S)src/, $(RUSTLLVM_LIB_CS) $(RUSTLLVM_OBJS_CS) \
|
|
|
|
$(RUSTLLVM_HDR) \
|
|
|
|
$(RUNTIME_CS) $(RUNTIME_HDR) $(RUNTIME_S)) \
|
|
|
|
$(wildcard $(S)src/etc/*.py) \
|
|
|
|
$(COMPILER_CRATE) \
|
|
|
|
$(COMPILER_INPUTS) \
|
|
|
|
$(STDLIB_CRATE) \
|
|
|
|
$(STDLIB_INPUTS) \
|
|
|
|
$(COMPILETEST_CRATE) \
|
|
|
|
$(COMPILETEST_INPUTS) \
|
|
|
|
| xargs -n 10 python $(S)src/etc/tidy.py
|
|
|
|
$(Q)echo \
|
|
|
|
$(ALL_TEST_INPUTS) \
|
|
|
|
| xargs -n 10 python $(S)src/etc/tidy.py
|
|
|
|
endif
|
2011-06-29 17:12:02 -05:00
|
|
|
|
|
|
|
######################################################################
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
# Rules for the test runners
|
2011-06-29 17:12:02 -05:00
|
|
|
######################################################################
|
|
|
|
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
define TEST_STAGEN
|
2011-06-29 17:12:02 -05:00
|
|
|
|
2011-10-02 19:37:50 -05:00
|
|
|
# All the per-stage build rules you might want to call from the
|
2011-11-11 00:16:07 -06:00
|
|
|
# command line.
|
|
|
|
#
|
|
|
|
# $(1) is the stage number
|
2011-11-21 15:11:40 -06:00
|
|
|
# $(2) is the target triple to test
|
|
|
|
# $(3) is the host triple to test
|
2011-08-01 14:12:50 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3): tidy \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rustc \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-std \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rpass \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rfail \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-cfail \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-bench \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty
|
2011-06-29 17:12:02 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-std: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-std-dummy
|
2011-06-29 17:12:02 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rustc: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rustc-dummy
|
2011-06-29 17:12:02 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-cfail: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-cfail-dummy
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rfail: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rfail-dummy
|
2011-06-25 14:23:27 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rpass: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rpass-dummy
|
2011-06-16 14:06:09 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-bench: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-bench-dummy
|
2011-06-16 14:06:09 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-perf: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-perf-dummy
|
2011-06-16 14:06:09 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-bench \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-dummy
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-dummy
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-bench: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-dummy
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-dummy
|
2011-07-12 15:04:29 -05:00
|
|
|
|
2011-10-02 19:37:50 -05:00
|
|
|
# Rules for the standard library test runner
|
2011-07-06 16:33:36 -05:00
|
|
|
|
2011-11-21 15:11:40 -06:00
|
|
|
$(3)/test/stdtest.stage$(1)-$(2)$$(X): \
|
|
|
|
$$(STDTEST_CRATE) $$(STDTEST_INPUTS) \
|
|
|
|
$$(SREQ$(1)_T_$(2)_H_$(3))
|
2011-10-02 19:37:50 -05:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
2011-11-22 00:45:14 -06:00
|
|
|
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
|
2011-07-12 15:04:29 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-std-dummy: \
|
2011-11-21 15:11:40 -06:00
|
|
|
$(3)/test/stdtest.stage$(1)-$(2)$$(X)
|
2011-10-02 19:37:50 -05:00
|
|
|
@$$(call E, run: $$<)
|
2011-11-28 23:23:42 -06:00
|
|
|
$$(Q)$$(call CFG_RUN_TEST,$$<,$(2),$(3)) $$(TESTARGS)
|
2011-07-12 15:04:29 -05:00
|
|
|
|
2011-10-02 19:37:50 -05:00
|
|
|
# Rules for the rustc test runner
|
2011-08-01 13:57:05 -05:00
|
|
|
|
2011-11-21 15:11:40 -06:00
|
|
|
$(3)/test/rustctest.stage$(1)-$(2)$$(X): \
|
|
|
|
$$(COMPILER_CRATE) \
|
|
|
|
$$(COMPILER_INPUTS) \
|
|
|
|
$$(SREQ$(1)_T_$(2)_H_$(3)) \
|
2011-11-22 00:45:14 -06:00
|
|
|
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM)
|
2011-10-02 19:37:50 -05:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
2011-11-22 00:45:14 -06:00
|
|
|
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
|
2011-08-01 13:57:05 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rustc-dummy: \
|
2011-11-21 15:11:40 -06:00
|
|
|
$(3)/test/rustctest.stage$(1)-$(2)$$(X)
|
2011-10-02 19:37:50 -05:00
|
|
|
@$$(call E, run: $$<)
|
2011-11-28 23:23:42 -06:00
|
|
|
$$(Q)$$(call CFG_RUN_TEST,$$<,$(2),$(3)) $$(TESTARGS)
|
2011-08-01 16:10:59 -05:00
|
|
|
|
2011-10-02 19:37:50 -05:00
|
|
|
# Rules for the cfail/rfail/rpass/bench/perf test runner
|
2011-08-01 16:10:59 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
|
2011-11-21 15:11:40 -06:00
|
|
|
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
|
|
|
|
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
|
|
|
|
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X) \
|
|
|
|
--stage-id stage$(1)-$(2) \
|
|
|
|
--rustcflags "$$(CFG_RUSTC_FLAGS) --target=$(2)" \
|
|
|
|
$$(CTEST_TESTARGS)
|
|
|
|
|
2011-11-23 17:20:28 -06:00
|
|
|
CFAIL_ARGS$(1)-T-$(2)-H-$(3) := \
|
2011-11-22 00:45:14 -06:00
|
|
|
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
|
|
|
|
--src-base $$(S)src/test/compile-fail/ \
|
2011-11-23 17:20:28 -06:00
|
|
|
--build-base $(3)/test/compile-fail/ \
|
2011-11-21 15:11:40 -06:00
|
|
|
--mode compile-fail
|
|
|
|
|
2011-11-23 17:20:28 -06:00
|
|
|
RFAIL_ARGS$(1)-T-$(2)-H-$(3) := \
|
2011-11-22 00:45:14 -06:00
|
|
|
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
|
|
|
|
--src-base $$(S)src/test/run-fail/ \
|
2011-11-23 17:20:28 -06:00
|
|
|
--build-base $(3)/test/run-fail/ \
|
2011-11-22 00:45:14 -06:00
|
|
|
--mode run-fail \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(CTEST_RUNTOOL)
|
|
|
|
|
2011-11-29 09:07:25 -06:00
|
|
|
RPASS_ARGS$(1)-T-$(2)-H-$(3) := \
|
2011-11-22 00:45:14 -06:00
|
|
|
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
|
|
|
|
--src-base $$(S)src/test/run-pass/ \
|
2011-11-23 17:20:28 -06:00
|
|
|
--build-base $(3)/test/run-pass/ \
|
2011-11-29 09:07:25 -06:00
|
|
|
--mode run-pass \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(CTEST_RUNTOOL)
|
|
|
|
|
2011-11-29 09:07:25 -06:00
|
|
|
BENCH_ARGS$(1)-T-$(2)-H-$(3) := \
|
2011-11-22 00:45:14 -06:00
|
|
|
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
|
|
|
|
--src-base $$(S)src/test/bench/ \
|
2011-11-23 17:20:28 -06:00
|
|
|
--build-base $(3)/test/bench/ \
|
2011-11-29 09:07:25 -06:00
|
|
|
--mode run-pass \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(CTEST_RUNTOOL)
|
|
|
|
|
2011-11-23 17:20:28 -06:00
|
|
|
PERF_ARGS$(1)-T-$(2)-H-$(3) := \
|
2011-11-22 00:45:14 -06:00
|
|
|
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
|
|
|
|
--src-base $$(S)src/test/bench/ \
|
2011-11-23 17:20:28 -06:00
|
|
|
--build-base $(3)/test/perf/ \
|
2011-11-22 00:45:14 -06:00
|
|
|
--mode run-pass \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(CTEST_PERF_RUNTOOL)
|
|
|
|
|
2011-11-23 17:20:28 -06:00
|
|
|
PRETTY_RPASS_ARGS$(1)-T-$(2)-H-$(3) := \
|
2011-11-22 00:45:14 -06:00
|
|
|
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
|
|
|
|
--src-base $$(S)src/test/run-pass/ \
|
2011-11-23 17:20:28 -06:00
|
|
|
--build-base $(3)/test/run-pass/ \
|
2011-11-22 00:45:14 -06:00
|
|
|
--mode pretty
|
|
|
|
|
2011-11-23 17:20:28 -06:00
|
|
|
PRETTY_RFAIL_ARGS$(1)-T-$(2)-H-$(3) := \
|
2011-11-22 00:45:14 -06:00
|
|
|
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
|
|
|
|
--src-base $$(S)src/test/run-fail/ \
|
2011-11-23 17:20:28 -06:00
|
|
|
--build-base $(3)/test/run-fail/ \
|
2011-11-22 00:45:14 -06:00
|
|
|
--mode pretty
|
|
|
|
|
2011-11-23 17:20:28 -06:00
|
|
|
PRETTY_BENCH_ARGS$(1)-T-$(2)-H-$(3) := \
|
2011-11-22 00:45:14 -06:00
|
|
|
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
|
|
|
|
--src-base $$(S)src/test/bench/ \
|
2011-11-23 17:20:28 -06:00
|
|
|
--build-base $(3)/test/bench/ \
|
2011-11-22 00:45:14 -06:00
|
|
|
--mode pretty
|
|
|
|
|
2011-11-23 17:20:28 -06:00
|
|
|
PRETTY_PRETTY_ARGS$(1)-T-$(2)-H-$(3) := \
|
2011-11-22 00:45:14 -06:00
|
|
|
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
|
|
|
|
--src-base $$(S)src/test/pretty/ \
|
2011-11-23 17:20:28 -06:00
|
|
|
--build-base $(3)/test/pretty/ \
|
2011-11-22 00:45:14 -06:00
|
|
|
--mode pretty
|
|
|
|
|
2011-11-22 13:25:51 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-cfail-dummy: \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
|
2011-11-29 09:07:25 -06:00
|
|
|
$$(SREQ$(1)_T_$(2)_H_$(3)) \
|
|
|
|
$$(CFAIL_TESTS)
|
2011-11-22 13:25:51 -06:00
|
|
|
@$$(call E, run cfail: $$<)
|
|
|
|
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
|
|
|
|
$$(CFAIL_ARGS$(1)-T-$(2)-H-$(3))
|
2011-07-12 17:27:00 -05:00
|
|
|
|
2011-11-22 13:25:51 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rfail-dummy: \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
|
2011-11-29 09:07:25 -06:00
|
|
|
$$(SREQ$(1)_T_$(2)_H_$(3)) \
|
|
|
|
$$(RFAIL_TESTS)
|
2011-11-22 13:25:51 -06:00
|
|
|
@$$(call E, run rfail: $$<)
|
|
|
|
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
|
|
|
|
$$(RFAIL_ARGS$(1)-T-$(2)-H-$(3))
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
|
2011-11-22 13:25:51 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rpass-dummy: \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
|
2011-11-29 09:07:25 -06:00
|
|
|
$$(SREQ$(1)_T_$(2)_H_$(3)) \
|
|
|
|
$$(RPASS_TESTS)
|
2011-11-22 13:25:51 -06:00
|
|
|
@$$(call E, run rpass: $$<)
|
|
|
|
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
|
|
|
|
$$(RPASS_ARGS$(1)-T-$(2)-H-$(3))
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
|
2011-11-22 13:25:51 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-bench-dummy: \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
|
2011-11-29 09:07:25 -06:00
|
|
|
$$(SREQ$(1)_T_$(2)_H_$(3)) \
|
|
|
|
$$(BENCH_TESTS)
|
2011-11-22 13:25:51 -06:00
|
|
|
@$$(call E, run bench: $$<)
|
|
|
|
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
|
|
|
|
$$(BENCH_ARGS$(1)-T-$(2)-H-$(3))
|
2011-07-12 17:27:00 -05:00
|
|
|
|
2011-11-22 13:25:51 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-perf-dummy: \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
|
2011-11-29 13:06:08 -06:00
|
|
|
$$(SREQ$(1)_T_$(2)_H_$(3)) \
|
|
|
|
$$(BENCH_TESTS)
|
2011-09-13 17:06:21 -05:00
|
|
|
@$$(call E, perf: $$<)
|
2011-11-22 13:25:51 -06:00
|
|
|
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
|
|
|
|
$$(PERF_ARGS$(1)-T-$(2)-H-$(3))
|
2011-09-13 17:06:21 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-dummy: \
|
2011-11-29 09:07:25 -06:00
|
|
|
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
|
|
|
|
$$(SREQ$(1)_T_$(2)_H_$(3)) \
|
|
|
|
$$(RPASS_TESTS)
|
2011-11-22 13:25:51 -06:00
|
|
|
@$$(call E, run pretty-rpass: $$<)
|
|
|
|
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
|
|
|
|
$$(PRETTY_RPASS_ARGS$(1)-T-$(2)-H-$(3))
|
2011-08-01 13:57:05 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-dummy: \
|
2011-11-29 09:07:25 -06:00
|
|
|
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
|
|
|
|
$$(SREQ$(1)_T_$(2)_H_$(3)) \
|
|
|
|
$$(RFAIL_TESTS)
|
2011-11-22 13:25:51 -06:00
|
|
|
@$$(call E, run pretty-rfail: $$<)
|
|
|
|
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
|
|
|
|
$$(PRETTY_RFAIL_ARGS$(1)-T-$(2)-H-$(3))
|
2011-08-01 13:57:05 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-dummy: \
|
2011-11-29 09:07:25 -06:00
|
|
|
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
|
|
|
|
$$(SREQ$(1)_T_$(2)_H_$(3)) \
|
|
|
|
$$(BENCH_TESTS)
|
2011-11-22 13:25:51 -06:00
|
|
|
@$$(call E, run pretty-bench: $$<)
|
|
|
|
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
|
|
|
|
$$(PRETTY_BENCH_ARGS$(1)-T-$(2)-H-$(3))
|
2011-08-02 16:37:03 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-dummy: \
|
2011-11-29 09:07:25 -06:00
|
|
|
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
|
|
|
|
$$(SREQ$(1)_T_$(2)_H_$(3)) \
|
|
|
|
$$(PRETTY_TESTS)
|
2011-11-22 13:25:51 -06:00
|
|
|
@$$(call E, run pretty-pretty: $$<)
|
|
|
|
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
|
|
|
|
$$(PRETTY_PRETTY_ARGS$(1)-T-$(2)-H-$(3))
|
2011-07-30 23:44:30 -05:00
|
|
|
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
endef
|
2011-07-12 17:27:00 -05:00
|
|
|
|
2011-07-29 20:35:32 -05:00
|
|
|
# Instantiate the template for stage 0, 1, 2, 3
|
2011-07-12 17:27:00 -05:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
$(foreach host,$(CFG_TARGET_TRIPLES), \
|
|
|
|
$(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
|
|
|
|
$(eval $(foreach stage,$(STAGES), \
|
|
|
|
$(eval $(call TEST_STAGEN,$(stage),$(target),$(host))))))))
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
|
2011-11-29 09:07:25 -06:00
|
|
|
######################################################################
|
|
|
|
# Fast-test rules
|
|
|
|
######################################################################
|
2011-11-17 14:04:37 -06:00
|
|
|
|
2011-11-29 09:07:25 -06:00
|
|
|
GENERATED += tmp/$$(FT).rc tmp/$$(FT_DRIVER).rs
|
|
|
|
|
2011-11-29 10:03:22 -06:00
|
|
|
tmp/$(FT).rc tmp/$(FT_DRIVER).rs: \
|
|
|
|
$(TEST_RPASS_SOURCES_STAGE2) \
|
|
|
|
$(S)src/etc/combine-tests.py
|
|
|
|
@$(call E, check: building combined stage2 test runner)
|
|
|
|
$(Q)$(S)src/etc/combine-tests.py
|
2011-11-29 09:07:25 -06:00
|
|
|
|
|
|
|
define DEF_CHECK_FAST_FOR_T_H
|
|
|
|
# $(1) unused
|
|
|
|
# $(2) target triple
|
|
|
|
# $(3) host triple
|
|
|
|
|
|
|
|
$$(TLIB2_T_$(2)_H_$(3))/$$(FT_LIB): \
|
|
|
|
tmp/$$(FT).rc \
|
|
|
|
$$(SREQ2_T_$(2)_H_$(3))
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
2011-11-29 10:03:22 -06:00
|
|
|
$$(STAGE2_T_$(2)_H_$(3)) --lib -o $$@ $$<
|
2011-11-29 09:07:25 -06:00
|
|
|
|
2011-11-29 10:03:22 -06:00
|
|
|
$(3)/test/$$(FT_DRIVER)-$(2)$$(X): \
|
|
|
|
tmp/$$(FT_DRIVER).rs \
|
|
|
|
$$(TLIB2_T_$(2)_H_$(3))/$$(FT_LIB) \
|
|
|
|
$$(SREQ2_T_$(2)_H_$(3))
|
|
|
|
@$$(call E, compile_and_link: $$@ $$<)
|
|
|
|
$$(STAGE2_T_$(2)_H_$(3)) -L $$(TLIB2_T_$(2)_H_$(3)) -o $$@ $$<
|
2011-11-29 09:07:25 -06:00
|
|
|
|
2011-11-29 10:03:22 -06:00
|
|
|
$(3)/test/$$(FT_DRIVER)-$(2).out: \
|
|
|
|
$(3)/test/$$(FT_DRIVER)-$(2)$$(X) \
|
|
|
|
$$(SREQ2_T_$(2)_H_$(3))
|
|
|
|
$$(Q)$$(call CFG_RUN_TEST,$$<,$(2),$(3))
|
2011-11-29 09:07:25 -06:00
|
|
|
|
|
|
|
check-fast-T-$(2)-H-$(3): tidy \
|
|
|
|
check-stage2-T-$(2)-H-$(3)-rustc \
|
|
|
|
check-stage2-T-$(2)-H-$(3)-std \
|
2011-11-29 10:03:22 -06:00
|
|
|
$(3)/test/$$(FT_DRIVER)-$(2).out
|
2011-11-29 09:07:25 -06:00
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach host,$(CFG_TARGET_TRIPLES), \
|
|
|
|
$(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
|
|
|
|
$(eval $(call DEF_CHECK_FAST_FOR_T_H,,$(target),$(host))))))
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Shortcut rules
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
define DEF_CHECK_FOR_STAGE_H
|
2011-11-17 14:04:37 -06:00
|
|
|
|
2011-11-29 17:37:33 -06:00
|
|
|
check-stage$(1)-H-$(2): \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-T-$$(target)-H-$(2))
|
|
|
|
check-stage$(1)-H-$(2)-perf: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-T-$$(target)-H-$(2)-perf)
|
|
|
|
check-stage$(1)-H-$(2)-rustc: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-T-$$(target)-H-$(2)-rustc)
|
|
|
|
check-stage$(1)-H-$(2)-std: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-T-$$(target)-H-$(2)-std)
|
|
|
|
check-stage$(1)-H-$(2)-rpass: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-T-$$(target)-H-$(2)-rpass)
|
|
|
|
check-stage$(1)-H-$(2)-rfail: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-T-$$(target)-H-$(2)-rfail)
|
|
|
|
check-stage$(1)-H-$(2)-cfail: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-T-$$(target)-H-$(2)-cfail)
|
|
|
|
check-stage$(1)-H-$(2)-bench: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-T-$$(target)-H-$(2)-bench)
|
2011-11-17 14:04:37 -06:00
|
|
|
|
|
|
|
endef
|
|
|
|
|
2011-11-29 09:07:25 -06:00
|
|
|
$(foreach stage,$(STAGES), \
|
2011-11-22 00:45:14 -06:00
|
|
|
$(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
|
2011-11-29 09:07:25 -06:00
|
|
|
$(eval $(call DEF_CHECK_FOR_STAGE_H,$(stage),$(target))))))
|
|
|
|
|
|
|
|
define DEF_CHECK_FAST_FOR_H
|
|
|
|
|
|
|
|
check-fast-H-$(1): check-fast-T-$(1)-H-$(1)
|
|
|
|
|
|
|
|
endef
|
2011-11-22 00:45:14 -06:00
|
|
|
|
2011-11-29 09:07:25 -06:00
|
|
|
$(foreach target,$(CFG_TARGET_TRIPLES), \
|
|
|
|
$(eval $(call DEF_CHECK_FAST_FOR_H,$(target))))
|
|
|
|
|
|
|
|
define DEF_CHECK_FOR_STAGE
|
2011-11-22 00:45:14 -06:00
|
|
|
|
2011-11-29 17:37:33 -06:00
|
|
|
check-stage$(1): \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-H-$$(target))
|
|
|
|
check-stage$(1)-perf: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-H-$$(target)-perf)
|
|
|
|
check-stage$(1)-rustc: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-H-$$(target)-rustc)
|
|
|
|
check-stage$(1)-std: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-H-$$(target)-std)
|
|
|
|
check-stage$(1)-rpass: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-H-$$(target)-rpass)
|
|
|
|
check-stage$(1)-rfail: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-H-$$(target)-rfail)
|
|
|
|
check-stage$(1)-cfail: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-H-$$(target)-cfail)
|
|
|
|
check-stage$(1)-bench: \
|
|
|
|
$$(foreach target,$$(CFG_TARGET_TRIPLES), \
|
|
|
|
check-stage$(1)-H-$$(target)-bench)
|
2011-11-22 00:45:14 -06:00
|
|
|
|
|
|
|
endef
|
2011-11-17 14:04:37 -06:00
|
|
|
|
2011-11-22 00:45:14 -06:00
|
|
|
$(foreach stage,$(STAGES), \
|
2011-11-29 09:07:25 -06:00
|
|
|
$(eval $(call DEF_CHECK_FOR_STAGE,$(stage))))
|
The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-12 21:01:09 -05:00
|
|
|
|
2011-11-29 09:07:25 -06:00
|
|
|
check-fast: check-fast-H-$(CFG_HOST_TRIPLE)
|