Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 8fc697f

Browse files
committed
rename some tests to avoid exceeding windows path limits
And restored missing error message from llvm-cov show And since some CI builds disable LLVM assertions (which disables the --debug option in llvm-cov show), I check to see if LLVM assertions are disabled, and if so, I don't add --debug and don't check the counter file diffs.
1 parent cdbce10 commit 8fc697f

File tree

97 files changed

+847
-819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+847
-819
lines changed

src/test/run-make-fulldeps/coverage-reports-base/Makefile

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
BASEDIR=../coverage-reports-base
1414
SOURCEDIR=../coverage
1515

16+
# The `llvm-cov show` flag `--debug`, used to generate the `counters` output files, is only enabled
17+
# if LLVM assertions are enabled. Some CI builds disable debug assertions.
18+
ifndef NO_LLVM_ASSERTIONS
19+
DEBUG_FLAG=--debug
20+
endif
21+
22+
# When generating `expected_*` results (using `x.py test --bless`), the `--debug` flag is forced.
23+
# If assertions are disabled, the command will fail with an error, rather than attempt to generate
24+
# only partial results.
25+
ifdef RUSTC_BLESS_TEST
26+
DEBUG_FLAG=--debug
27+
endif
28+
1629
all: $(patsubst $(SOURCEDIR)/%.rs,%,$(wildcard $(SOURCEDIR)/*.rs))
1730

1831
# Ensure there are no `expected` results for tests that may have been removed or renamed
@@ -50,24 +63,27 @@ endif
5063
"$(TMPDIR)"/$@.profraw \
5164
-o "$(TMPDIR)"/$@.profdata
5265

53-
# Generate a coverage report using `llvm-cov show`. The output ordering
54-
# can be non-deterministic, so ignore the return status. If the test fails
55-
# when comparing the JSON `export`, the `show` output may be useful when
56-
# debugging.
66+
# Generate a coverage report using `llvm-cov show`.
5767
"$(LLVM_BIN_DIR)"/llvm-cov show \
58-
--debug \
68+
$(DEBUG_FLAG) \
5969
--Xdemangler="$(RUST_DEMANGLER)" \
6070
--show-line-counts-or-regions \
6171
--instr-profile="$(TMPDIR)"/$@.profdata \
6272
$(call BIN,"$(TMPDIR)"/$@) \
6373
> "$(TMPDIR)"/actual_show_coverage.$@.txt \
64-
2> "$(TMPDIR)"/show_coverage_stderr.$@.txt
74+
2> "$(TMPDIR)"/show_coverage_stderr.$@.txt || \
75+
( status=$$? ; \
76+
>&2 cat "$(TMPDIR)"/show_coverage_stderr.$@.txt ; \
77+
exit $$status \
78+
)
6579

80+
ifdef DEBUG_FLAG
6681
# The first line (beginning with "Args:" contains hard-coded, build-specific
6782
# file paths. Strip that line and keep the remaining lines with counter debug
6883
# data.
6984
tail -n +2 "$(TMPDIR)"/show_coverage_stderr.$@.txt \
7085
> "$(TMPDIR)"/actual_show_coverage_counters.$@.txt
86+
endif
7187

7288
ifdef RUSTC_BLESS_TEST
7389
cp "$(TMPDIR)"/actual_show_coverage.$@.txt \
@@ -87,6 +103,7 @@ else
87103
false \
88104
)
89105

106+
ifdef DEBUG_FLAG
90107
$(DIFF) expected_show_coverage_counters.$@.txt "$(TMPDIR)"/actual_show_coverage_counters.$@.txt || \
91108
( grep -q '^\/\/ ignore-llvm-cov-show-diffs' $(SOURCEDIR)/$@.rs && \
92109
>&2 echo 'diff failed, but suppressed with `// ignore-llvm-cov-show-diffs` in $(SOURCEDIR)/$@.rs' \
@@ -99,6 +116,7 @@ else
99116
# so the crate disambiguator differences will be stripped away. At that point, these files
100117
# will be less likely to vary, and the last `echo` above (starting with "Ignore anyway")
101118
# can be replaced with `false` to fail the test.
119+
endif
102120

103121
endif
104122

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"files": [
55
{
6-
"filename": "../coverage/various_conditions.rs",
6+
"filename": "../coverage/conditions.rs",
77
"summary": {
88
"functions": {
99
"count": 1,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"files": [
55
{
6-
"filename": "../coverage/loops_and_branches.rs",
6+
"filename": "../coverage/loops_branches.rs",
77
"summary": {
88
"functions": {
99
"count": 2,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"files": [
55
{
6-
"filename": "../coverage/partial_eq_counter_without_region.rs",
6+
"filename": "../coverage/partial_eq.rs",
77
"summary": {
88
"functions": {
99
"count": 5,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"files": [
55
{
6-
"filename": "../coverage/tight_infinite_loop.rs",
6+
"filename": "../coverage/tight_inf_loop.rs",
77
"summary": {
88
"functions": {
99
"count": 1,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"files": [
55
{
6-
"filename": "../coverage/while_early_return.rs",
6+
"filename": "../coverage/while_early_ret.rs",
77
"summary": {
88
"functions": {
99
"count": 1,

0 commit comments

Comments
 (0)