Skip to content

Commit 305008f

Browse files
committed
Tests: Add possibility to verify symbols file
1 parent 760e23c commit 305008f

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Main/Tests.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,28 @@ bool TestRunner::executeTest(const fs::path& dir, const std::string& testName, s
169169
}
170170
}
171171

172+
if (fs::exists("expected.sym"))
173+
{
174+
TextFile expectedFile;
175+
TextFile actualFile;
176+
expectedFile.open("expected.sym",TextFile::Read);
177+
actualFile.open("output.sym",TextFile::Read);
178+
if (actualFile.isOpen())
179+
{
180+
std::vector<std::string> expected = expectedFile.readAll();
181+
std::vector<std::string> actual = actualFile.readAll();
182+
183+
if (expected != actual)
184+
{
185+
errorString += tfm::format("Symbols file does not match\n");
186+
result = false;
187+
}
188+
} else {
189+
errorString += tfm::format("Symbols file not produced\n");
190+
result = false;
191+
}
192+
}
193+
172194
fs::current_path(oldDir);
173195
return result;
174196
}

Tests/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
output.bin
2+
output.sym
23
output.txt
34
*.temp.txt

0 commit comments

Comments
 (0)