2014-10-07 07:00:26 +00:00
|
|
|
# Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
2012-12-11 01:32:48 +00:00
|
|
|
# file at the top-level directory of this distribution and at
|
|
|
|
# http://rust-lang.org/COPYRIGHT.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
# option. This file may not be copied, modified, or distributed
|
|
|
|
# except according to those terms.
|
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
|
2011-05-01 20:18:52 +00:00
|
|
|
######################################################################
|
2013-02-05 22:14:58 +00:00
|
|
|
# Test variables
|
2011-05-01 20:18:52 +00:00
|
|
|
######################################################################
|
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
# The names of crates that must be tested
|
2014-06-28 20:57:36 +00:00
|
|
|
|
deprecate Unicode functions that will be moved to crates.io
This patch
1. renames libunicode to librustc_unicode,
2. deprecates several pieces of libunicode (see below), and
3. removes references to deprecated functions from
librustc_driver and libsyntax. This may change pretty-printed
output from these modules in cases involving wide or combining
characters used in filenames, identifiers, etc.
The following functions are marked deprecated:
1. char.width() and str.width():
--> use unicode-width crate
2. str.graphemes() and str.grapheme_indices():
--> use unicode-segmentation crate
3. str.nfd_chars(), str.nfkd_chars(), str.nfc_chars(), str.nfkc_chars(),
char.compose(), char.decompose_canonical(), char.decompose_compatible(),
char.canonical_combining_class():
--> use unicode-normalization crate
2015-04-14 19:52:37 +00:00
|
|
|
# libcore/librustc_unicode tests are in a separate crate
|
2014-06-28 20:57:36 +00:00
|
|
|
DEPS_coretest :=
|
|
|
|
$(eval $(call RUST_CRATE,coretest))
|
|
|
|
|
2015-03-11 04:58:16 +00:00
|
|
|
DEPS_collectionstest :=
|
|
|
|
$(eval $(call RUST_CRATE,collectionstest))
|
|
|
|
|
2015-11-03 00:23:22 +00:00
|
|
|
TEST_TARGET_CRATES = $(filter-out core rustc_unicode alloc_system libc \
|
2015-06-25 17:07:01 +00:00
|
|
|
alloc_jemalloc,$(TARGET_CRATES)) \
|
2015-04-07 22:11:16 +00:00
|
|
|
collectionstest coretest
|
2015-11-03 16:03:06 +00:00
|
|
|
TEST_DOC_CRATES = $(DOC_CRATES) arena flate fmt_macros getopts graphviz \
|
2015-11-03 16:37:29 +00:00
|
|
|
log rand rbml serialize syntax term test
|
2015-04-07 22:11:16 +00:00
|
|
|
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve \
|
|
|
|
rustc_trans rustc_lint,\
|
2014-12-18 22:46:26 +00:00
|
|
|
$(HOST_CRATES))
|
2013-02-22 00:15:01 +00:00
|
|
|
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
|
2011-05-01 20:18:52 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
######################################################################
|
|
|
|
# Environment configuration
|
|
|
|
######################################################################
|
2011-06-29 22:12:02 +00: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-13 02:01:09 +00:00
|
|
|
# The arguments to all test runners
|
|
|
|
ifdef TESTNAME
|
|
|
|
TESTARGS += $(TESTNAME)
|
|
|
|
endif
|
|
|
|
|
2014-02-07 19:08:32 +00:00
|
|
|
ifdef CHECK_IGNORED
|
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-13 02:01:09 +00:00
|
|
|
TESTARGS += --ignored
|
|
|
|
endif
|
|
|
|
|
2016-01-29 02:44:45 +00:00
|
|
|
# Arguments to the cfail/rfail/rpass tests
|
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-13 02:01:09 +00:00
|
|
|
ifdef CFG_VALGRIND
|
|
|
|
CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
|
|
|
|
endif
|
2011-06-29 22:12:02 +00: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-13 02:01:09 +00:00
|
|
|
CTEST_TESTARGS := $(TESTARGS)
|
2011-05-01 20:18:52 +00:00
|
|
|
|
2015-02-14 22:10:53 +00:00
|
|
|
# --bench is only relevant for crate tests, not for the compile tests
|
|
|
|
ifdef PLEASE_BENCH
|
|
|
|
TESTARGS += --bench
|
|
|
|
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-13 02:01:09 +00:00
|
|
|
ifdef VERBOSE
|
|
|
|
CTEST_TESTARGS += --verbose
|
|
|
|
endif
|
2011-05-05 00:32:05 +00:00
|
|
|
|
2014-09-23 00:20:19 +00:00
|
|
|
# Setting locale ensures that gdb's output remains consistent.
|
|
|
|
# This prevents tests from failing with some locales (fixes #17423).
|
|
|
|
export LC_ALL=C
|
|
|
|
|
2013-02-06 04:05:00 +00:00
|
|
|
TEST_LOG_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
|
|
|
|
TEST_OK_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).ok
|
2012-05-24 05:53:50 +00:00
|
|
|
|
2013-03-02 12:25:12 +00:00
|
|
|
define DEF_TARGET_COMMANDS
|
|
|
|
|
|
|
|
ifdef CFG_UNIXY_$(1)
|
2014-06-11 21:52:38 +00:00
|
|
|
CFG_RUN_TEST_$(1)=$$(TARGET_RPATH_VAR$$(2)_T_$$(3)_H_$$(4)) \
|
|
|
|
$$(call CFG_RUN_$(1),,$$(CFG_VALGRIND) $$(1))
|
2013-03-02 12:25:12 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CFG_WINDOWSY_$(1)
|
2013-11-30 01:09:10 +00:00
|
|
|
CFG_TESTLIB_$(1)=$$(CFG_BUILD_DIR)$$(2)/$$(strip \
|
2013-03-02 12:25:12 +00:00
|
|
|
$$(if $$(findstring stage0,$$(1)), \
|
2014-01-14 00:45:33 +00:00
|
|
|
stage0/$$(CFG_LIBDIR_RELATIVE), \
|
2013-03-02 12:25:12 +00:00
|
|
|
$$(if $$(findstring stage1,$$(1)), \
|
2014-01-14 00:45:33 +00:00
|
|
|
stage1/$$(CFG_LIBDIR_RELATIVE), \
|
2013-03-02 12:25:12 +00:00
|
|
|
$$(if $$(findstring stage2,$$(1)), \
|
2014-01-14 00:45:33 +00:00
|
|
|
stage2/$$(CFG_LIBDIR_RELATIVE), \
|
2013-03-02 12:25:12 +00:00
|
|
|
$$(if $$(findstring stage3,$$(1)), \
|
2014-01-14 00:45:33 +00:00
|
|
|
stage3/$$(CFG_LIBDIR_RELATIVE), \
|
2014-03-26 01:18:57 +00:00
|
|
|
)))))/rustlib/$$(CFG_BUILD)/lib
|
2015-08-06 03:47:15 +00:00
|
|
|
CFG_RUN_TEST_$(1)=$$(TARGET_RPATH_VAR$$(2)_T_$$(3)_H_$$(4)) \
|
|
|
|
$$(call CFG_RUN_$(1),$$(call CFG_TESTLIB_$(1),$$(1),$$(4)),$$(1))
|
2013-03-02 12:25:12 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Run the compiletest runner itself under valgrind
|
|
|
|
ifdef CTEST_VALGRIND
|
2014-02-08 00:04:57 +00:00
|
|
|
CFG_RUN_CTEST_$(1)=$$(RPATH_VAR$$(1)_T_$$(3)_H_$$(3)) \
|
2014-06-11 21:52:38 +00:00
|
|
|
$$(call CFG_RUN_TEST_$$(CFG_BUILD),$$(3),$$(4))
|
2013-03-02 12:25:12 +00:00
|
|
|
else
|
2014-02-08 00:04:57 +00:00
|
|
|
CFG_RUN_CTEST_$(1)=$$(RPATH_VAR$$(1)_T_$$(3)_H_$$(3)) \
|
|
|
|
$$(call CFG_RUN_$$(CFG_BUILD),$$(TLIB$$(1)_T_$$(3)_H_$$(3)),$$(2))
|
2013-03-02 12:25:12 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
2013-10-21 09:18:21 +00:00
|
|
|
$(foreach target,$(CFG_TARGET), \
|
2013-03-02 12:25:12 +00:00
|
|
|
$(eval $(call DEF_TARGET_COMMANDS,$(target))))
|
|
|
|
|
2015-02-03 04:42:05 +00:00
|
|
|
# Target platform specific variables for android
|
2013-05-03 15:49:18 +00:00
|
|
|
define DEF_ADB_DEVICE_STATUS
|
|
|
|
CFG_ADB_DEVICE_STATUS=$(1)
|
2013-05-01 09:50:23 +00:00
|
|
|
endef
|
|
|
|
|
2013-10-21 09:18:21 +00:00
|
|
|
$(foreach target,$(CFG_TARGET), \
|
2015-02-03 04:42:05 +00:00
|
|
|
$(if $(findstring android, $(target)), \
|
2013-05-03 15:49:18 +00:00
|
|
|
$(if $(findstring adb,$(CFG_ADB)), \
|
2014-01-04 08:36:02 +00:00
|
|
|
$(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[:_A-Za-z0-9-]+[[:blank:]]+device')), \
|
2013-12-15 06:42:01 +00:00
|
|
|
$(info check: android device attached) \
|
|
|
|
$(eval $(call DEF_ADB_DEVICE_STATUS, true)), \
|
|
|
|
$(info check: android device not attached) \
|
|
|
|
$(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
|
2013-05-01 09:50:23 +00:00
|
|
|
), \
|
2013-12-15 06:42:01 +00:00
|
|
|
$(info check: adb not found) \
|
|
|
|
$(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
|
2013-05-03 15:49:18 +00:00
|
|
|
), \
|
2013-05-01 09:50:23 +00:00
|
|
|
) \
|
|
|
|
)
|
|
|
|
|
2013-05-03 15:49:18 +00:00
|
|
|
ifeq ($(CFG_ADB_DEVICE_STATUS),true)
|
|
|
|
CFG_ADB_TEST_DIR=/data/tmp
|
2013-05-01 09:50:23 +00:00
|
|
|
|
2013-05-03 15:49:18 +00:00
|
|
|
$(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
|
2014-01-04 08:36:02 +00:00
|
|
|
$(shell $(CFG_ADB) remount 1>/dev/null) \
|
|
|
|
$(shell $(CFG_ADB) shell rm -r $(CFG_ADB_TEST_DIR) >/dev/null) \
|
|
|
|
$(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)) \
|
|
|
|
$(shell $(CFG_ADB) push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
|
2015-02-02 08:42:23 +00:00
|
|
|
$(foreach target,$(CFG_TARGET), \
|
2015-02-03 04:42:05 +00:00
|
|
|
$(if $(findstring android, $(target)), \
|
2015-02-02 08:42:23 +00:00
|
|
|
$(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)/$(target)) \
|
2016-02-08 18:57:41 +00:00
|
|
|
$(foreach crate,$(TARGET_CRATES_$(target)), \
|
2015-02-02 08:42:23 +00:00
|
|
|
$(shell $(CFG_ADB) push $(TLIB2_T_$(target)_H_$(CFG_BUILD))/$(call CFG_LIB_GLOB_$(target),$(crate)) \
|
|
|
|
$(CFG_ADB_TEST_DIR)/$(target))), \
|
|
|
|
)))
|
2013-05-03 15:49:18 +00:00
|
|
|
else
|
|
|
|
CFG_ADB_TEST_DIR=
|
2013-05-01 09:50:23 +00:00
|
|
|
endif
|
2013-03-02 12:25:12 +00:00
|
|
|
|
2014-12-02 14:20:48 +00:00
|
|
|
# $(1) - name of doc test
|
|
|
|
# $(2) - file of the test
|
|
|
|
define DOCTEST
|
2016-02-02 07:27:04 +00:00
|
|
|
DOC_NAMES := $$(DOC_NAMES) $(1)
|
2014-12-02 14:20:48 +00:00
|
|
|
DOCFILE_$(1) := $(2)
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach doc,$(DOCS), \
|
|
|
|
$(eval $(call DOCTEST,md-$(doc),$(S)src/doc/$(doc).md)))
|
2015-11-30 19:55:26 +00:00
|
|
|
$(foreach file,$(wildcard $(S)src/doc/book/*.md), \
|
|
|
|
$(eval $(call DOCTEST,$(file:$(S)src/doc/book/%.md=book-%),$(file))))
|
2015-07-31 21:13:59 +00:00
|
|
|
$(foreach file,$(wildcard $(S)src/doc/nomicon/*.md), \
|
|
|
|
$(eval $(call DOCTEST,$(file:$(S)src/doc/nomicon/%.md=nomicon-%),$(file))))
|
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-13 02:01:09 +00:00
|
|
|
######################################################################
|
|
|
|
# Main test targets
|
|
|
|
######################################################################
|
|
|
|
|
2014-07-23 22:02:11 +00:00
|
|
|
# The main testing target. Tests lots of stuff.
|
2015-03-24 23:49:51 +00:00
|
|
|
check: check-sanitycheck cleantmptestlogs cleantestlibs all check-stage2 tidy
|
2015-01-30 22:58:02 +00:00
|
|
|
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
|
2014-02-22 09:09:59 +00:00
|
|
|
|
2014-07-23 22:02:11 +00:00
|
|
|
# As above but don't bother running tidy.
|
2015-05-30 16:22:12 +00:00
|
|
|
check-notidy: check-sanitycheck cleantmptestlogs cleantestlibs all check-stage2
|
2013-02-05 22:14:58 +00:00
|
|
|
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
|
|
|
|
|
2014-07-23 22:02:11 +00:00
|
|
|
# A slightly smaller set of tests for smoke testing.
|
2015-05-30 16:22:12 +00:00
|
|
|
check-lite: check-sanitycheck cleantestlibs cleantmptestlogs \
|
2014-06-28 20:57:36 +00:00
|
|
|
$(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
|
2014-10-07 07:00:26 +00:00
|
|
|
check-stage2-rpass check-stage2-rpass-valgrind \
|
2015-02-11 22:09:30 +00:00
|
|
|
check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-rmake
|
2013-02-05 22:14:58 +00:00
|
|
|
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
|
|
|
|
|
2014-07-23 22:02:11 +00:00
|
|
|
# Only check the 'reference' tests: rpass/cfail/rfail/rmake.
|
2015-05-30 16:22:12 +00:00
|
|
|
check-ref: check-sanitycheck cleantestlibs cleantmptestlogs check-stage2-rpass \
|
|
|
|
check-stage2-rpass-valgrind check-stage2-rfail check-stage2-cfail check-stage2-pfail \
|
|
|
|
check-stage2-rmake
|
2014-02-14 11:34:18 +00:00
|
|
|
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
|
|
|
|
|
2014-07-23 22:02:11 +00:00
|
|
|
# Only check the docs.
|
2015-05-30 16:22:12 +00:00
|
|
|
check-docs: check-sanitycheck cleantestlibs cleantmptestlogs check-stage2-docs
|
2014-02-15 03:17:50 +00:00
|
|
|
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
|
|
|
|
|
2014-07-23 22:02:11 +00:00
|
|
|
# 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.
|
2014-11-19 02:11:24 +00:00
|
|
|
check-secondary: check-build-compiletest check-build-lexer-verifier check-lexer check-pretty
|
2014-07-23 21:57:07 +00:00
|
|
|
|
2015-03-24 23:49:51 +00:00
|
|
|
.PHONY: check-sanitycheck
|
|
|
|
|
|
|
|
check-sanitycheck:
|
|
|
|
$(Q)$(CFG_PYTHON) $(S)src/etc/check-sanitycheck.py
|
|
|
|
|
2014-07-23 22:02:11 +00:00
|
|
|
# check + check-secondary.
|
2014-10-13 18:58:34 +00:00
|
|
|
#
|
|
|
|
# Issue #17883: build check-secondary first so hidden dependencies in
|
|
|
|
# e.g. building compiletest are exercised (resolve those by adding
|
|
|
|
# deps to rules that need them; not by putting `check` first here).
|
|
|
|
check-all: check-secondary check
|
2014-07-23 22:02:11 +00:00
|
|
|
|
|
|
|
# Pretty-printing tests.
|
2014-07-23 21:57:07 +00:00
|
|
|
check-pretty: check-stage2-T-$(CFG_BUILD)-H-$(CFG_BUILD)-pretty-exec
|
|
|
|
|
2014-10-13 18:58:34 +00:00
|
|
|
define DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE
|
|
|
|
check-stage$(1)-build-compiletest: $$(HBIN$(1)_H_$(CFG_BUILD))/compiletest$$(X_$(CFG_BUILD))
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach stage,$(STAGES), \
|
|
|
|
$(eval $(call DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE,$(stage))))
|
|
|
|
|
|
|
|
check-build-compiletest: \
|
|
|
|
check-stage1-build-compiletest \
|
|
|
|
check-stage2-build-compiletest
|
|
|
|
|
2012-04-05 00:57:36 +00:00
|
|
|
.PHONY: cleantmptestlogs cleantestlibs
|
|
|
|
|
2012-04-04 20:40:50 +00:00
|
|
|
cleantmptestlogs:
|
|
|
|
$(Q)rm -f tmp/*.log
|
2011-05-05 00:32:05 +00:00
|
|
|
|
2012-04-05 00:57:36 +00:00
|
|
|
cleantestlibs:
|
2013-10-21 09:18:21 +00:00
|
|
|
$(Q)find $(CFG_BUILD)/test \
|
2012-04-05 00:57:36 +00:00
|
|
|
-name '*.[odasS]' -o \
|
2014-07-23 04:37:05 +00:00
|
|
|
-name '*.so' -o \
|
|
|
|
-name '*.dylib' -o \
|
|
|
|
-name '*.dll' -o \
|
|
|
|
-name '*.def' -o \
|
|
|
|
-name '*.bc' -o \
|
|
|
|
-name '*.dSYM' -o \
|
|
|
|
-name '*.libaux' -o \
|
|
|
|
-name '*.out' -o \
|
|
|
|
-name '*.err' -o \
|
2013-02-09 18:09:19 +00:00
|
|
|
-name '*.debugger.script' \
|
2012-04-05 02:21:09 +00:00
|
|
|
| xargs rm -rf
|
2012-04-05 00:57:36 +00:00
|
|
|
|
2011-05-11 16:37:23 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
######################################################################
|
|
|
|
# Tidy
|
|
|
|
######################################################################
|
2012-06-01 19:28:01 +00:00
|
|
|
|
2015-01-24 23:18:19 +00:00
|
|
|
.PHONY: tidy
|
2016-04-13 18:18:35 +00:00
|
|
|
tidy: $(HBIN0_H_$(CFG_BUILD))/tidy$(X_$(CFG_BUILD)) \
|
|
|
|
$(SNAPSHOT_RUSTC_POST_CLEANUP)
|
2016-04-05 18:18:24 +00:00
|
|
|
$(TARGET_RPATH_VAR0_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $< $(S)src
|
2016-03-29 20:14:52 +00:00
|
|
|
|
|
|
|
$(HBIN0_H_$(CFG_BUILD))/tidy$(X_$(CFG_BUILD)): \
|
|
|
|
$(TSREQ0_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
|
|
|
|
$(TLIB0_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.std \
|
2016-04-13 18:18:35 +00:00
|
|
|
$(call rwildcard,$(S)src/tools/tidy/src,*.rs) \
|
|
|
|
$(SNAPSHOT_RUSTC_POST_CLEANUP) | \
|
|
|
|
$(TLIB0_T_$(CFG_BUILD)_H_$(CFG_BUILD))
|
2016-04-05 18:18:24 +00:00
|
|
|
$(STAGE0_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(S)src/tools/tidy/src/main.rs \
|
2016-03-29 20:14:52 +00:00
|
|
|
--out-dir $(@D) --crate-name tidy
|
2013-02-05 22:14:58 +00:00
|
|
|
|
2012-01-21 02:05:07 +00:00
|
|
|
######################################################################
|
2013-02-05 22:14:58 +00:00
|
|
|
# Sets of tests
|
2012-01-21 02:05:07 +00:00
|
|
|
######################################################################
|
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
define DEF_TEST_SETS
|
|
|
|
|
2014-07-23 04:37:05 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-exec: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rpass-exec \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rfail-exec \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
|
2015-02-11 22:09:30 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pfail-exec \
|
2016-02-07 12:03:11 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
|
2014-07-23 04:37:05 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
|
2015-04-06 20:48:17 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rustdocck-exec \
|
2016-02-07 12:03:11 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
|
2014-04-24 09:35:48 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
|
2016-03-28 21:49:02 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-incremental-exec \
|
2013-02-05 22:14:58 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
|
|
|
|
|
2016-03-10 03:11:02 +00:00
|
|
|
ifndef CFG_DISABLE_CODEGEN_TESTS
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-exec: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec
|
|
|
|
endif
|
|
|
|
|
2013-02-22 00:15:01 +00:00
|
|
|
# Only test the compiler-dependent crates when the target is
|
|
|
|
# able to build a compiler (when the target triple is in the set of host triples)
|
2013-10-21 09:18:21 +00:00
|
|
|
ifneq ($$(findstring $(2),$$(CFG_HOST)),)
|
2013-02-22 00:15:01 +00:00
|
|
|
|
2016-03-02 06:00:18 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-exec: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-rfail-full-exec \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec
|
|
|
|
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec: \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-full-exec \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-full-exec
|
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
|
|
|
|
$$(foreach crate,$$(TEST_CRATES), \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
|
|
|
|
|
2013-02-22 00:15:01 +00:00
|
|
|
else
|
|
|
|
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
|
|
|
|
$$(foreach crate,$$(TEST_TARGET_CRATES), \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2013-12-22 21:46:06 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec: \
|
|
|
|
$$(foreach crate,$$(TEST_DOC_CRATES), \
|
2014-03-09 03:55:20 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$$(crate)-exec)
|
2013-12-22 21:46:06 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-doc-exec: \
|
2014-12-02 14:20:48 +00:00
|
|
|
$$(foreach docname,$$(DOC_NAMES), \
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-doc-$$(docname)-exec) \
|
2013-02-05 22:14:58 +00:00
|
|
|
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec: \
|
2014-07-23 04:37:05 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-exec \
|
2014-10-08 02:41:15 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-valgrind-exec \
|
2014-07-23 04:37:05 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-exec \
|
2013-02-05 22:14:58 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-exec
|
2012-03-20 23:49:12 +00:00
|
|
|
|
2012-01-21 02:05:07 +00:00
|
|
|
endef
|
|
|
|
|
2013-10-21 09:18:21 +00:00
|
|
|
$(foreach host,$(CFG_HOST), \
|
|
|
|
$(foreach target,$(CFG_TARGET), \
|
2013-02-05 22:14:58 +00:00
|
|
|
$(foreach stage,$(STAGES), \
|
|
|
|
$(eval $(call DEF_TEST_SETS,$(stage),$(target),$(host))))))
|
|
|
|
|
2012-01-21 02:05:07 +00:00
|
|
|
|
2011-06-29 22:12:02 +00:00
|
|
|
######################################################################
|
2013-02-05 22:14:58 +00:00
|
|
|
# Crate testing
|
2011-06-29 22:12:02 +00:00
|
|
|
######################################################################
|
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
define TEST_RUNNER
|
2012-01-18 00:45:22 +00:00
|
|
|
|
2014-02-13 08:35:43 +00:00
|
|
|
# If NO_REBUILD is set then break the dependencies on everything but
|
|
|
|
# the source files so we can test crates without rebuilding any of the
|
|
|
|
# parent crates.
|
2016-02-02 07:27:04 +00:00
|
|
|
ifeq ($(NO_REBUILD),)
|
2014-02-13 08:35:43 +00:00
|
|
|
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
|
2016-02-08 18:57:41 +00:00
|
|
|
$$(foreach crate,$$(TARGET_CRATES_$(2)), \
|
2014-02-13 08:35:43 +00:00
|
|
|
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
|
|
|
|
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
|
2014-04-29 15:55:40 +00:00
|
|
|
|
2013-03-14 22:37:38 +00:00
|
|
|
else
|
2014-02-13 08:35:43 +00:00
|
|
|
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
|
2013-03-14 22:37:38 +00:00
|
|
|
endif
|
|
|
|
|
2014-03-26 02:23:45 +00:00
|
|
|
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER_HOST_TRIPLE = $(2)
|
2014-07-23 04:37:05 +00:00
|
|
|
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
|
2014-02-13 08:35:43 +00:00
|
|
|
$$(CRATEFILE_$(4)) \
|
|
|
|
$$(TESTDEP_$(1)_$(2)_$(3)_$(4))
|
2014-05-21 05:14:38 +00:00
|
|
|
@$$(call E, rustc: $$@)
|
2015-05-11 19:30:47 +00:00
|
|
|
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
|
2014-11-26 01:03:03 +00:00
|
|
|
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
|
2016-02-18 18:05:13 +00:00
|
|
|
-Cmetadata="test-crate" -L "$$(RT_OUTPUT_DIR_$(2))" \
|
2015-03-13 02:24:59 +00:00
|
|
|
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
|
2015-12-19 10:42:10 +00:00
|
|
|
$$(RUSTFLAGS_$(4))
|
2012-01-16 01:34:18 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
endef
|
|
|
|
|
2013-10-21 09:18:21 +00:00
|
|
|
$(foreach host,$(CFG_HOST), \
|
|
|
|
$(eval $(foreach target,$(CFG_TARGET), \
|
2013-02-05 22:14:58 +00:00
|
|
|
$(eval $(foreach stage,$(STAGES), \
|
2014-01-25 03:27:22 +00:00
|
|
|
$(eval $(foreach crate,$(TEST_CRATES), \
|
|
|
|
$(eval $(call TEST_RUNNER,$(stage),$(target),$(host),$(crate))))))))))
|
2013-02-05 22:14:58 +00:00
|
|
|
|
|
|
|
define DEF_TEST_CRATE_RULES
|
2013-02-06 04:05:00 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
|
|
|
|
|
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
|
2013-05-13 22:19:48 +00:00
|
|
|
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
|
2012-01-16 01:34:18 +00:00
|
|
|
@$$(call E, run: $$<)
|
2015-03-03 14:11:01 +00:00
|
|
|
$$(Q)touch $$@.start_time
|
2014-06-11 21:52:38 +00:00
|
|
|
$$(Q)$$(call CFG_RUN_TEST_$(2),$$<,$(1),$(2),$(3)) $$(TESTARGS) \
|
2013-12-13 02:07:23 +00:00
|
|
|
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
|
|
|
|
$$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) \
|
2015-03-03 14:11:01 +00:00
|
|
|
&& touch -r $$@.start_time $$@ && rm $$@.start_time
|
2013-02-05 22:14:58 +00:00
|
|
|
endef
|
2012-01-16 01:34:18 +00:00
|
|
|
|
2015-01-22 12:39:06 +00:00
|
|
|
define DEF_TEST_CRATE_RULES_android
|
2013-05-01 09:50:23 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
|
|
|
|
|
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
|
2013-05-13 22:19:48 +00:00
|
|
|
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
|
2013-05-01 09:50:23 +00:00
|
|
|
@$$(call E, run: $$< via adb)
|
2015-03-03 14:11:01 +00:00
|
|
|
$$(Q)touch $$@.start_time
|
2014-01-14 03:44:18 +00:00
|
|
|
$$(Q)$(CFG_ADB) push $$< $(CFG_ADB_TEST_DIR)
|
2015-02-02 08:42:23 +00:00
|
|
|
$$(Q)$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=./$(2) \
|
2013-08-20 07:50:45 +00:00
|
|
|
./$$(notdir $$<) \
|
2013-08-20 10:07:36 +00:00
|
|
|
--logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log \
|
2014-01-14 03:44:18 +00:00
|
|
|
$$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) $(TESTARGS))' \
|
2013-08-20 07:50:45 +00:00
|
|
|
> tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
|
2014-01-14 03:44:18 +00:00
|
|
|
$$(Q)cat tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
|
|
|
|
$$(Q)touch tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
|
|
|
|
$$(Q)$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log tmp/
|
|
|
|
$$(Q)$(CFG_ADB) shell rm $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
|
2013-05-01 09:50:23 +00:00
|
|
|
@if grep -q "result: ok" tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
|
|
|
|
then \
|
|
|
|
rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
|
2015-03-03 14:11:01 +00:00
|
|
|
touch -r $$@.start_time $$@ && rm $$@.start_time; \
|
2013-05-01 09:50:23 +00:00
|
|
|
else \
|
|
|
|
rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
|
|
|
|
exit 101; \
|
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
|
|
|
define DEF_TEST_CRATE_RULES_null
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
|
|
|
|
|
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
|
2013-05-13 22:19:48 +00:00
|
|
|
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
|
2013-12-15 06:42:01 +00:00
|
|
|
@$$(call E, failing: no device for $$< )
|
|
|
|
false
|
2013-05-01 09:50:23 +00:00
|
|
|
endef
|
|
|
|
|
2013-10-21 09:18:21 +00:00
|
|
|
$(foreach host,$(CFG_HOST), \
|
|
|
|
$(foreach target,$(CFG_TARGET), \
|
2013-02-05 22:14:58 +00:00
|
|
|
$(foreach stage,$(STAGES), \
|
|
|
|
$(foreach crate, $(TEST_CRATES), \
|
2013-10-21 09:18:21 +00:00
|
|
|
$(if $(findstring $(target),$(CFG_BUILD)), \
|
2013-05-01 09:50:23 +00:00
|
|
|
$(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))), \
|
2015-02-03 04:42:05 +00:00
|
|
|
$(if $(findstring android, $(target)), \
|
2016-02-02 07:27:04 +00:00
|
|
|
$(if $(findstring $(CFG_ADB_DEVICE_STATUS),"true"), \
|
2015-01-22 12:39:06 +00:00
|
|
|
$(eval $(call DEF_TEST_CRATE_RULES_android,$(stage),$(target),$(host),$(crate))), \
|
2013-05-01 09:50:23 +00:00
|
|
|
$(eval $(call DEF_TEST_CRATE_RULES_null,$(stage),$(target),$(host),$(crate))) \
|
|
|
|
), \
|
2013-05-03 15:49:18 +00:00
|
|
|
$(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))) \
|
2013-05-07 01:09:34 +00:00
|
|
|
))))))
|
2012-10-03 01:15:02 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
######################################################################
|
|
|
|
# Rules for the compiletest tests (rpass, rfail, etc.)
|
|
|
|
######################################################################
|
|
|
|
|
2016-02-18 10:20:16 +00:00
|
|
|
RPASS_RS := $(call rwildcard,$(S)src/test/run-pass/,*.rs)
|
|
|
|
RPASS_VALGRIND_RS := $(call rwildcard,$(S)src/test/run-pass-valgrind/,*.rs)
|
|
|
|
RPASS_FULL_RS := $(call rwildcard,$(S)src/test/run-pass-fulldeps/,*.rs)
|
|
|
|
RFAIL_FULL_RS := $(call rwildcard,$(S)src/test/run-fail-fulldeps/,*.rs)
|
|
|
|
CFAIL_FULL_RS := $(call rwildcard,$(S)src/test/compile-fail-fulldeps/,*.rs)
|
|
|
|
RFAIL_RS := $(call rwildcard,$(S)src/test/run-fail/,*.rs)
|
|
|
|
RFAIL_RS := $(call rwildcard,$(S)src/test/run-fail/,*.rs)
|
|
|
|
CFAIL_RS := $(call rwildcard,$(S)src/test/compile-fail/,*.rs)
|
|
|
|
PFAIL_RS := $(call rwildcard,$(S)src/test/parse-fail/,*.rs)
|
|
|
|
PRETTY_RS := $(call rwildcard,$(S)src/test/pretty/,*.rs)
|
|
|
|
DEBUGINFO_GDB_RS := $(call rwildcard,$(S)src/test/debuginfo/,*.rs)
|
|
|
|
DEBUGINFO_LLDB_RS := $(call rwildcard,$(S)src/test/debuginfo/,*.rs)
|
|
|
|
CODEGEN_RS := $(call rwildcard,$(S)src/test/codegen/,*.rs)
|
|
|
|
CODEGEN_CC := $(call rwildcard,$(S)src/test/codegen/,*.cc)
|
|
|
|
CODEGEN_UNITS_RS := $(call rwildcard,$(S)src/test/codegen-units/,*.rs)
|
2016-03-28 21:49:02 +00:00
|
|
|
INCREMENTAL_RS := $(call rwildcard,$(S)src/test/incremental/,*.rs)
|
2016-04-14 22:51:03 +00:00
|
|
|
RMAKE_RS := $(wildcard $(S)src/test/run-make/*/Makefile)
|
2016-02-18 10:20:16 +00:00
|
|
|
RUSTDOCCK_RS := $(call rwildcard,$(S)src/test/rustdoc/,*.rs)
|
2012-10-03 01:15:02 +00:00
|
|
|
|
2014-10-08 03:30:20 +00:00
|
|
|
RPASS_TESTS := $(RPASS_RS)
|
|
|
|
RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RS)
|
|
|
|
RPASS_FULL_TESTS := $(RPASS_FULL_RS)
|
2015-04-26 01:30:47 +00:00
|
|
|
RFAIL_FULL_TESTS := $(RFAIL_FULL_RS)
|
2014-10-08 03:30:20 +00:00
|
|
|
CFAIL_FULL_TESTS := $(CFAIL_FULL_RS)
|
|
|
|
RFAIL_TESTS := $(RFAIL_RS)
|
2015-02-11 22:09:30 +00:00
|
|
|
CFAIL_TESTS := $(CFAIL_RS)
|
|
|
|
PFAIL_TESTS := $(PFAIL_RS)
|
2013-02-05 22:14:58 +00:00
|
|
|
PRETTY_TESTS := $(PRETTY_RS)
|
2014-04-24 09:35:48 +00:00
|
|
|
DEBUGINFO_GDB_TESTS := $(DEBUGINFO_GDB_RS)
|
|
|
|
DEBUGINFO_LLDB_TESTS := $(DEBUGINFO_LLDB_RS)
|
2013-07-06 08:03:03 +00:00
|
|
|
CODEGEN_TESTS := $(CODEGEN_RS) $(CODEGEN_CC)
|
2015-11-02 13:46:39 +00:00
|
|
|
CODEGEN_UNITS_TESTS := $(CODEGEN_UNITS_RS)
|
2016-03-28 21:49:02 +00:00
|
|
|
INCREMENTAL_TESTS := $(INCREMENTAL_RS)
|
2016-04-14 22:51:03 +00:00
|
|
|
RMAKE_TESTS := $(RMAKE_RS)
|
2015-04-06 20:48:17 +00:00
|
|
|
RUSTDOCCK_TESTS := $(RUSTDOCCK_RS)
|
2012-06-03 04:30:26 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
CTEST_SRC_BASE_rpass = run-pass
|
|
|
|
CTEST_BUILD_BASE_rpass = run-pass
|
|
|
|
CTEST_MODE_rpass = run-pass
|
|
|
|
CTEST_RUNTOOL_rpass = $(CTEST_RUNTOOL)
|
2012-06-03 04:30:26 +00:00
|
|
|
|
2014-10-07 07:00:26 +00:00
|
|
|
CTEST_SRC_BASE_rpass-valgrind = run-pass-valgrind
|
|
|
|
CTEST_BUILD_BASE_rpass-valgrind = run-pass-valgrind
|
|
|
|
CTEST_MODE_rpass-valgrind = run-pass-valgrind
|
|
|
|
CTEST_RUNTOOL_rpass-valgrind = $(CTEST_RUNTOOL)
|
|
|
|
|
2013-10-26 00:04:37 +00:00
|
|
|
CTEST_SRC_BASE_rpass-full = run-pass-fulldeps
|
|
|
|
CTEST_BUILD_BASE_rpass-full = run-pass-fulldeps
|
2013-02-05 22:14:58 +00:00
|
|
|
CTEST_MODE_rpass-full = run-pass
|
|
|
|
CTEST_RUNTOOL_rpass-full = $(CTEST_RUNTOOL)
|
|
|
|
|
2015-04-26 01:30:47 +00:00
|
|
|
CTEST_SRC_BASE_rfail-full = run-fail-fulldeps
|
|
|
|
CTEST_BUILD_BASE_rfail-full = run-fail-fulldeps
|
|
|
|
CTEST_MODE_rfail-full = run-fail
|
|
|
|
CTEST_RUNTOOL_rfail-full = $(CTEST_RUNTOOL)
|
|
|
|
|
2014-04-29 00:31:43 +00:00
|
|
|
CTEST_SRC_BASE_cfail-full = compile-fail-fulldeps
|
|
|
|
CTEST_BUILD_BASE_cfail-full = compile-fail-fulldeps
|
|
|
|
CTEST_MODE_cfail-full = compile-fail
|
|
|
|
CTEST_RUNTOOL_cfail-full = $(CTEST_RUNTOOL)
|
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
CTEST_SRC_BASE_rfail = run-fail
|
|
|
|
CTEST_BUILD_BASE_rfail = run-fail
|
|
|
|
CTEST_MODE_rfail = run-fail
|
|
|
|
CTEST_RUNTOOL_rfail = $(CTEST_RUNTOOL)
|
|
|
|
|
|
|
|
CTEST_SRC_BASE_cfail = compile-fail
|
|
|
|
CTEST_BUILD_BASE_cfail = compile-fail
|
|
|
|
CTEST_MODE_cfail = compile-fail
|
|
|
|
CTEST_RUNTOOL_cfail = $(CTEST_RUNTOOL)
|
|
|
|
|
2015-02-11 22:09:30 +00:00
|
|
|
CTEST_SRC_BASE_pfail = parse-fail
|
|
|
|
CTEST_BUILD_BASE_pfail = parse-fail
|
|
|
|
CTEST_MODE_pfail = parse-fail
|
|
|
|
CTEST_RUNTOOL_pfail = $(CTEST_RUNTOOL)
|
|
|
|
|
2014-04-24 09:35:48 +00:00
|
|
|
CTEST_SRC_BASE_debuginfo-gdb = debuginfo
|
|
|
|
CTEST_BUILD_BASE_debuginfo-gdb = debuginfo-gdb
|
|
|
|
CTEST_MODE_debuginfo-gdb = debuginfo-gdb
|
|
|
|
CTEST_RUNTOOL_debuginfo-gdb = $(CTEST_RUNTOOL)
|
|
|
|
|
|
|
|
CTEST_SRC_BASE_debuginfo-lldb = debuginfo
|
|
|
|
CTEST_BUILD_BASE_debuginfo-lldb = debuginfo-lldb
|
|
|
|
CTEST_MODE_debuginfo-lldb = debuginfo-lldb
|
|
|
|
CTEST_RUNTOOL_debuginfo-lldb = $(CTEST_RUNTOOL)
|
2013-02-09 18:09:19 +00:00
|
|
|
|
2013-07-06 08:03:03 +00:00
|
|
|
CTEST_SRC_BASE_codegen = codegen
|
|
|
|
CTEST_BUILD_BASE_codegen = codegen
|
|
|
|
CTEST_MODE_codegen = codegen
|
|
|
|
CTEST_RUNTOOL_codegen = $(CTEST_RUNTOOL)
|
|
|
|
|
2015-11-02 13:46:39 +00:00
|
|
|
CTEST_SRC_BASE_codegen-units = codegen-units
|
|
|
|
CTEST_BUILD_BASE_codegen-units = codegen-units
|
|
|
|
CTEST_MODE_codegen-units = codegen-units
|
|
|
|
CTEST_RUNTOOL_codegen-units = $(CTEST_RUNTOOL)
|
|
|
|
|
2016-03-28 21:49:02 +00:00
|
|
|
CTEST_SRC_BASE_incremental = incremental
|
|
|
|
CTEST_BUILD_BASE_incremental = incremental
|
|
|
|
CTEST_MODE_incremental = incremental
|
|
|
|
CTEST_RUNTOOL_incremental = $(CTEST_RUNTOOL)
|
|
|
|
|
2016-04-14 22:51:03 +00:00
|
|
|
CTEST_SRC_BASE_rmake = run-make
|
|
|
|
CTEST_BUILD_BASE_rmake = run-make
|
|
|
|
CTEST_MODE_rmake = run-make
|
|
|
|
CTEST_RUNTOOL_rmake = $(CTEST_RUNTOOL)
|
|
|
|
|
2015-04-06 20:48:17 +00:00
|
|
|
CTEST_SRC_BASE_rustdocck = rustdoc
|
|
|
|
CTEST_BUILD_BASE_rustdocck = rustdoc
|
|
|
|
CTEST_MODE_rustdocck = rustdoc
|
|
|
|
CTEST_RUNTOOL_rustdocck = $(CTEST_RUNTOOL)
|
|
|
|
|
2014-04-02 17:25:29 +00:00
|
|
|
# CTEST_DISABLE_$(TEST_GROUP), if set, will cause the test group to be
|
|
|
|
# disabled and the associated message to be printed as a warning
|
|
|
|
# during attempts to run those tests.
|
|
|
|
|
2013-02-10 22:17:28 +00:00
|
|
|
ifeq ($(CFG_GDB),)
|
2014-04-24 09:35:48 +00:00
|
|
|
CTEST_DISABLE_debuginfo-gdb = "no gdb found"
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CFG_LLDB),)
|
|
|
|
CTEST_DISABLE_debuginfo-lldb = "no lldb found"
|
2013-02-10 22:17:28 +00:00
|
|
|
endif
|
|
|
|
|
2014-10-16 08:09:16 +00:00
|
|
|
ifneq ($(CFG_OSTYPE),apple-darwin)
|
|
|
|
CTEST_DISABLE_debuginfo-lldb = "lldb tests are only run on darwin"
|
|
|
|
endif
|
|
|
|
|
2013-03-12 18:58:50 +00:00
|
|
|
ifeq ($(CFG_OSTYPE),apple-darwin)
|
2014-11-30 14:07:36 +00:00
|
|
|
CTEST_DISABLE_debuginfo-gdb = "gdb on darwin needs root"
|
2013-03-12 18:58:50 +00:00
|
|
|
endif
|
|
|
|
|
2015-03-25 09:12:35 +00:00
|
|
|
ifeq ($(findstring android, $(CFG_TARGET)), android)
|
|
|
|
CTEST_DISABLE_debuginfo-gdb =
|
|
|
|
CTEST_DISABLE_debuginfo-lldb = "lldb tests are disabled on android"
|
|
|
|
endif
|
|
|
|
|
2015-08-11 18:48:43 +00:00
|
|
|
ifeq ($(findstring msvc,$(CFG_TARGET)),msvc)
|
|
|
|
CTEST_DISABLE_debuginfo-gdb = "gdb tests are disabled on MSVC"
|
|
|
|
endif
|
|
|
|
|
2014-04-02 17:25:29 +00:00
|
|
|
# CTEST_DISABLE_NONSELFHOST_$(TEST_GROUP), if set, will cause that
|
|
|
|
# test group to be disabled *unless* the target is able to build a
|
2015-12-03 23:29:00 +00:00
|
|
|
# compiler (i.e. when the target triple is in the set of host
|
2014-04-02 17:25:29 +00:00
|
|
|
# triples). The associated message will be printed as a warning
|
|
|
|
# during attempts to run those tests.
|
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
define DEF_CTEST_VARS
|
|
|
|
|
|
|
|
# All the per-stage build rules you might want to call from the
|
|
|
|
# command line.
|
|
|
|
#
|
|
|
|
# $(1) is the stage number
|
|
|
|
# $(2) is the target triple to test
|
|
|
|
# $(3) is the host triple to test
|
|
|
|
|
|
|
|
# Prerequisites for compiletest tests
|
|
|
|
TEST_SREQ$(1)_T_$(2)_H_$(3) = \
|
2013-03-02 12:25:12 +00:00
|
|
|
$$(HBIN$(1)_H_$(3))/compiletest$$(X_$(3)) \
|
2013-02-05 22:14:58 +00:00
|
|
|
$$(SREQ$(1)_T_$(2)_H_$(3))
|
2012-06-03 04:30:26 +00:00
|
|
|
|
2016-01-29 02:44:45 +00:00
|
|
|
# Rules for the cfail/rfail/rpass test runner
|
2011-08-01 21:10:59 +00:00
|
|
|
|
2013-07-24 09:26:52 +00:00
|
|
|
# The tests select when to use debug configuration on their own;
|
|
|
|
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
|
2015-03-11 19:03:25 +00:00
|
|
|
CTEST_RUSTC_FLAGS := $$(subst -C debug-assertions,,$$(subst -C debug-assertions=on,,$$(CFG_RUSTC_FLAGS)))
|
2013-08-11 07:29:45 +00:00
|
|
|
|
2014-10-07 07:00:26 +00:00
|
|
|
# The tests cannot be optimized while the rest of the compiler is optimized, so
|
2013-08-11 07:29:45 +00:00
|
|
|
# filter out the optimization (if any) from rustc and then figure out if we need
|
|
|
|
# to be optimized
|
|
|
|
CTEST_RUSTC_FLAGS := $$(subst -O,,$$(CTEST_RUSTC_FLAGS))
|
|
|
|
ifndef CFG_DISABLE_OPTIMIZE_TESTS
|
|
|
|
CTEST_RUSTC_FLAGS += -O
|
|
|
|
endif
|
2013-07-24 09:26:52 +00:00
|
|
|
|
2015-04-29 15:18:44 +00:00
|
|
|
# Analogously to the above, whether to pass `-g` when compiling tests
|
|
|
|
# is a separate choice from whether to pass `-g` when building the
|
|
|
|
# compiler and standard library themselves.
|
|
|
|
CTEST_RUSTC_FLAGS := $$(subst -g,,$$(CTEST_RUSTC_FLAGS))
|
|
|
|
ifdef CFG_ENABLE_DEBUGINFO_TESTS
|
|
|
|
CTEST_RUSTC_FLAGS += -g
|
|
|
|
endif
|
2014-10-07 07:00:26 +00:00
|
|
|
|
2014-07-23 04:37:05 +00:00
|
|
|
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
|
|
|
|
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
|
|
|
|
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
|
|
|
|
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
|
2015-04-06 20:48:17 +00:00
|
|
|
--rustdoc-path $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
|
2016-04-05 18:34:23 +00:00
|
|
|
--llvm-filecheck $(CFG_LLVM_INST_DIR_$(CFG_BUILD))/bin/FileCheck \
|
2014-07-23 04:37:05 +00:00
|
|
|
--aux-base $$(S)src/test/auxiliary/ \
|
|
|
|
--stage-id stage$(1)-$(2) \
|
|
|
|
--target $(2) \
|
|
|
|
--host $(3) \
|
2016-04-19 16:44:19 +00:00
|
|
|
--docck-python $$(CFG_PYTHON) \
|
|
|
|
--lldb-python $$(CFG_LLDB_PYTHON) \
|
2014-08-20 10:53:50 +00:00
|
|
|
--gdb-version="$(CFG_GDB_VERSION)" \
|
2014-10-02 09:35:24 +00:00
|
|
|
--lldb-version="$(CFG_LLDB_VERSION)" \
|
2016-04-26 01:35:58 +00:00
|
|
|
--android-cross-path=$(CFG_ARM_LINUX_ANDROIDEABI_NDK) \
|
2014-07-23 04:37:05 +00:00
|
|
|
--adb-path=$(CFG_ADB) \
|
|
|
|
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
|
2015-12-19 10:42:10 +00:00
|
|
|
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \
|
2014-04-24 09:35:48 +00:00
|
|
|
--lldb-python-dir=$(CFG_LLDB_PYTHON_DIR) \
|
2015-12-19 10:42:10 +00:00
|
|
|
--target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \
|
2016-04-14 22:51:03 +00:00
|
|
|
--cc '$$(CC_$(3))' \
|
|
|
|
--cxx '$$(CXX_$(3))' \
|
|
|
|
--cflags "$$(CFG_GCCISH_CFLAGS_$(3))" \
|
|
|
|
--llvm-components "$$(LLVM_ALL_COMPONENTS_$(3))" \
|
|
|
|
--llvm-cxxflags "$$(LLVM_CXXFLAGS_$(3))" \
|
2011-11-21 21:11:40 +00:00
|
|
|
$$(CTEST_TESTARGS)
|
|
|
|
|
2014-10-08 23:11:37 +00:00
|
|
|
ifdef CFG_VALGRIND_RPASS
|
|
|
|
ifdef GOOD_VALGRIND_$(2)
|
|
|
|
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) += --valgrind-path "$(CFG_VALGRIND_RPASS)"
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef CFG_DISABLE_VALGRIND_RPASS
|
|
|
|
ifdef GOOD_VALGRIND_$(2)
|
|
|
|
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) += --force-valgrind
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2013-02-06 04:05:00 +00:00
|
|
|
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
|
2014-10-07 07:00:26 +00:00
|
|
|
CTEST_DEPS_rpass-valgrind_$(1)-T-$(2)-H-$(3) = $$(RPASS_VALGRIND_TESTS)
|
2014-04-17 15:52:25 +00:00
|
|
|
CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
|
2015-04-26 01:30:47 +00:00
|
|
|
CTEST_DEPS_rfail-full_$(1)-T-$(2)-H-$(3) = $$(RFAIL_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
|
2014-04-29 00:31:43 +00:00
|
|
|
CTEST_DEPS_cfail-full_$(1)-T-$(2)-H-$(3) = $$(CFAIL_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
|
2013-02-06 04:05:00 +00:00
|
|
|
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
|
|
|
|
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
|
2015-02-11 22:09:30 +00:00
|
|
|
CTEST_DEPS_pfail_$(1)-T-$(2)-H-$(3) = $$(PFAIL_TESTS)
|
2014-04-24 09:35:48 +00:00
|
|
|
CTEST_DEPS_debuginfo-gdb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_GDB_TESTS)
|
2014-11-05 09:53:07 +00:00
|
|
|
CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_LLDB_TESTS) \
|
|
|
|
$(S)src/etc/lldb_batchmode.py \
|
|
|
|
$(S)src/etc/lldb_rust_formatters.py
|
2013-07-06 08:03:03 +00:00
|
|
|
CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_TESTS)
|
2015-11-02 13:46:39 +00:00
|
|
|
CTEST_DEPS_codegen-units_$(1)-T-$(2)-H-$(3) = $$(CODEGEN_UNITS_TESTS)
|
2016-03-28 21:49:02 +00:00
|
|
|
CTEST_DEPS_incremental_$(1)-T-$(2)-H-$(3) = $$(INCREMENTAL_TESTS)
|
2016-04-14 22:51:03 +00:00
|
|
|
CTEST_DEPS_rmake_$(1)-T-$(2)-H-$(3) = $$(RMAKE_TESTS) \
|
|
|
|
$$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
|
|
|
|
|
2015-04-06 20:48:17 +00:00
|
|
|
CTEST_DEPS_rustdocck_$(1)-T-$(2)-H-$(3) = $$(RUSTDOCCK_TESTS) \
|
2016-02-07 12:03:11 +00:00
|
|
|
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
|
|
|
|
$(S)src/etc/htmldocck.py
|
2011-11-21 21:11:40 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
endef
|
2011-11-21 21:11:40 +00:00
|
|
|
|
2013-10-21 09:18:21 +00:00
|
|
|
$(foreach host,$(CFG_HOST), \
|
|
|
|
$(eval $(foreach target,$(CFG_TARGET), \
|
2013-02-05 22:14:58 +00:00
|
|
|
$(eval $(foreach stage,$(STAGES), \
|
|
|
|
$(eval $(call DEF_CTEST_VARS,$(stage),$(target),$(host))))))))
|
2011-11-21 21:11:40 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
define DEF_RUN_COMPILETEST
|
2012-06-01 23:01:53 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
|
2014-07-23 04:37:05 +00:00
|
|
|
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
|
2013-08-30 20:17:29 +00:00
|
|
|
--src-base $$(S)src/test/$$(CTEST_SRC_BASE_$(4))/ \
|
2013-02-05 22:14:58 +00:00
|
|
|
--build-base $(3)/test/$$(CTEST_BUILD_BASE_$(4))/ \
|
|
|
|
--mode $$(CTEST_MODE_$(4)) \
|
|
|
|
$$(CTEST_RUNTOOL_$(4))
|
2011-11-21 21:11:40 +00:00
|
|
|
|
2013-02-06 04:05:00 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
|
|
|
|
|
2014-04-02 17:25:29 +00:00
|
|
|
# CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)
|
|
|
|
# Goal: leave this variable as empty string if we should run the test.
|
|
|
|
# Otherwise, set it to the reason we are not running the test.
|
|
|
|
# (Encoded as a separate variable because GNU make does not have a
|
|
|
|
# good way to express OR on ifeq commands)
|
2013-02-10 22:17:28 +00:00
|
|
|
|
2016-02-02 07:27:04 +00:00
|
|
|
ifneq ($$(CTEST_DISABLE_$(4)),)
|
2014-04-02 17:25:29 +00:00
|
|
|
# Test suite is disabled for all configured targets.
|
|
|
|
CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_$(4))
|
|
|
|
else
|
|
|
|
# else, check if non-self-hosted target (i.e. target not-in hosts) ...
|
|
|
|
ifeq ($$(findstring $(2),$$(CFG_HOST)),)
|
|
|
|
# ... if so, then check if this test suite is disabled for non-selfhosts.
|
2016-02-02 07:27:04 +00:00
|
|
|
ifneq ($$(CTEST_DISABLE_NONSELFHOST_$(4)),)
|
2014-04-02 17:25:29 +00:00
|
|
|
# Test suite is disabled for this target.
|
|
|
|
CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4) := $$(CTEST_DISABLE_NONSELFHOST_$(4))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
# Neither DISABLE nor DISABLE_NONSELFHOST is set ==> okay, run the test.
|
|
|
|
endif
|
|
|
|
|
2016-02-02 07:27:04 +00:00
|
|
|
ifeq ($$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)),)
|
2016-04-14 22:51:03 +00:00
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
|
|
|
|
export INCLUDE := $$(CFG_MSVC_INCLUDE_PATH_$$(HOST_$(3)))
|
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
|
|
|
|
export LIB := $$(CFG_MSVC_LIB_PATH_$$(HOST_$(3)))
|
2013-02-06 04:05:00 +00:00
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
|
2013-02-05 22:14:58 +00:00
|
|
|
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
|
|
|
|
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
|
2013-05-01 09:50:23 +00:00
|
|
|
@$$(call E, run $(4) [$(2)]: $$<)
|
2015-03-03 14:11:01 +00:00
|
|
|
$$(Q)touch $$@.start_time
|
2013-03-02 12:25:12 +00:00
|
|
|
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
|
2013-02-05 22:14:58 +00:00
|
|
|
$$(CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
|
2013-02-06 04:05:00 +00:00
|
|
|
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
|
2015-03-03 14:11:01 +00:00
|
|
|
&& touch -r $$@.start_time $$@ && rm $$@.start_time
|
2011-11-21 21:11:40 +00:00
|
|
|
|
2013-02-10 22:17:28 +00:00
|
|
|
else
|
|
|
|
|
2014-04-02 17:25:29 +00:00
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)):
|
2013-05-01 09:50:23 +00:00
|
|
|
@$$(call E, run $(4) [$(2)]: $$<)
|
2014-04-02 17:25:29 +00:00
|
|
|
@$$(call E, warning: tests disabled: $$(CTEST_DONT_RUN_$(1)-T-$(2)-H-$(3)-$(4)))
|
2013-02-10 22:17:28 +00:00
|
|
|
touch $$@
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
endef
|
2011-11-22 06:45:14 +00:00
|
|
|
|
2015-04-26 01:30:47 +00:00
|
|
|
CTEST_NAMES = rpass rpass-valgrind rpass-full rfail-full cfail-full rfail cfail pfail \
|
2016-04-14 22:51:03 +00:00
|
|
|
debuginfo-gdb debuginfo-lldb codegen codegen-units rustdocck incremental \
|
|
|
|
rmake
|
2012-06-01 23:01:53 +00:00
|
|
|
|
2013-10-21 09:18:21 +00:00
|
|
|
$(foreach host,$(CFG_HOST), \
|
|
|
|
$(eval $(foreach target,$(CFG_TARGET), \
|
2013-02-05 22:14:58 +00:00
|
|
|
$(eval $(foreach stage,$(STAGES), \
|
|
|
|
$(eval $(foreach name,$(CTEST_NAMES), \
|
|
|
|
$(eval $(call DEF_RUN_COMPILETEST,$(stage),$(target),$(host),$(name))))))))))
|
|
|
|
|
2015-04-26 01:30:47 +00:00
|
|
|
PRETTY_NAMES = pretty-rpass pretty-rpass-valgrind pretty-rpass-full pretty-rfail-full pretty-rfail \
|
2016-01-29 02:44:45 +00:00
|
|
|
pretty-pretty
|
2013-02-05 22:14:58 +00:00
|
|
|
PRETTY_DEPS_pretty-rpass = $(RPASS_TESTS)
|
2014-10-08 02:41:15 +00:00
|
|
|
PRETTY_DEPS_pretty-rpass-valgrind = $(RPASS_VALGRIND_TESTS)
|
2013-02-05 22:14:58 +00:00
|
|
|
PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS)
|
2015-04-26 01:30:47 +00:00
|
|
|
PRETTY_DEPS_pretty-rfail-full = $(RFAIL_FULL_TESTS)
|
2013-02-05 22:14:58 +00:00
|
|
|
PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS)
|
|
|
|
PRETTY_DEPS_pretty-pretty = $(PRETTY_TESTS)
|
|
|
|
PRETTY_DIRNAME_pretty-rpass = run-pass
|
2014-10-08 02:41:15 +00:00
|
|
|
PRETTY_DIRNAME_pretty-rpass-valgrind = run-pass-valgrind
|
2013-10-26 00:04:37 +00:00
|
|
|
PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps
|
2015-04-26 01:30:47 +00:00
|
|
|
PRETTY_DIRNAME_pretty-rfail-full = run-fail-fulldeps
|
2013-02-05 22:14:58 +00:00
|
|
|
PRETTY_DIRNAME_pretty-rfail = run-fail
|
|
|
|
PRETTY_DIRNAME_pretty-pretty = pretty
|
|
|
|
|
Fix the dependency for the pretty-rpass-full tests
The current code attempts to define the
PRETTY_DEPS$(1)_H_$(3)_pretty-rpass-full variable, which does not work,
because $(1) and $(3) are not inside a function. Moreover, there is a test
(run-pass-fulldeps/compiler-calls.rs) that uses rustc_driver, which is not
an indirect dependency of librustc or libsyntax. Listing all the
dependencies will be hard to maintain, but there's a better way to do
this...
As with the rpass-full and cfail-full tests, add dependencies using the
$$(CSREQ$(1)_T_$(3)_H_$(3)) variable, which includes the complete set of
host and target crates, built for a particular stage and host. We use
T_$(3), not T_$(2), because we only build LLVM for host triples (not
target triples), so we can only build rustc_llvm for host triples. The
fulldeps tests that use plugins need host rustc crates, whereas fulldeps
tests that link against rustc and run should be skipped for
cross-compilation (such as Android).
Fixes #22021
2015-04-17 12:05:22 +00:00
|
|
|
define DEF_PRETTY_FULLDEPS
|
|
|
|
PRETTY_DEPS$(1)_T_$(2)_H_$(3)_pretty-rpass-full = $$(CSREQ$(1)_T_$(3)_H_$(3))
|
2015-04-26 01:30:47 +00:00
|
|
|
PRETTY_DEPS$(1)_T_$(2)_H_$(3)_pretty-rfail-full = $$(CSREQ$(1)_T_$(3)_H_$(3))
|
Fix the dependency for the pretty-rpass-full tests
The current code attempts to define the
PRETTY_DEPS$(1)_H_$(3)_pretty-rpass-full variable, which does not work,
because $(1) and $(3) are not inside a function. Moreover, there is a test
(run-pass-fulldeps/compiler-calls.rs) that uses rustc_driver, which is not
an indirect dependency of librustc or libsyntax. Listing all the
dependencies will be hard to maintain, but there's a better way to do
this...
As with the rpass-full and cfail-full tests, add dependencies using the
$$(CSREQ$(1)_T_$(3)_H_$(3)) variable, which includes the complete set of
host and target crates, built for a particular stage and host. We use
T_$(3), not T_$(2), because we only build LLVM for host triples (not
target triples), so we can only build rustc_llvm for host triples. The
fulldeps tests that use plugins need host rustc crates, whereas fulldeps
tests that link against rustc and run should be skipped for
cross-compilation (such as Android).
Fixes #22021
2015-04-17 12:05:22 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach host,$(CFG_HOST), \
|
|
|
|
$(foreach target,$(CFG_TARGET), \
|
|
|
|
$(foreach stage,$(STAGES), \
|
|
|
|
$(eval $(call DEF_PRETTY_FULLDEPS,$(stage),$(target),$(host))))))
|
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
define DEF_RUN_PRETTY_TEST
|
|
|
|
|
2014-07-23 04:37:05 +00:00
|
|
|
PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
|
|
|
|
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
|
2013-02-05 22:14:58 +00:00
|
|
|
--src-base $$(S)src/test/$$(PRETTY_DIRNAME_$(4))/ \
|
|
|
|
--build-base $(3)/test/$$(PRETTY_DIRNAME_$(4))/ \
|
2011-11-22 06:45:14 +00:00
|
|
|
--mode pretty
|
|
|
|
|
2013-02-06 04:05:00 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
|
|
|
|
|
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
|
2014-07-23 04:37:05 +00:00
|
|
|
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
|
2014-10-13 18:58:34 +00:00
|
|
|
$$(PRETTY_DEPS_$(4)) \
|
Fix the dependency for the pretty-rpass-full tests
The current code attempts to define the
PRETTY_DEPS$(1)_H_$(3)_pretty-rpass-full variable, which does not work,
because $(1) and $(3) are not inside a function. Moreover, there is a test
(run-pass-fulldeps/compiler-calls.rs) that uses rustc_driver, which is not
an indirect dependency of librustc or libsyntax. Listing all the
dependencies will be hard to maintain, but there's a better way to do
this...
As with the rpass-full and cfail-full tests, add dependencies using the
$$(CSREQ$(1)_T_$(3)_H_$(3)) variable, which includes the complete set of
host and target crates, built for a particular stage and host. We use
T_$(3), not T_$(2), because we only build LLVM for host triples (not
target triples), so we can only build rustc_llvm for host triples. The
fulldeps tests that use plugins need host rustc crates, whereas fulldeps
tests that link against rustc and run should be skipped for
cross-compilation (such as Android).
Fixes #22021
2015-04-17 12:05:22 +00:00
|
|
|
$$(PRETTY_DEPS$(1)_T_$(2)_H_$(3)_$(4))
|
2013-05-01 09:50:23 +00:00
|
|
|
@$$(call E, run pretty-rpass [$(2)]: $$<)
|
2015-03-03 14:11:01 +00:00
|
|
|
$$(Q)touch $$@.start_time
|
2013-03-02 12:25:12 +00:00
|
|
|
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
|
2013-02-05 22:14:58 +00:00
|
|
|
$$(PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
|
2013-02-06 04:05:00 +00:00
|
|
|
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
|
2015-03-03 14:11:01 +00:00
|
|
|
&& touch -r $$@.start_time $$@ && rm $$@.start_time
|
2011-11-22 06:45:14 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
endef
|
2011-11-22 06:45:14 +00:00
|
|
|
|
2013-10-21 09:18:21 +00:00
|
|
|
$(foreach host,$(CFG_HOST), \
|
|
|
|
$(foreach target,$(CFG_TARGET), \
|
2013-02-05 22:14:58 +00:00
|
|
|
$(foreach stage,$(STAGES), \
|
|
|
|
$(foreach pretty-name,$(PRETTY_NAMES), \
|
|
|
|
$(eval $(call DEF_RUN_PRETTY_TEST,$(stage),$(target),$(host),$(pretty-name)))))))
|
2012-01-21 02:05:07 +00:00
|
|
|
|
2012-09-16 01:06:20 +00:00
|
|
|
|
2014-03-08 14:41:31 +00:00
|
|
|
######################################################################
|
|
|
|
# Crate & freestanding documentation tests
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
define DEF_RUSTDOC
|
|
|
|
RUSTDOC_EXE_$(1)_T_$(2)_H_$(3) := $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
|
|
|
|
RUSTDOC_$(1)_T_$(2)_H_$(3) := $$(RPATH_VAR$(1)_T_$(2)_H_$(3)) $$(RUSTDOC_EXE_$(1)_T_$(2)_H_$(3))
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach host,$(CFG_HOST), \
|
|
|
|
$(foreach target,$(CFG_TARGET), \
|
|
|
|
$(foreach stage,$(STAGES), \
|
|
|
|
$(eval $(call DEF_RUSTDOC,$(stage),$(target),$(host))))))
|
|
|
|
|
|
|
|
# Freestanding
|
|
|
|
|
|
|
|
define DEF_DOC_TEST
|
2012-09-16 01:06:20 +00:00
|
|
|
|
2013-02-19 01:08:03 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4))
|
2013-02-06 04:05:00 +00:00
|
|
|
|
2014-03-08 14:41:31 +00:00
|
|
|
# If NO_REBUILD is set then break the dependencies on everything but
|
|
|
|
# the source files so we can test documentation without rebuilding
|
|
|
|
# rustdoc etc.
|
2016-02-02 07:27:04 +00:00
|
|
|
ifeq ($(NO_REBUILD),)
|
2014-03-08 14:41:31 +00:00
|
|
|
DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \
|
2014-12-02 14:20:48 +00:00
|
|
|
$$(DOCFILE_$(4)) \
|
2014-07-23 04:37:05 +00:00
|
|
|
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
|
2014-03-08 14:41:31 +00:00
|
|
|
$$(RUSTDOC_EXE_$(1)_T_$(2)_H_$(3))
|
|
|
|
else
|
2014-12-02 14:20:48 +00:00
|
|
|
DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(DOCFILE_$(4))
|
2014-03-08 14:41:31 +00:00
|
|
|
endif
|
2012-09-16 01:06:20 +00:00
|
|
|
|
2014-03-08 14:41:31 +00:00
|
|
|
ifeq ($(2),$$(CFG_BUILD))
|
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): $$(DOCTESTDEP_$(1)_$(2)_$(3)_$(4))
|
|
|
|
@$$(call E, run doc-$(4) [$(2)])
|
2015-03-03 14:11:01 +00:00
|
|
|
$$(Q)touch $$@.start_time
|
2014-12-02 14:20:48 +00:00
|
|
|
$$(Q)$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --cfg dox --test $$< \
|
2015-03-03 14:11:01 +00:00
|
|
|
--test-args "$$(TESTARGS)" && \
|
|
|
|
touch -r $$@.start_time $$@ && rm $$@.start_time
|
2014-03-08 14:41:31 +00:00
|
|
|
else
|
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)):
|
|
|
|
touch $$@
|
|
|
|
endif
|
2013-02-05 22:14:58 +00:00
|
|
|
endef
|
2012-09-22 22:33:50 +00:00
|
|
|
|
2013-10-21 09:18:21 +00:00
|
|
|
$(foreach host,$(CFG_HOST), \
|
|
|
|
$(foreach target,$(CFG_TARGET), \
|
2013-02-05 22:14:58 +00:00
|
|
|
$(foreach stage,$(STAGES), \
|
2014-12-02 14:20:48 +00:00
|
|
|
$(foreach docname,$(DOC_NAMES), \
|
2014-03-08 14:41:31 +00:00
|
|
|
$(eval $(call DEF_DOC_TEST,$(stage),$(target),$(host),$(docname)))))))
|
|
|
|
|
|
|
|
# Crates
|
2012-03-20 23:49:12 +00:00
|
|
|
|
2013-12-22 21:46:06 +00:00
|
|
|
define DEF_CRATE_DOC_TEST
|
|
|
|
|
2014-02-13 08:35:43 +00:00
|
|
|
# If NO_REBUILD is set then break the dependencies on everything but
|
|
|
|
# the source files so we can test crate documentation without
|
|
|
|
# rebuilding any of the parent crates.
|
2016-02-02 07:27:04 +00:00
|
|
|
ifeq ($(NO_REBUILD),)
|
2014-03-08 14:41:31 +00:00
|
|
|
CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \
|
2014-07-23 04:37:05 +00:00
|
|
|
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
|
|
|
|
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
|
2014-03-08 14:41:31 +00:00
|
|
|
$$(RUSTDOC_EXE_$(1)_T_$(2)_H_$(3))
|
2014-02-13 08:35:43 +00:00
|
|
|
else
|
2014-03-08 14:41:31 +00:00
|
|
|
CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
|
2014-02-13 08:35:43 +00:00
|
|
|
endif
|
|
|
|
|
2014-03-09 03:55:20 +00:00
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec: \
|
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4))
|
2013-12-22 21:46:06 +00:00
|
|
|
|
2013-12-25 06:59:38 +00:00
|
|
|
ifeq ($(2),$$(CFG_BUILD))
|
2014-03-09 03:55:20 +00:00
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))
|
|
|
|
@$$(call E, run doc-crate-$(4) [$(2)])
|
2015-03-03 14:11:01 +00:00
|
|
|
$$(Q)touch $$@.start_time
|
2015-05-11 19:30:47 +00:00
|
|
|
$$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
|
2014-11-26 01:03:03 +00:00
|
|
|
$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test --cfg dox \
|
2015-03-03 14:11:01 +00:00
|
|
|
$$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && \
|
|
|
|
touch -r $$@.start_time $$@ && rm $$@.start_time
|
2013-12-25 06:59:38 +00:00
|
|
|
else
|
2014-03-09 03:55:20 +00:00
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)):
|
2013-12-25 06:59:38 +00:00
|
|
|
touch $$@
|
|
|
|
endif
|
2013-12-22 21:46:06 +00:00
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach host,$(CFG_HOST), \
|
2013-12-25 06:59:38 +00:00
|
|
|
$(foreach target,$(CFG_TARGET), \
|
|
|
|
$(foreach stage,$(STAGES), \
|
|
|
|
$(foreach crate,$(TEST_DOC_CRATES), \
|
|
|
|
$(eval $(call DEF_CRATE_DOC_TEST,$(stage),$(target),$(host),$(crate)))))))
|
2011-07-12 22:27:00 +00:00
|
|
|
|
2016-02-07 12:03:11 +00:00
|
|
|
define DEF_DOC_TEST_ERROR_INDEX
|
|
|
|
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-doc-error-index-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-error-index)
|
|
|
|
|
|
|
|
ifeq ($(2),$$(CFG_BUILD))
|
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-error-index): \
|
|
|
|
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
|
|
|
|
doc/error-index.md
|
|
|
|
$$(Q)touch $$@.start_time
|
|
|
|
$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test doc/error-index.md
|
|
|
|
$$(Q)touch -r $$@.start_time $$@ && rm $$@.start_time
|
|
|
|
else
|
|
|
|
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-error-index):
|
|
|
|
$$(Q)touch $$@
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach host,$(CFG_HOST), \
|
|
|
|
$(foreach target,$(CFG_TARGET), \
|
|
|
|
$(foreach stage,$(STAGES), \
|
|
|
|
$(eval $(call DEF_DOC_TEST_ERROR_INDEX,$(stage),$(target),$(host))))))
|
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
######################################################################
|
|
|
|
# Shortcut rules
|
|
|
|
######################################################################
|
2011-08-01 18:57:05 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
TEST_GROUPS = \
|
|
|
|
crates \
|
|
|
|
$(foreach crate,$(TEST_CRATES),$(crate)) \
|
2014-03-09 03:55:20 +00:00
|
|
|
$(foreach crate,$(TEST_DOC_CRATES),doc-crate-$(crate)) \
|
2013-02-05 22:14:58 +00:00
|
|
|
rpass \
|
2016-02-07 12:03:11 +00:00
|
|
|
rpass-valgrind \
|
2013-02-05 22:14:58 +00:00
|
|
|
rpass-full \
|
2015-04-26 01:30:47 +00:00
|
|
|
rfail-full \
|
2014-04-29 00:31:43 +00:00
|
|
|
cfail-full \
|
2013-02-05 22:14:58 +00:00
|
|
|
rfail \
|
|
|
|
cfail \
|
2015-02-11 22:09:30 +00:00
|
|
|
pfail \
|
2013-11-17 01:07:32 +00:00
|
|
|
rmake \
|
2015-04-06 20:48:17 +00:00
|
|
|
rustdocck \
|
2014-04-24 09:35:48 +00:00
|
|
|
debuginfo-gdb \
|
|
|
|
debuginfo-lldb \
|
2013-07-06 08:03:03 +00:00
|
|
|
codegen \
|
2015-11-02 13:46:39 +00:00
|
|
|
codegen-units \
|
2016-04-05 21:48:15 +00:00
|
|
|
incremental \
|
2013-02-05 22:14:58 +00:00
|
|
|
doc \
|
2014-12-02 14:20:48 +00:00
|
|
|
$(foreach docname,$(DOC_NAMES),doc-$(docname)) \
|
2013-02-05 22:14:58 +00:00
|
|
|
pretty \
|
|
|
|
pretty-rpass \
|
2016-02-07 12:03:11 +00:00
|
|
|
pretty-rpass-valgrind \
|
2013-02-05 22:14:58 +00:00
|
|
|
pretty-rpass-full \
|
2015-04-26 01:30:47 +00:00
|
|
|
pretty-rfail-full \
|
2013-02-05 22:14:58 +00:00
|
|
|
pretty-rfail \
|
2016-02-02 07:27:04 +00:00
|
|
|
pretty-pretty \
|
|
|
|
$(NULL)
|
2013-02-05 22:14:58 +00:00
|
|
|
|
|
|
|
define DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3): check-stage$(1)-T-$(2)-H-$(3)-exec
|
|
|
|
endef
|
2011-08-02 21:37:03 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
$(foreach stage,$(STAGES), \
|
2013-10-21 09:18:21 +00:00
|
|
|
$(foreach target,$(CFG_TARGET), \
|
|
|
|
$(foreach host,$(CFG_HOST), \
|
2013-02-05 22:14:58 +00:00
|
|
|
$(eval $(call DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST,$(stage),$(target),$(host))))))
|
2011-07-31 04:44:30 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
define DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST_AND_GROUP
|
|
|
|
check-stage$(1)-T-$(2)-H-$(3)-$(4): check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec
|
|
|
|
endef
|
2012-01-21 02:05:07 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
$(foreach stage,$(STAGES), \
|
2013-10-21 09:18:21 +00:00
|
|
|
$(foreach target,$(CFG_TARGET), \
|
|
|
|
$(foreach host,$(CFG_HOST), \
|
2013-02-05 22:14:58 +00:00
|
|
|
$(foreach group,$(TEST_GROUPS), \
|
|
|
|
$(eval $(call DEF_CHECK_FOR_STAGE_AND_TARGET_AND_HOST_AND_GROUP,$(stage),$(target),$(host),$(group)))))))
|
2012-09-16 01:06:20 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
define DEF_CHECK_FOR_STAGE
|
2013-10-21 09:18:21 +00:00
|
|
|
check-stage$(1): check-stage$(1)-H-$$(CFG_BUILD)
|
|
|
|
check-stage$(1)-H-all: $$(foreach target,$$(CFG_TARGET), \
|
2013-02-05 22:14:58 +00:00
|
|
|
check-stage$(1)-H-$$(target))
|
|
|
|
endef
|
2012-09-16 01:06:20 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
$(foreach stage,$(STAGES), \
|
|
|
|
$(eval $(call DEF_CHECK_FOR_STAGE,$(stage))))
|
2012-09-16 01:06:20 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
define DEF_CHECK_FOR_STAGE_AND_GROUP
|
2013-10-21 09:18:21 +00:00
|
|
|
check-stage$(1)-$(2): check-stage$(1)-H-$$(CFG_BUILD)-$(2)
|
|
|
|
check-stage$(1)-H-all-$(2): $$(foreach target,$$(CFG_TARGET), \
|
2013-02-05 22:14:58 +00:00
|
|
|
check-stage$(1)-H-$$(target)-$(2))
|
|
|
|
endef
|
2012-09-22 22:33:50 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
$(foreach stage,$(STAGES), \
|
|
|
|
$(foreach group,$(TEST_GROUPS), \
|
|
|
|
$(eval $(call DEF_CHECK_FOR_STAGE_AND_GROUP,$(stage),$(group)))))
|
2012-03-20 23:49:12 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
|
|
|
|
define DEF_CHECK_FOR_STAGE_AND_HOSTS
|
2013-10-21 09:18:21 +00:00
|
|
|
check-stage$(1)-H-$(2): $$(foreach target,$$(CFG_TARGET), \
|
2013-02-05 22:14:58 +00:00
|
|
|
check-stage$(1)-T-$$(target)-H-$(2))
|
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-13 02:01:09 +00:00
|
|
|
endef
|
2011-07-12 22:27:00 +00:00
|
|
|
|
2013-02-05 22:14:58 +00:00
|
|
|
$(foreach stage,$(STAGES), \
|
2013-10-21 09:18:21 +00:00
|
|
|
$(foreach host,$(CFG_HOST), \
|
2013-02-05 22:14:58 +00:00
|
|
|
$(eval $(call DEF_CHECK_FOR_STAGE_AND_HOSTS,$(stage),$(host)))))
|
|
|
|
|
|
|
|
define DEF_CHECK_FOR_STAGE_AND_HOSTS_AND_GROUP
|
2013-10-21 09:18:21 +00:00
|
|
|
check-stage$(1)-H-$(2)-$(3): $$(foreach target,$$(CFG_TARGET), \
|
2013-02-05 22:14:58 +00:00
|
|
|
check-stage$(1)-T-$$(target)-H-$(2)-$(3))
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach stage,$(STAGES), \
|
2013-10-21 09:18:21 +00:00
|
|
|
$(foreach host,$(CFG_HOST), \
|
2013-02-05 22:14:58 +00:00
|
|
|
$(foreach group,$(TEST_GROUPS), \
|
|
|
|
$(eval $(call DEF_CHECK_FOR_STAGE_AND_HOSTS_AND_GROUP,$(stage),$(host),$(group))))))
|
2011-07-12 22:27:00 +00:00
|
|
|
|
2014-02-15 03:17:50 +00:00
|
|
|
define DEF_CHECK_DOC_FOR_STAGE
|
2014-12-02 14:20:48 +00:00
|
|
|
check-stage$(1)-docs: $$(foreach docname,$$(DOC_NAMES), \
|
2014-02-15 03:17:50 +00:00
|
|
|
check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-$$(docname)) \
|
2014-07-23 04:45:08 +00:00
|
|
|
$$(foreach crate,$$(TEST_DOC_CRATES), \
|
2016-02-07 12:03:11 +00:00
|
|
|
check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-crate-$$(crate)) \
|
|
|
|
check-stage$(1)-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-doc-error-index-exec
|
2014-02-15 03:17:50 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach stage,$(STAGES), \
|
|
|
|
$(eval $(call DEF_CHECK_DOC_FOR_STAGE,$(stage))))
|
|
|
|
|
|
|
|
define DEF_CHECK_CRATE
|
|
|
|
check-$(1): check-stage2-T-$$(CFG_BUILD)-H-$$(CFG_BUILD)-$(1)-exec
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach crate,$(TEST_CRATES), \
|
|
|
|
$(eval $(call DEF_CHECK_CRATE,$(crate))))
|