@@ -103,7 +103,8 @@ cleantestlibs:
103103 -name '*.dSYM' -o \
104104 -name '*.libaux' -o \
105105 -name '*.out' -o \
106- -name '*.err' \
106+ -name '*.err' -o \
107+ -name '*.debugger.script' \
107108 | xargs rm -rf
108109
109110
@@ -170,6 +171,7 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
170171 check-stage$(1 ) -T-$(2 ) -H-$(3 ) -rpass-full-exec \
171172 check-stage$(1 ) -T-$(2 ) -H-$(3 ) -crates-exec \
172173 check-stage$(1 ) -T-$(2 ) -H-$(3 ) -bench-exec \
174+ check-stage$(1 ) -T-$(2 ) -H-$(3 ) -debuginfo-exec \
173175 check-stage$(1 ) -T-$(2 ) -H-$(3 ) -doc-exec \
174176 check-stage$(1 ) -T-$(2 ) -H-$(3 ) -pretty-exec
175177
@@ -284,6 +286,7 @@ CFAIL_RC := $(wildcard $(S)src/test/compile-fail/*.rc)
284286CFAIL_RS := $(wildcard $(S ) src/test/compile-fail/* .rs)
285287BENCH_RS := $(wildcard $(S ) src/test/bench/* .rs)
286288PRETTY_RS := $(wildcard $(S ) src/test/pretty/* .rs)
289+ DEBUGINFO_RS := $(wildcard $(S ) src/test/debug-info/* .rs)
287290
288291# perf tests are the same as bench tests only they run under
289292# a performance monitor.
@@ -296,6 +299,7 @@ CFAIL_TESTS := $(CFAIL_RC) $(CFAIL_RS)
296299BENCH_TESTS := $(BENCH_RS )
297300PERF_TESTS := $(PERF_RS )
298301PRETTY_TESTS := $(PRETTY_RS )
302+ DEBUGINFO_TESTS := $(DEBUGINFO_RS )
299303
300304CTEST_SRC_BASE_rpass = run-pass
301305CTEST_BUILD_BASE_rpass = run-pass
@@ -327,6 +331,15 @@ CTEST_BUILD_BASE_perf = perf
327331CTEST_MODE_perf = run-pass
328332CTEST_RUNTOOL_perf = $(CTEST_PERF_RUNTOOL )
329333
334+ CTEST_SRC_BASE_debuginfo = debug-info
335+ CTEST_BUILD_BASE_debuginfo = debug-info
336+ CTEST_MODE_debuginfo = debug-info
337+ CTEST_RUNTOOL_debuginfo = $(CTEST_RUNTOOL )
338+
339+ ifeq ($(CFG_GDB ) ,)
340+ CTEST_DISABLE_debuginfo = "no gdb found"
341+ endif
342+
330343define DEF_CTEST_VARS
331344
332345# All the per-stage build rules you might want to call from the
@@ -349,7 +362,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
349362 --rustc-path $$(HBIN$(1 ) _H_$(3 ) ) /rustc$$(X ) \
350363 --aux-base $$(S ) src/test/auxiliary/ \
351364 --stage-id stage$(1 ) -$(2 ) \
352- --rustcflags "$$(CFG_RUSTC_FLAGS ) --target=$(2 ) " \
365+ --rustcflags "$$(CFG_RUSTC_FLAGS ) --target=$(2 ) " \
353366 $$(CTEST_TESTARGS )
354367
355368CTEST_DEPS_rpass_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RPASS_TESTS )
@@ -358,6 +371,7 @@ CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
358371CTEST_DEPS_cfail_$(1 ) -T-$(2 ) -H-$(3 ) = $$(CFAIL_TESTS )
359372CTEST_DEPS_bench_$(1 ) -T-$(2 ) -H-$(3 ) = $$(BENCH_TESTS )
360373CTEST_DEPS_perf_$(1 ) -T-$(2 ) -H-$(3 ) = $$(PERF_TESTS )
374+ CTEST_DEPS_debuginfo_$(1 ) -T-$(2 ) -H-$(3 ) = $$(DEBUGINFO_TESTS )
361375
362376endef
363377
@@ -377,6 +391,8 @@ CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
377391
378392check-stage$(1 ) -T-$(2 ) -H-$(3 ) -$(4 ) -exec: $$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) )
379393
394+ ifeq ($$(CTEST_DISABLE_$(4 ) ) ,)
395+
380396$$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) ) : \
381397 $$(TEST_SREQ$(1 ) _T_$(2 ) _H_$(3 ) ) \
382398 $$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
@@ -386,9 +402,20 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
386402 --logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
387403 && touch $$@
388404
405+ else
406+
407+ $$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) ) : \
408+ $$(TEST_SREQ$(1 ) _T_$(2 ) _H_$(3 ) ) \
409+ $$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
410+ @$$(call E, run $(4): $$<)
411+ @$$(call E, warning: tests disabled: $$(CTEST_DISABLE_$(4)))
412+ touch $$@
413+
414+ endif
415+
389416endef
390417
391- CTEST_NAMES = rpass rpass-full rfail cfail bench perf
418+ CTEST_NAMES = rpass rpass-full rfail cfail bench perf debuginfo
392419
393420$(foreach host,$(CFG_TARGET_TRIPLES), \
394421 $(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
@@ -496,6 +523,7 @@ TEST_GROUPS = \
496523 cfail \
497524 bench \
498525 perf \
526+ debuginfo \
499527 doc \
500528 $(foreach docname,$(DOC_TEST_NAMES ) ,$(docname ) ) \
501529 pretty \
0 commit comments