Skip to content

Commit 60cb5e3

Browse files
committed
Adding replay test mechanism
1 parent 626fe4a commit 60cb5e3

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

.github/workflows/ubuntu-gcc.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,10 @@ jobs:
3434
- name: Build
3535
# Build your program with the given configuration
3636
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
37+
38+
- name: Tests
39+
# Run TFE tests such as replay verification for any deltas
40+
- name: Run Tests
41+
run: |
42+
chmod +x ${{github.workspace}}/build/TheForceEngine/Tests/runTests.sh
43+
${{github.workspace}}/build/TheForceEngine/Tests/runTests.sh

TheForceEngine/TFE_Input/replay.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,11 +1123,11 @@ namespace TFE_Input
11231123
restoreGameSettings();
11241124
restoreInputs();
11251125

1126-
TFE_System::logWrite(LOG_MSG, "Replay", "Finished playing back demo...");
1127-
11281126
enableCutscenes(cutscenesEnabled);
11291127
endCommonReplayStates();
11301128

1129+
TFE_System::logWrite(LOG_MSG, "Replay", "Finished playing back demo...");
1130+
11311131
if (TFE_Settings::getTempSettings()->exit_after_replay)
11321132
{
11331133
TFE_FrontEndUI::setState(APP_STATE_QUIT);
421 KB
Binary file not shown.

TheForceEngine/Tests/runTests.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# TFE Does not like ~ so lets expand it
2+
user_path=~
3+
4+
# Run the demo and generate new log file
5+
$user_path/tfe/theforceengine -gDark -r$user_path/tfe/TheForceEngine/Tests/Replays/base_test.demo --demo_logging --exit_after_replay
6+
7+
# Diff Results of the rest
8+
result=`diff <(tail -n 1 $user_path/.local/share/TheForceEngine/replay.log) <(tail -n 1 $user_path/tfe/TheForceEngine/Tests/Replays/base_replay.log)`
9+
10+
if $result > /dev/null; then
11+
exit 0
12+
else
13+
echo $result
14+
exit 1
15+
fi
16+

0 commit comments

Comments
 (0)