Skip to content

Commit 89ee7fb

Browse files
committed
Adding test.
1 parent 515affa commit 89ee7fb

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

tests/pcsxrunner/timers.cc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/***************************************************************************
2+
* Copyright (C) 2026 PCSX-Redux authors *
3+
* *
4+
* This program is free software; you can redistribute it and/or modify *
5+
* it under the terms of the GNU General Public License as published by *
6+
* the Free Software Foundation; either version 2 of the License, or *
7+
* (at your option) any later version. *
8+
* *
9+
* This program is distributed in the hope that it will be useful, *
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12+
* GNU General Public License for more details. *
13+
* *
14+
* You should have received a copy of the GNU General Public License *
15+
* along with this program; if not, write to the *
16+
* Free Software Foundation, Inc., *
17+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
18+
***************************************************************************/
19+
20+
#include "gtest/gtest.h"
21+
#include "main/main.h"
22+
23+
TEST(Timers, Interpreter) {
24+
MainInvoker invoker("-no-ui", "-run", "-bios", "src/mips/openbios/openbios.bin", "-testmode", "-interpreter",
25+
"-luacov", "-loadexe", "src/mips/tests/timers/timers.ps-exe");
26+
int ret = invoker.invoke();
27+
EXPECT_EQ(ret, 0);
28+
}
29+
30+
TEST(Timers, Dynarec) {
31+
MainInvoker invoker("-no-ui", "-run", "-bios", "src/mips/openbios/openbios.bin", "-testmode", "-dynarec",
32+
"-luacov", "-loadexe", "src/mips/tests/timers/timers.ps-exe");
33+
int ret = invoker.invoke();
34+
EXPECT_EQ(ret, 0);
35+
}

vsprojects/tests/pcsxrunner/pcsxrunner.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@
260260
<ClCompile Include="..\..\..\tests\pcsxrunner\memcpy.cc" />
261261
<ClCompile Include="..\..\..\tests\pcsxrunner\memset.cc" />
262262
<ClCompile Include="..\..\..\tests\pcsxrunner\pcdrv.cc" />
263+
<ClCompile Include="..\..\..\tests\pcsxrunner\timers.cc" />
263264
</ItemGroup>
264265
<ItemGroup>
265266
<None Include="packages.config" />

vsprojects/tests/pcsxrunner/pcsxrunner.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
<ClCompile Include="..\..\..\tests\pcsxrunner\memset.cc">
4646
<Filter>Source Files</Filter>
4747
</ClCompile>
48+
<ClCompile Include="..\..\..\tests\pcsxrunner\timers.cc">
49+
<Filter>Source Files</Filter>
50+
</ClCompile>
4851
</ItemGroup>
4952
<ItemGroup>
5053
<None Include="packages.config" />

0 commit comments

Comments
 (0)