Skip to content

Commit

Permalink
ci: Use C++ instead of the test_parse scripts (endless-sky#9449)
Browse files Browse the repository at this point in the history
  • Loading branch information
quyykk authored Dec 17, 2023
1 parent 8337e62 commit d0f98f4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 91 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ jobs:
with:
name: windows-dlls
- name: Parse Datafiles
run: .\utils\test_parse.ps1 'Endless Sky.exe'
run: "'./Endless Sky.exe' -p"
shell: bash
- name: Parse Integration Test Data
run: .\utils\test_parse.ps1 'Endless Sky.exe' tests/integration/config
run: "'./Endless Sky.exe' -p --config 'tests/integration/config'"
shell: bash
11 changes: 8 additions & 3 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,13 @@ int main(int argc, char *argv[])
bool noTestMute = false;
string testToRunName;

// Whether the game has encountered errors while loading.
bool hasErrors = false;
// Ensure that we log errors to the errors.txt file.
Logger::SetLogErrorCallback([](const string &errorMessage) { Files::LogErrorToFile(errorMessage); });
Logger::SetLogErrorCallback([&hasErrors](const string &errorMessage) {
hasErrors = true;
Files::LogErrorToFile(errorMessage);
});

for(const char *const *it = argv + 1; *it; ++it)
{
Expand Down Expand Up @@ -164,8 +169,8 @@ int main(int argc, char *argv[])
// then check the default state of the universe.
if(!player.LoadRecent())
GameData::CheckReferences();
cout << "Parse completed." << endl;
return 0;
cout << "Parse completed with " << (hasErrors ? "at least one" : "no") << " error(s)." << endl;
return hasErrors;
}
assert(!isConsoleOnly && "Attempting to use UI when only data was loaded!");

Expand Down
38 changes: 0 additions & 38 deletions utils/test_parse.ps1

This file was deleted.

48 changes: 0 additions & 48 deletions utils/test_parse.sh

This file was deleted.

0 comments on commit d0f98f4

Please sign in to comment.