Skip to content

Commit 43f77a5

Browse files
committed
Added more logging for finding why test is failing: TestCLI.testRegisterFile
https://www.travis-ci.org/github/end2endzone/bin2cpp/builds/681934565
1 parent 9440190 commit 43f77a5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/bin2cpp_unittest/TestCLI.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,8 +1570,17 @@ TEST_F(TestCLI, testRegisterFile)
15701570
ASSERT_FALSE(identical);
15711571

15721572
//assert second file register itself
1573-
ASSERT_TEXT_IN_FILE(true, backupCppFile2.c_str(), "RegisterFile(&");
1574-
1573+
{
1574+
const char * token = "RegisterFile(&";
1575+
int line = -1;
1576+
int col = -1;
1577+
std::string content;
1578+
bool readed = ra::filesystem::ReadTextFile(backupCppFile2.c_str(), content);
1579+
ASSERT_TRUE( readed );
1580+
bool textFound = ra::testing::FindInFile(backupCppFile2.c_str(), token, line, col);
1581+
ASSERT_TRUE(textFound) << "The token '" << token << "' was NOT found in file '" << backupCppFile2.c_str() << "'.\n\n" << content;
1582+
}
1583+
15751584
//cleanup
15761585
ASSERT_TRUE(deleteFile(outputFilePath.c_str()));
15771586
ASSERT_TRUE(deleteFile(headerFilePath.c_str()));

0 commit comments

Comments
 (0)