From fb37bbb612b7420b9b59191163c899a129695203 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Thu, 15 Oct 2020 22:11:07 -0700 Subject: [PATCH] [llvm-cov] Fix test cases. `/dev/null` is treated as regualar file on Windows. native_separators.c line 11 used relative path which was not correct but worked before because when `SourceFiles` is empty, it add all source files into `SourceFiles`. --- test/tools/llvm-cov/native_separators.c | 2 +- test/tools/llvm-cov/warnings.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/tools/llvm-cov/native_separators.c b/test/tools/llvm-cov/native_separators.c index 8ab1a732b99..3c768e1014b 100644 --- a/test/tools/llvm-cov/native_separators.c +++ b/test/tools/llvm-cov/native_separators.c @@ -8,7 +8,7 @@ // RUN: llvm-profdata merge %S/Inputs/double_dots.proftext -o %t.profdata // RUN: llvm-cov show %S/Inputs/native_separators.covmapping -instr-profile=%t.profdata -o %t.dir // RUN: FileCheck -check-prefixes=TEXT-INDEX -input-file=%t.dir/index.txt %s -// RUN: llvm-cov show -format=html %S/Inputs/native_separators.covmapping -instr-profile=%t.profdata -path-equivalence=/tmp,%S ../llvm-"config"/../llvm-"cov"/native_separators.c -o %t.dir +// RUN: llvm-cov show -format=html %S/Inputs/native_separators.covmapping -instr-profile=%t.profdata -path-equivalence=/tmp,%S %S/../llvm-"config"/../llvm-"cov"/native_separators.c -o %t.dir // RUN: FileCheck -check-prefixes=HTML-INDEX -input-file=%t.dir/index.html %s // RUN: llvm-cov show -format=html %S/Inputs/native_separators.covmapping -instr-profile=%t.profdata -path-equivalence=/tmp,%S %s -o %t.dir // RUN: FileCheck -check-prefixes=HTML -input-file=%t.dir/coverage/tmp/native_separators.c.html %s diff --git a/test/tools/llvm-cov/warnings.h b/test/tools/llvm-cov/warnings.h index 5bd62be6d04..20bbf741f38 100644 --- a/test/tools/llvm-cov/warnings.h +++ b/test/tools/llvm-cov/warnings.h @@ -1,13 +1,13 @@ -// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S /dev/null | FileCheck %s -allow-empty -check-prefix=FAKE-FILE-STDOUT -// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S /dev/null 2>&1 | FileCheck %s -check-prefix=FAKE-FILE-STDERR +// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S | FileCheck %s -allow-empty -check-prefix=FAKE-FILE-STDOUT +// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S 2>&1 | FileCheck %s -check-prefix=FAKE-FILE-STDERR // RUN: not llvm-cov report %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -format=html // RUN: not llvm-cov export %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -format=html // FAKE-FILE-STDOUT-NOT: warning: The file '{{.*}}' isn't covered. // FAKE-FILE-STDERR: warning: The file '{{.*}}' isn't covered. -// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S -name ".*" /dev/null | FileCheck %s -allow-empty -check-prefix=FAKE-FUNC-STDOUT -// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S -name-regex ".*" /dev/null 2>&1 | FileCheck %s -check-prefix=FAKE-FUNC-STDERR +// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S -name ".*" | FileCheck %s -allow-empty -check-prefix=FAKE-FUNC-STDOUT +// RUN: llvm-cov show %S/Inputs/prevent_false_instantiations.covmapping -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S -name-regex ".*" 2>&1 | FileCheck %s -check-prefix=FAKE-FUNC-STDERR // FAKE-FUNC-STDOUT-NOT: warning: Could not read coverage for '{{.*}}'. // FAKE-FUNC-STDERR: Could not read coverage for '{{.*}}'.