Skip to content

Commit 9defa6a

Browse files
committed
Skeletal a8 tests
1 parent 17de91b commit 9defa6a

File tree

8 files changed

+53
-2
lines changed

8 files changed

+53
-2
lines changed

.github/workflows/package.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ jobs:
4444
make --silent -j 4
4545
mkdir -p ${{ env.LIBRETRO_CORES_DIR }}
4646
mv stella2014_libretro.so ${{ env.LIBRETRO_CORES_DIR }}
47+
- name: 'Build "atari800" core'
48+
if: steps.cache.outputs.cache-hit != 'true'
49+
run: |
50+
git clone https://github.com/libretro/libretro-atari800
51+
cd libretro-atari800/
52+
make --silent -j 4
53+
mkdir -p ${{ env.LIBRETRO_CORES_DIR }}
54+
mv atari800_libretro.so ${{ env.LIBRETRO_CORES_DIR }}
4755
- name: Build Mesen-X core
4856
if: steps.cache.outputs.cache-hit != 'true'
4957
run: |

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ if(NOT CMAKE_CROSSCOMPILING)
5252
PATHS ENV EMUTEST_DIR)
5353
message(STATUS "Emutest test runner: ${EMUTEST_COMMAND}")
5454

55+
find_library(LIBRETRO_ATARI800_CORE
56+
NAMES
57+
atari800_libretro.so atari800_libretro.dylib atari800_libretro.dll
58+
PATHS /lib64/libretro ENV LIBRETRO_CORES_DIR)
59+
message(STATUS "Libretro Atari800 core: ${LIBRETRO_ATARI800_CORE}")
60+
5561
find_library(LIBRETRO_STELLA_CORE
5662
NAMES
5763
stella2014_libretro.so stella2014_libretro.dylib stella2014_libretro.dll

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,21 @@ Copy `test/mesen_settings.xml` to this folder.
306306

307307
Install emutest (requires Go 1.21):
308308
```console
309-
$ go install https://github.com/kivutar/emutest
309+
$ go install github.com/kivutar/emutest@latest
310310
```
311311

312-
Make sure `$GOBIN` (usually `~/go/bin`) is included in your PATH environment variable so that CMake can find the binary, or set the `EMUTEST_DIR` environment variable to point to this directory before running `cmake -G` for the first time.
312+
Make sure `$GOBIN` (usually `~/go/bin`) is included in your `PATH`
313+
environment variable so that CMake can find the binary, or set the
314+
`EMUTEST_DIR` environment variable to point to this directory before
315+
running `cmake -G` for the first time.
316+
317+
You can verify emutest with `emutest -h < /dev/null` on the
318+
command-line.
313319

314320
Build Libretro cores for desired target(s):
315321

316322
* Atari 2600 - https://github.com/libretro/stella2014-libretro
323+
* Atari 800 - https://github.com/libretro/libretro-atari800
317324
* NES - https://github.com/NovaSquirrel/Mesen-X
318325

319326
Copy the output Libretro core library files (they have extensions .so | .dylib | .dll) to a shared directory, maybe `$HOME/libretro`.

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ add_test_target(nes-unrom)
4141
add_test_target(nes-unrom-512)
4242
add_test_target(atari2600-4k)
4343
add_test_target(atari2600-3e)
44+
add_test_target(atari8-dos)

test/atari8-dos/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cmake_minimum_required(VERSION 3.18)
2+
3+
project(test-atari8-dos LANGUAGES C)
4+
5+
include(./test.cmake)

test/atari8-dos/hw.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
#include <stdio.h>
3+
4+
int main(void) {
5+
puts("atari says hello");
6+
for(;;);
7+
}

test/atari8-dos/test.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
include(../test.cmake)
3+
4+
#TODO; zp test
5+
#TODO; .bss test
6+
#TODO; .data test
7+
8+
add_a8_test(hw ../atari8-dos)
9+
set_property(TEST test-hw PROPERTY ENVIRONMENT EMUTEST_FB_CRC_PASS=000000000)

test/test.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ function(add_no_compile_test target)
3131
set_property(TEST ${target}-no-compile PROPERTY WILL_FAIL YES)
3232
endfunction()
3333

34+
function(add_a8_test name)
35+
set(source_dir ".")
36+
if(ARGC GREATER 1)
37+
set(source_dir ${ARGV1})
38+
endif()
39+
add_emutest_test(${name} a26 ${source_dir} LIBRETRO_ATARI800_CORE)
40+
endfunction()
41+
3442
function(add_vcs_test name)
3543
set(source_dir ".")
3644
if(ARGC GREATER 1)

0 commit comments

Comments
 (0)