[llvm] f5907ea - [unittest][DebugInfo/DWARF] Do not report skipped tests as passed
Igor Kudrin via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 22 03:54:19 PST 2021
Author: Igor Kudrin
Date: 2021-12-22T18:52:49+07:00
New Revision: f5907ea1c0debddac72f5e4d15fc7fed30e36a72
URL: https://github.com/llvm/llvm-project/commit/f5907ea1c0debddac72f5e4d15fc7fed30e36a72
DIFF: https://github.com/llvm/llvm-project/commit/f5907ea1c0debddac72f5e4d15fc7fed30e36a72.diff
LOG: [unittest][DebugInfo/DWARF] Do not report skipped tests as passed
This is similar to what we have already done to some other tests.
See D102643, D102710, D102754.
Differential Revision: https://reviews.llvm.org/D116108
Added:
Modified:
llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDieManualExtractTest.cpp
llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp
llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
index 44f438e91f99..ddd057aa1121 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
@@ -44,7 +44,7 @@ template <uint16_t Version, class AddrType, class RefAddrType>
void TestAllForms() {
Triple Triple = getDefaultTargetTripleForAddrSize(sizeof(AddrType));
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
// Test that we can decode all DW_FORM values correctly.
const AddrType AddrValue = (AddrType)0x0123456789abcdefULL;
@@ -478,7 +478,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version5Addr8AllForms) {
template <uint16_t Version, class AddrType> void TestChildren() {
Triple Triple = getDefaultTargetTripleForAddrSize(sizeof(AddrType));
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
// Test that we can decode DW_FORM_ref_addr values correctly in DWARF 2 with
// 4 byte addresses. DW_FORM_ref_addr values should be 4 bytes when using
@@ -620,7 +620,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version4Addr8Children) {
template <uint16_t Version, class AddrType> void TestReferences() {
Triple Triple = getDefaultTargetTripleForAddrSize(sizeof(AddrType));
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
// Test that we can decode DW_FORM_refXXX values correctly in DWARF.
auto ExpectedDG = dwarfgen::Generator::create(Triple, Version);
@@ -882,7 +882,7 @@ TEST(DWARFDebugInfo, TestDWARF32Version4Addr8References) {
template <uint16_t Version, class AddrType> void TestAddresses() {
Triple Triple = getDefaultTargetTripleForAddrSize(sizeof(AddrType));
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
// Test the DWARF APIs related to accessing the DW_AT_low_pc and
// DW_AT_high_pc.
@@ -1070,7 +1070,7 @@ TEST(DWARFDebugInfo, TestStringOffsets) {
#endif
Triple Triple = getNormalizedDefaultTargetTriple();
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
const char *String1 = "Hello";
const char *String2 = "World";
@@ -1134,7 +1134,7 @@ TEST(DWARFDebugInfo, TestStringOffsets) {
TEST(DWARFDebugInfo, TestEmptyStringOffsets) {
Triple Triple = getNormalizedDefaultTargetTriple();
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
const char *String1 = "Hello";
@@ -1163,7 +1163,7 @@ TEST(DWARFDebugInfo, TestEmptyStringOffsets) {
TEST(DWARFDebugInfo, TestRelations) {
Triple Triple = getNormalizedDefaultTargetTriple();
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
// Test the DWARF APIs related to accessing the DW_AT_low_pc and
// DW_AT_high_pc.
@@ -1350,7 +1350,7 @@ TEST(DWARFDebugInfo, TestDWARFDie) {
TEST(DWARFDebugInfo, TestChildIterators) {
Triple Triple = getNormalizedDefaultTargetTriple();
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
// Test the DWARF APIs related to iterating across the children of a DIE using
// the DWARFDie::iterator class.
@@ -1459,7 +1459,7 @@ TEST(DWARFDebugInfo, TestEmptyChildren) {
TEST(DWARFDebugInfo, TestAttributeIterators) {
Triple Triple = getNormalizedDefaultTargetTriple();
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
// Test the DWARF APIs related to iterating across all attribute values in a
// a DWARFDie.
@@ -1521,7 +1521,7 @@ TEST(DWARFDebugInfo, TestAttributeIterators) {
TEST(DWARFDebugInfo, TestFindRecurse) {
Triple Triple = getNormalizedDefaultTargetTriple();
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
uint16_t Version = 4;
auto ExpectedDG = dwarfgen::Generator::create(Triple, Version);
@@ -1735,7 +1735,7 @@ TEST(DWARFDebugInfo, TestDwarfToFunctions) {
TEST(DWARFDebugInfo, TestFindAttrs) {
Triple Triple = getNormalizedDefaultTargetTriple();
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
// Test the DWARFDie::find() and DWARFDie::findRecursively() that take an
// ArrayRef<dwarf::Attribute> value to make sure they work correctly.
@@ -1798,7 +1798,7 @@ TEST(DWARFDebugInfo, TestFindAttrs) {
TEST(DWARFDebugInfo, TestImplicitConstAbbrevs) {
Triple Triple = getNormalizedDefaultTargetTriple();
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
uint16_t Version = 5;
auto ExpectedDG = dwarfgen::Generator::create(Triple, Version);
@@ -1923,7 +1923,7 @@ TEST(DWARFDebugInfo, TestImplicitConstAbbrevs) {
TEST(DWARFDebugInfo, TestErrorReporting) {
Triple Triple("x86_64-pc-linux");
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
auto ExpectedDG = dwarfgen::Generator::create(Triple, 4 /*DwarfVersion*/);
ASSERT_THAT_EXPECTED(ExpectedDG, Succeeded());
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
index 71b7361f4fd5..731aa4f0f3d0 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
@@ -187,7 +187,7 @@ TEST_F(DebugLineBasicFixture, DISABLED_GetOrParseLineTableAtInvalidOffset) {
TEST_F(DebugLineBasicFixture, GetOrParseLineTableAtInvalidOffset) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
generate();
EXPECT_THAT_EXPECTED(
@@ -214,7 +214,7 @@ TEST_F(DebugLineBasicFixture,
TEST_F(DebugLineBasicFixture, GetOrParseLineTableAtInvalidOffsetAfterData) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.setCustomPrologue({{0, LineTable::Byte}});
@@ -239,7 +239,7 @@ TEST_P(DebugLineParameterisedFixture, DISABLED_PrologueGetLength) {
TEST_P(DebugLineParameterisedFixture, PrologueGetLength) {
#endif
if (!setupGenerator(Version))
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable(Format);
DWARFDebugLine::Prologue Prologue = LT.createBasicPrologue();
LT.setPrologue(Prologue);
@@ -266,7 +266,7 @@ TEST_P(DebugLineParameterisedFixture, DISABLED_GetOrParseLineTableValidTable) {
TEST_P(DebugLineParameterisedFixture, GetOrParseLineTableValidTable) {
#endif
if (!setupGenerator(Version))
- return;
+ GTEST_SKIP();
SCOPED_TRACE("Checking Version " + std::to_string(Version) + ", Format " +
(Format == DWARF64 ? "DWARF64" : "DWARF32"));
@@ -336,7 +336,7 @@ TEST_F(DebugLineBasicFixture, DISABLED_ErrorForReservedLength) {
TEST_F(DebugLineBasicFixture, ErrorForReservedLength) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.setCustomPrologue({{0xfffffff0, LineTable::Long}});
@@ -364,7 +364,7 @@ TEST_P(DebugLineUnsupportedVersionFixture,
TEST_P(DebugLineUnsupportedVersionFixture, ErrorForUnsupportedVersion) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.setCustomPrologue(
@@ -390,7 +390,7 @@ TEST_F(DebugLineBasicFixture, DISABLED_ErrorForInvalidV5IncludeDirTable) {
TEST_F(DebugLineBasicFixture, ErrorForInvalidV5IncludeDirTable) {
#endif
if (!setupGenerator(5))
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.setCustomPrologue({
@@ -435,7 +435,7 @@ TEST_P(DebugLineParameterisedFixture, DISABLED_ErrorForTooLargePrologueLength) {
TEST_P(DebugLineParameterisedFixture, ErrorForTooLargePrologueLength) {
#endif
if (!setupGenerator(Version))
- return;
+ GTEST_SKIP();
SCOPED_TRACE("Checking Version " + std::to_string(Version) + ", Format " +
(Format == DWARF64 ? "DWARF64" : "DWARF32"));
@@ -475,7 +475,7 @@ TEST_P(DebugLineParameterisedFixture, DISABLED_ErrorForTooShortPrologueLength) {
TEST_P(DebugLineParameterisedFixture, ErrorForTooShortPrologueLength) {
#endif
if (!setupGenerator(Version))
- return;
+ GTEST_SKIP();
SCOPED_TRACE("Checking Version " + std::to_string(Version) + ", Format " +
(Format == DWARF64 ? "DWARF64" : "DWARF32"));
@@ -534,7 +534,7 @@ TEST_F(DebugLineBasicFixture,
TEST_F(DebugLineBasicFixture, ErrorForExtendedOpcodeLengthSmallerThanExpected) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.addByte(0xaa);
@@ -568,7 +568,7 @@ TEST_F(DebugLineBasicFixture,
TEST_F(DebugLineBasicFixture, ErrorForExtendedOpcodeLengthLargerThanExpected) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.addByte(0xaa);
@@ -601,7 +601,7 @@ TEST_F(DebugLineBasicFixture, DISABLED_ErrorForUnitLengthTooLarge) {
TEST_F(DebugLineBasicFixture, ErrorForUnitLengthTooLarge) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable &Padding = Gen->addLineTable();
// Add some padding to show that a non-zero offset is handled correctly.
@@ -634,7 +634,7 @@ TEST_F(DebugLineBasicFixture, DISABLED_ErrorForMismatchedAddressSize) {
TEST_F(DebugLineBasicFixture, ErrorForMismatchedAddressSize) {
#endif
if (!setupGenerator(4, 8))
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
// The line data extractor expects size 8 (Quad) addresses.
@@ -669,7 +669,7 @@ TEST_F(DebugLineBasicFixture,
ErrorForMismatchedAddressSizeUnsetInitialAddress) {
#endif
if (!setupGenerator(4, 0))
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
uint64_t Addr1 = 0x11223344;
@@ -703,7 +703,7 @@ TEST_F(DebugLineBasicFixture,
// Use DWARF v4, and 0 for data extractor address size so that the address
// size is derived from the opcode length.
if (!setupGenerator(4, 0))
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
// 4 == length of the extended opcode, i.e. 1 for the opcode itself and 3 for
@@ -739,7 +739,7 @@ TEST_F(DebugLineBasicFixture, ErrorForAddressSizeGreaterThanByteSize) {
// Use DWARF v4, and 0 for data extractor address size so that the address
// size is derived from the opcode length.
if (!setupGenerator(4, 0))
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
// Specifically use an operand size that has a trailing byte of a supported
@@ -768,7 +768,7 @@ TEST_F(DebugLineBasicFixture, ErrorForUnsupportedAddressSizeDefinedInHeader) {
// Use 0 for data extractor address size so that it does not clash with the
// header address size.
if (!setupGenerator(5, 0))
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
// AddressSize + 1 == length of the extended opcode, i.e. 1 for the opcode
@@ -807,7 +807,7 @@ TEST_F(DebugLineBasicFixture, DISABLED_CallbackUsedForUnterminatedSequence) {
TEST_F(DebugLineBasicFixture, CallbackUsedForUnterminatedSequence) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.addExtendedOpcode(9, DW_LNE_set_address,
@@ -952,7 +952,7 @@ struct AdjustAddressFixtureBase : public CommonFixture {
void runTest(bool CheckAdvancePC, Twine MsgSuffix) {
if (!setupGenerator(Version))
- return;
+ GTEST_SKIP();
setupTables(/*AddAdvancePCFirstTable=*/CheckAdvancePC);
@@ -1134,7 +1134,7 @@ TEST_F(DebugLineBasicFixture, DISABLED_ParserParsesCorrectly) {
TEST_F(DebugLineBasicFixture, ParserParsesCorrectly) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
DWARFDebugLine::SectionParser Parser = setupParser();
@@ -1165,7 +1165,7 @@ TEST_F(DebugLineBasicFixture, DISABLED_ParserSkipsCorrectly) {
TEST_F(DebugLineBasicFixture, ParserSkipsCorrectly) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
DWARFDebugLine::SectionParser Parser = setupParser();
@@ -1190,7 +1190,7 @@ TEST_F(DebugLineBasicFixture, DISABLED_ParserAlwaysDoneForEmptySection) {
TEST_F(DebugLineBasicFixture, ParserAlwaysDoneForEmptySection) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
generate();
DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
@@ -1205,7 +1205,7 @@ TEST_F(DebugLineBasicFixture,
TEST_F(DebugLineBasicFixture, ParserMarkedAsDoneForBadLengthWhenParsing) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.setCustomPrologue({{0xfffffff0, LineTable::Long}});
@@ -1233,7 +1233,7 @@ TEST_F(DebugLineBasicFixture,
TEST_F(DebugLineBasicFixture, ParserMarkedAsDoneForBadLengthWhenSkipping) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.setCustomPrologue({{0xfffffff0, LineTable::Long}});
@@ -1261,7 +1261,7 @@ TEST_F(DebugLineBasicFixture,
TEST_F(DebugLineBasicFixture, ParserReportsFirstErrorInEachTableWhenParsing) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable(DWARF32);
LT.setCustomPrologue({{2, LineTable::Long}, {0, LineTable::Half}});
@@ -1292,7 +1292,7 @@ TEST_F(DebugLineBasicFixture,
TEST_F(DebugLineBasicFixture, ParserReportsNonPrologueProblemsWhenParsing) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable(DWARF32);
LT.addExtendedOpcode(0x42, DW_LNE_end_sequence, {});
@@ -1330,7 +1330,7 @@ TEST_F(DebugLineBasicFixture,
ParserReportsPrologueErrorsInEachTableWhenSkipping) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable(DWARF32);
LT.setCustomPrologue({{2, LineTable::Long}, {0, LineTable::Half}});
@@ -1361,7 +1361,7 @@ TEST_F(DebugLineBasicFixture,
TEST_F(DebugLineBasicFixture, ParserIgnoresNonPrologueErrorsWhenSkipping) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable(DWARF32);
LT.addExtendedOpcode(42, DW_LNE_end_sequence, {});
@@ -1381,7 +1381,7 @@ TEST_F(DebugLineBasicFixture, DISABLED_VerboseOutput) {
TEST_F(DebugLineBasicFixture, VerboseOutput) {
#endif
if (!setupGenerator(5))
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.addByte(0); // Extended opcode with zero length.
@@ -1541,7 +1541,7 @@ TEST_P(TruncatedPrologueFixture, DISABLED_ErrorForTruncatedPrologue) {
TEST_P(TruncatedPrologueFixture, ErrorForTruncatedPrologue) {
#endif
if (!setupGenerator(Version))
- return;
+ GTEST_SKIP();
LineTable &Padding = Gen->addLineTable();
// Add some padding to show that a non-zero offset is handled correctly.
@@ -1723,7 +1723,7 @@ TEST_P(TruncatedExtendedOpcodeFixture,
TEST_P(TruncatedExtendedOpcodeFixture, ErrorForTruncatedExtendedOpcode) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = setupTable();
LT.addExtendedOpcode(OpcodeLength, Opcode, Operands);
runTest(0);
@@ -1807,7 +1807,7 @@ TEST_P(TruncatedStandardOpcodeFixture,
TEST_P(TruncatedStandardOpcodeFixture, ErrorForTruncatedStandardOpcode) {
#endif
if (!setupGenerator())
- return;
+ GTEST_SKIP();
LineTable < = setupTable();
LT.addStandardOpcode(Opcode, Operands);
runTest(Opcode);
@@ -1867,7 +1867,7 @@ TEST_F(DebugLineBasicFixture, DISABLED_PrintPathsProperly) {
TEST_F(DebugLineBasicFixture, PrintPathsProperly) {
#endif
if (!setupGenerator(5))
- return;
+ GTEST_SKIP();
LineTable < = Gen->addLineTable();
DWARFDebugLine::Prologue P = LT.createBasicPrologue();
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDieManualExtractTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDieManualExtractTest.cpp
index fd5f138f7733..6e2ed2f62bcf 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDieManualExtractTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDieManualExtractTest.cpp
@@ -25,7 +25,7 @@ TEST(DWARFDie, manualExtractDump) {
uint16_t Version = 4;
Triple Triple = getDefaultTargetTripleForAddrSize(sizeof(AddrType));
if (!isConfigurationSupported(Triple))
- return;
+ GTEST_SKIP();
auto ExpectedDG = dwarfgen::Generator::create(Triple, Version);
ASSERT_THAT_EXPECTED(ExpectedDG, Succeeded());
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp
index ae7301b84314..68738e3a3044 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp
@@ -51,7 +51,7 @@ void DWARFExpressionCompactPrinterTest::TestExprPrinter(
ArrayRef<uint8_t> ExprData, StringRef Expected) {
// If we didn't build ARM, do not run the test.
if (!MRI)
- return;
+ GTEST_SKIP();
// Print the expression, passing in the subprogram DIE, and check that the
// result is as expected.
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp
index d94341554719..5a6ce2ffbbe8 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp
@@ -185,7 +185,7 @@ void DWARFExpressionCopyBytesTest::readAndCheckObjFile(
void DWARFExpressionCopyBytesTest::testExpr(ArrayRef<uint8_t> ExprData) {
// If we didn't build x86, do not run the test.
if (!MRI)
- return;
+ GTEST_SKIP();
DataExtractor DE(ExprData, true, 8);
DWARFExpression Expr(DE, 8);
More information about the llvm-commits
mailing list