mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Add RGBGFX tests
This commit is contained in:
@@ -77,12 +77,23 @@ else(GIT)
|
|||||||
message(STATUS "Cannot determine RGBDS version (Git not installed), falling back")
|
message(STATUS "Cannot determine RGBDS version (Git not installed), falling back")
|
||||||
endif(GIT)
|
endif(GIT)
|
||||||
|
|
||||||
|
find_package(PkgConfig)
|
||||||
|
if(MSVC OR NOT PKG_CONFIG_FOUND)
|
||||||
|
# fallback to find_package
|
||||||
|
find_package(PNG REQUIRED)
|
||||||
|
else()
|
||||||
|
pkg_check_modules(LIBPNG REQUIRED libpng)
|
||||||
|
endif()
|
||||||
|
|
||||||
include_directories("${PROJECT_SOURCE_DIR}/include")
|
include_directories("${PROJECT_SOURCE_DIR}/include")
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 11)
|
set(CMAKE_C_STANDARD 11)
|
||||||
set(CMAKE_C_STANDARD_REQUIRED True)
|
set(CMAKE_C_STANDARD_REQUIRED True)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
add_subdirectory(test)
|
||||||
|
|
||||||
# By default, build in Release mode; Debug mode must be explicitly requested
|
# By default, build in Release mode; Debug mode must be explicitly requested
|
||||||
# (You may want to augment it with the options above)
|
# (You may want to augment it with the options above)
|
||||||
|
|||||||
@@ -14,14 +14,6 @@ set(common_src
|
|||||||
"_version.c"
|
"_version.c"
|
||||||
)
|
)
|
||||||
|
|
||||||
find_package(PkgConfig)
|
|
||||||
if(MSVC OR NOT PKG_CONFIG_FOUND)
|
|
||||||
# fallback to find_package
|
|
||||||
find_package(PNG REQUIRED)
|
|
||||||
else()
|
|
||||||
pkg_check_modules(LIBPNG REQUIRED libpng)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(BISON REQUIRED)
|
find_package(BISON REQUIRED)
|
||||||
set(BISON_FLAGS "-Wall")
|
set(BISON_FLAGS "-Wall")
|
||||||
# Set sompe optimization flags on versions that support them
|
# Set sompe optimization flags on versions that support them
|
||||||
@@ -104,8 +96,6 @@ foreach(PROG "asm" "fix" "gfx" "link")
|
|||||||
install(TARGETS rgb${PROG} RUNTIME DESTINATION bin)
|
install(TARGETS rgb${PROG} RUNTIME DESTINATION bin)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
set_target_properties(rgbgfx PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED True)
|
|
||||||
|
|
||||||
if(LIBPNG_FOUND) # pkg-config
|
if(LIBPNG_FOUND) # pkg-config
|
||||||
target_include_directories(rgbgfx PRIVATE ${LIBPNG_INCLUDE_DIRS})
|
target_include_directories(rgbgfx PRIVATE ${LIBPNG_INCLUDE_DIRS})
|
||||||
target_link_directories(rgbgfx PRIVATE ${LIBPNG_LIBRARY_DIRS})
|
target_link_directories(rgbgfx PRIVATE ${LIBPNG_LIBRARY_DIRS})
|
||||||
|
|||||||
21
test/CMakeLists.txt
Normal file
21
test/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
add_executable(randtilegen gfx/randtilegen.c)
|
||||||
|
if(NOT MSVC)
|
||||||
|
target_compile_options(randtilegen PRIVATE -Wno-vla)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_executable(rgbgfx_test gfx/rgbgfx_test.cpp)
|
||||||
|
|
||||||
|
install(TARGETS randtilegen rgbgfx_test DESTINATION ${rgbds_SOURCE_DIR}/test/gfx)
|
||||||
|
|
||||||
|
foreach(TARGET randtilegen rgbgfx_test)
|
||||||
|
if(LIBPNG_FOUND) # pkg-config
|
||||||
|
target_include_directories(${TARGET} PRIVATE ${LIBPNG_INCLUDE_DIRS})
|
||||||
|
target_link_directories(${TARGET} PRIVATE ${LIBPNG_LIBRARY_DIRS})
|
||||||
|
target_link_libraries(${TARGET} PRIVATE ${LIBPNG_LIBRARIES})
|
||||||
|
else()
|
||||||
|
target_compile_definitions(${TARGET} PRIVATE ${PNG_DEFINITIONS})
|
||||||
|
target_include_directories(${TARGET} PRIVATE ${PNG_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(${TARGET} PRIVATE ${PNG_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
BIN
test/gfx/seed0.bin
Normal file
BIN
test/gfx/seed0.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed1.bin
Normal file
BIN
test/gfx/seed1.bin
Normal file
Binary file not shown.
2
test/gfx/seed10.bin
Normal file
2
test/gfx/seed10.bin
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
2<EFBFBD>.<2E><>C<><43><EFBFBD>pA22<32>VD<56><44>u2IEU<45><55><EFBFBD>_<EFBFBD>/!<21><05>p<EFBFBD><EFBFBD><C281>!<21>o-/^<5E><><EFBFBD>uNV0<56><30>g<12><>T <20><>?<3F>%<25><16>IA#1<>|<7C>$<24>tt<74><05>τ$<24><>W<10>^`ďف;W<><57>JP!<21><pm<18><17><><EFBFBD><EFBFBD>;HZw<5A><77>MvUx<55><78>+<2B><><16><>e<EFBFBD><65><EFBFBD>'[$<24><>؋g<D88B><08>HcL<15><><EFBFBD>\u<>E,ԥ_<><5F><EFBFBD>!<21><><EFBFBD>;lw<6C>?<3F><><15><><EFBFBD>?܃<>k<>TЎ{Z<><5A><EFBFBD><EFBFBD>AR<41><52>W˱<57><CBB1><EFBFBD><EFBFBD>h*<05>b<10><>C$<24><><EFBFBD>[2x(<28>E`<60>8,<2C>=<3D>,ᾡ<>i<EFBFBD>;<3B><><EFBFBD><EFBFBD>7<EFBFBD>!<21><>0<EFBFBD><30>m<EFBFBD><6D><EFBFBD>fy+<2B><>wk<77>PYS<59><53>&<26><>Wb<><62>A<>x<EFBFBD><02>O<EFBFBD><4F>F\y<05><><EFBFBD><EFBFBD>r>f<>q.ժ<>#<23>]<5D>i<03><>D<>.m<><13>v<EFBFBD><<3C><11><>\5c<35>JW<4A>N<><4E>=nq<6E><71><EFBFBD>gY9<59>Aa<41><61>a<EFBFBD><61>8?<3F><><EFBFBD><11>~uc<>[<5B><><EFBFBD>
|
||||||
|
<17><>(<28><>[<5B>q<EFBFBD><71><EFBFBD>B>QM<51><05>z<EFBFBD>_.<2E><>p<EFBFBD>r<EFBFBD><72><EFBFBD>y<EFBFBD><79><EFBFBD>w<EFBFBD><77><EFBFBD><EFBFBD>~<7E>s<EFBFBD>;<0F><>Mߏ<4D>]/<2F>hX<68>+6fq<13><><EFBFBD>0Go<47><6F>BE<42><45><EFBFBD>R<EFBFBD>D<><44>b<EFBFBD><62>Am5İ<35><C4B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>g<EFBFBD><67>l<EFBFBD><1F><>:H<18><>
|
||||||
BIN
test/gfx/seed11.bin
Normal file
BIN
test/gfx/seed11.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed12.bin
Normal file
BIN
test/gfx/seed12.bin
Normal file
Binary file not shown.
1
test/gfx/seed13.bin
Normal file
1
test/gfx/seed13.bin
Normal file
@@ -0,0 +1 @@
|
|||||||
|
?x<><78>)&<<3C>av<61><01>(˷z<><0F>ߕx_;<3B>yc&o<><6F>$<24><>w<EFBFBD><77><EFBFBD>x<>TST+<2B><>ǑX<><58>g<EFBFBD><67>t<07><><EFBFBD><EFBFBD><EFBFBD>|c<0B>UJ=<3D><>u<lP<6C><50>>І<><D086><EFBFBD><EFBFBD>[g$Ca<43><07>I<49>ÃsI5;<3B><>D2<44><32>jD[ <20>S+<2B><><EFBFBD>c<EFBFBD><63><0F>8[j<12>?<3F><>D<EFBFBD><44><EFBFBD><19><><01><><EFBFBD>D,<2C><><EFBFBD>r<EFBFBD><72>Iٽ<49>N<EFBFBD>
|
||||||
BIN
test/gfx/seed14.bin
Normal file
BIN
test/gfx/seed14.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed15.bin
Normal file
BIN
test/gfx/seed15.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed16.bin
Normal file
BIN
test/gfx/seed16.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed17.bin
Normal file
BIN
test/gfx/seed17.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed18.bin
Normal file
BIN
test/gfx/seed18.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed19.bin
Normal file
BIN
test/gfx/seed19.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed2.bin
Normal file
BIN
test/gfx/seed2.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed20.bin
Normal file
BIN
test/gfx/seed20.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed21.bin
Normal file
BIN
test/gfx/seed21.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed22.bin
Normal file
BIN
test/gfx/seed22.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed23.bin
Normal file
BIN
test/gfx/seed23.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed24.bin
Normal file
BIN
test/gfx/seed24.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed25.bin
Normal file
BIN
test/gfx/seed25.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed26.bin
Normal file
BIN
test/gfx/seed26.bin
Normal file
Binary file not shown.
3
test/gfx/seed27.bin
Normal file
3
test/gfx/seed27.bin
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD>.[)<29>(<05>l%<25>!<21><0C><19><><EFBFBD>\Ƕ<>W|'R2<52><32><EFBFBD>x<EFBFBD><78><EFBFBD>8<><0C><>tUfZ<13>]<5D>~<0F><>Ů<19>oZ.<1C>v<EFBFBD><76><07>Xc,<2C>nό<07><>Pl8<6C>#<23>Z<~<7E>?<3F>y%<25>S<EFBFBD>*<2A>,@e&<26><><EFBFBD>Xc<58>ɟ<EFBFBD><C99F><EFBFBD>'<27><><EFBFBD><EFBFBD>$zOgn<67>ü<EFBFBD><C3BC>7Mb<7F>Y<EFBFBD><59>y<EFBFBD><79>q#c<>S<EFBFBD>D<EFBFBD>b<><62><1A>#<23>/<2F><>JnOK<4F><4B>AƁ0b<30><62>/)Wm<57>R&<26><>AwW%-<2D><0B>><3E><><0C><>=<3D>0<>a<EFBFBD>B<EFBFBD><42><08><><EFBFBD><EFBFBD>y<EFBFBD>1?<3F>] <09>v<EFBFBD>b<EFBFBD><62><EFBFBD>?A#f<0B><>d<EFBFBD>i<>hf<11>&<26>[ \ϫ<><18><>+<<3C>oj<6F><6A>?<3F> <20><>d<EFBFBD><64>'<27><>&f<><66><EFBFBD>G:pz<70>e<EFBFBD>ܶ<EFBFBD>w;ABy<42>[<5B><><EFBFBD>L<18>w<EFBFBD>ݮFr<46><72>-<2D><><04><>r<EFBFBD><72>o&<26>s̼`f<><66>dp<19>F<EFBFBD>n2-<2D>26E<36><45><EFBFBD>ĕ<EFBFBD><C495>qx<71>Ez<45><7A><EFBFBD>@<40>S<EFBFBD>N<>5;F<>a<>]#<23>it<69>R<EFBFBD><52> !ֵ<><D6B5>+6*<2A><01>3<EFBFBD>K<EFBFBD><4B><EFBFBD><EFBFBD>F<1E>I<EFBFBD>/[ )<29>]<5D>ag<61><67><EFBFBD>]J<><4A><1B><><EFBFBD>C<EFBFBD>5?<3F><><0E><><<3C>8e.<2E><><EFBFBD><EFBFBD>.GM
|
||||||
|
<EFBFBD><EFBFBD>dK$<24><>R
|
||||||
BIN
test/gfx/seed28.bin
Normal file
BIN
test/gfx/seed28.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed29.bin
Normal file
BIN
test/gfx/seed29.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed3.bin
Normal file
BIN
test/gfx/seed3.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed4.bin
Normal file
BIN
test/gfx/seed4.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed5.bin
Normal file
BIN
test/gfx/seed5.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed6.bin
Normal file
BIN
test/gfx/seed6.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed7.bin
Normal file
BIN
test/gfx/seed7.bin
Normal file
Binary file not shown.
BIN
test/gfx/seed8.bin
Normal file
BIN
test/gfx/seed8.bin
Normal file
Binary file not shown.
1
test/gfx/seed9.bin
Normal file
1
test/gfx/seed9.bin
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<04><><EFBFBD><18>E6<45><36> <20><EFBFBD><7F><EFBFBD>*OƸq<71><7F>)<29><>D<><44><18>m<EFBFBD><6D>eW<65><57><EFBFBD><EFBFBD><EFBFBD><EFBFBD>{<7B>3;<3B>Ba<><61>T<EFBFBD>ُ<EFBFBD>ic:<3A><0F>K<EFBFBD><4B><EFBFBD><EFBFBD>%<25>"<22>ށ.Wf<57><66>/<2F>S<13><>A<EFBFBD>+<2B><08><><EFBFBD><EFBFBD><EFBFBD>nU<6E><55><EFBFBD>tr1<72><31>D<><44><EFBFBD>q.<2E><><EFBFBD>(o<>`Vd<56><64><EFBFBD≯<EFBFBD>p<EFBFBD>uB<75>&<04>;x<,`\w<>r<EFBFBD>h<EFBFBD><68>.<2E>ƨ<EFBFBD>C%V<><56>_]<5D>
|
||||||
11
test/gfx/test.sh
Executable file
11
test/gfx/test.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
[[ -e ./rgbgfx_test ]] || make -C ../.. test/gfx/rgbgfx_test
|
||||||
|
[[ -e ./randtilegen ]] || make -C ../.. test/gfx/randtilegen
|
||||||
|
|
||||||
|
rc=0
|
||||||
|
for f in *.bin; do
|
||||||
|
./rgbgfx_test "$f" || rc=1
|
||||||
|
done
|
||||||
|
|
||||||
|
exit $rc
|
||||||
@@ -14,7 +14,7 @@ fi
|
|||||||
|
|
||||||
# Tests included with the repository
|
# Tests included with the repository
|
||||||
|
|
||||||
for dir in asm link fix; do
|
for dir in asm link fix gfx; do
|
||||||
pushd $dir
|
pushd $dir
|
||||||
./test.sh
|
./test.sh
|
||||||
popd
|
popd
|
||||||
|
|||||||
Reference in New Issue
Block a user