Skip to content

Commit

Permalink
Skeletal a8 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cwedgwood committed Dec 12, 2023
1 parent 17de91b commit 9defa6a
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ jobs:
make --silent -j 4
mkdir -p ${{ env.LIBRETRO_CORES_DIR }}
mv stella2014_libretro.so ${{ env.LIBRETRO_CORES_DIR }}
- name: 'Build "atari800" core'
if: steps.cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/libretro/libretro-atari800
cd libretro-atari800/
make --silent -j 4
mkdir -p ${{ env.LIBRETRO_CORES_DIR }}
mv atari800_libretro.so ${{ env.LIBRETRO_CORES_DIR }}
- name: Build Mesen-X core
if: steps.cache.outputs.cache-hit != 'true'
run: |
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ if(NOT CMAKE_CROSSCOMPILING)
PATHS ENV EMUTEST_DIR)
message(STATUS "Emutest test runner: ${EMUTEST_COMMAND}")

find_library(LIBRETRO_ATARI800_CORE
NAMES
atari800_libretro.so atari800_libretro.dylib atari800_libretro.dll
PATHS /lib64/libretro ENV LIBRETRO_CORES_DIR)
message(STATUS "Libretro Atari800 core: ${LIBRETRO_ATARI800_CORE}")

find_library(LIBRETRO_STELLA_CORE
NAMES
stella2014_libretro.so stella2014_libretro.dylib stella2014_libretro.dll
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,21 @@ Copy `test/mesen_settings.xml` to this folder.

Install emutest (requires Go 1.21):
```console
$ go install https://github.com/kivutar/emutest
$ go install github.com/kivutar/emutest@latest
```

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.
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.

You can verify emutest with `emutest -h < /dev/null` on the
command-line.

Build Libretro cores for desired target(s):

* Atari 2600 - https://github.com/libretro/stella2014-libretro
* Atari 800 - https://github.com/libretro/libretro-atari800
* NES - https://github.com/NovaSquirrel/Mesen-X

Copy the output Libretro core library files (they have extensions .so | .dylib | .dll) to a shared directory, maybe `$HOME/libretro`.
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ add_test_target(nes-unrom)
add_test_target(nes-unrom-512)
add_test_target(atari2600-4k)
add_test_target(atari2600-3e)
add_test_target(atari8-dos)
5 changes: 5 additions & 0 deletions test/atari8-dos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.18)

project(test-atari8-dos LANGUAGES C)

include(./test.cmake)
7 changes: 7 additions & 0 deletions test/atari8-dos/hw.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

#include <stdio.h>

int main(void) {
puts("atari says hello");
for(;;);
}
9 changes: 9 additions & 0 deletions test/atari8-dos/test.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

include(../test.cmake)

#TODO; zp test
#TODO; .bss test
#TODO; .data test

add_a8_test(hw ../atari8-dos)
set_property(TEST test-hw PROPERTY ENVIRONMENT EMUTEST_FB_CRC_PASS=000000000)
8 changes: 8 additions & 0 deletions test/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ function(add_no_compile_test target)
set_property(TEST ${target}-no-compile PROPERTY WILL_FAIL YES)
endfunction()

function(add_a8_test name)
set(source_dir ".")
if(ARGC GREATER 1)
set(source_dir ${ARGV1})
endif()
add_emutest_test(${name} a26 ${source_dir} LIBRETRO_ATARI800_CORE)
endfunction()

function(add_vcs_test name)
set(source_dir ".")
if(ARGC GREATER 1)
Expand Down

0 comments on commit 9defa6a

Please sign in to comment.