Add RGBGFX tests

This commit is contained in:
ISSOtm
2022-04-25 09:39:30 +02:00
committed by Eldred Habert
parent a77b0b396a
commit cbf6fadcdb
35 changed files with 51 additions and 11 deletions

View File

@@ -77,12 +77,23 @@ else(GIT)
message(STATUS "Cannot determine RGBDS version (Git not installed), falling back")
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")
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
add_subdirectory(src)
add_subdirectory(test)
# By default, build in Release mode; Debug mode must be explicitly requested
# (You may want to augment it with the options above)

View File

@@ -14,14 +14,6 @@ set(common_src
"_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)
set(BISON_FLAGS "-Wall")
# 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)
endforeach()
set_target_properties(rgbgfx PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED True)
if(LIBPNG_FOUND) # pkg-config
target_include_directories(rgbgfx PRIVATE ${LIBPNG_INCLUDE_DIRS})
target_link_directories(rgbgfx PRIVATE ${LIBPNG_LIBRARY_DIRS})

21
test/CMakeLists.txt Normal file
View 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

Binary file not shown.

BIN
test/gfx/seed1.bin Normal file

Binary file not shown.

2
test/gfx/seed10.bin Normal file
View File

@@ -0,0 +1,2 @@
2ä.ü¤CôŃŢpA22ĽVDňĐu2IEUŞä„_Ă/!ĂpÄÂ<C384>»<EFBFBD>!Ňo-/^€áŠuNV0ř<30>g¬ÂT ú‡?Ó%ëÄIA#1|Ő$čtt—îĎ„$ ”Wß^ `ÄŹŮ<>;WĘßJP!÷<pm‹»ŽŘ;HZwËűMvUxß+ŽŮóće±©„'[$Ś™Ř˙HcL“äĺ\u·E,ÔĄ_ł‰Á!™äů;lwě?<3F>Ç­űĹ?Ü<>śkTĐŽ{Züę˙çARńŰW˱řËř˘h*űbŰŔC$ ÄŢ[2x(űE`<60>8,Ď=Ě,ᾡ¦ić;¦€ĹŇ7Ç!…ó0¬ĆmđŇäfy+Ńßwk®PYS„˙&Ŕ·W­Aóx¦ęOĺČF\yč«úłr>fŢq.ŐŞ“#Ô]˛i˝µDÇ.Îv̢»\5cůJWĹN<>€=nqţň<C5A3>gY9úAa­™aÇď8?šž“~uc§[¨<>Ă
łó(®“[ qÜć¤B>QMśďzµ _. “pÎr¸çyö—ůý~ňsś;­ÂMߏŤ]/ähXŚ+6fqťŽÓ0GoűţBE˘đµR„DźßbČŰAm5İůÚńÎćĆgŇßläŹŰ:Híű

BIN
test/gfx/seed11.bin Normal file

Binary file not shown.

BIN
test/gfx/seed12.bin Normal file

Binary file not shown.

1
test/gfx/seed13.bin Normal file
View File

@@ -0,0 +1 @@
?x‰œ)&<òavý×(Ë·µß•x_;½yc& o¸¼$<24>éw¬ô•TST+™îÇ‘X¸þgðàt<>¨Ò|c ýUJ=»âu<lP¨±>ІÈÍÁ¯[g$Ca„¯IÞ¿îÃsI5;<3B>ÉD2<44>¤jD[ ¡S+ôÁ¬c¥¤ý8[j<12><>D™Àެ–жÉD,¤é°rãØIÙ½°Nö

BIN
test/gfx/seed14.bin Normal file

Binary file not shown.

BIN
test/gfx/seed15.bin Normal file

Binary file not shown.

BIN
test/gfx/seed16.bin Normal file

Binary file not shown.

BIN
test/gfx/seed17.bin Normal file

Binary file not shown.

BIN
test/gfx/seed18.bin Normal file

Binary file not shown.

BIN
test/gfx/seed19.bin Normal file

Binary file not shown.

BIN
test/gfx/seed2.bin Normal file

Binary file not shown.

BIN
test/gfx/seed20.bin Normal file

Binary file not shown.

BIN
test/gfx/seed21.bin Normal file

Binary file not shown.

BIN
test/gfx/seed22.bin Normal file

Binary file not shown.

BIN
test/gfx/seed23.bin Normal file

Binary file not shown.

BIN
test/gfx/seed24.bin Normal file

Binary file not shown.

BIN
test/gfx/seed25.bin Normal file

Binary file not shown.

BIN
test/gfx/seed26.bin Normal file

Binary file not shown.

3
test/gfx/seed27.bin Normal file
View File

@@ -0,0 +1,3 @@
އ
î.[)©(Ýl%€ Ñ»å­\ǶW|'R2ìÃÞx”ßé ÏøtUfZ Œ]š~àÀÅ®»oZ.žv¾ÃµXc,¢nÏŒÂÃPl8Ã#ïZ<~û?y%¼SÚ*ÿ,@e&²›ˆXcÄÉŸÒÕå'Äø£<C3B8>$zOgn™Ã¼¶…7Mb€YÙäy<C3A4>¤q #c¼SøD©b¨…Ë#ý/×òJnOK¤²AÆ<41>0bœ•/)Wm¶R&‡<>AwW%-Õ Ñ>ŠÞ ‰þ=Í 0êa­Béúà¤ùÊy¥1?¹] Àvúb·ÁÝ ?A#f æ´i²hf¹&[ \Ï«³ÈÀ+<šojë™?ï ´Ãdšÿ'Óë&fêïæG:pzÎe—ܶÿw;AByÓ[¯é¸L·wÈÝ®FrìÊ-†çÅËrö¤o&ºs̼`fì¢dp€Fån2-†26E¯øªÄ•®èqxÁEzºÚÆ@ÓSÊN­5;FÒ a ]#ŽitÚR»È !Öµ§¬+6*öÁ3¹Kÿ„¯°F¼Iâ/[ )Ê]åag¸”Ä]J¸Â«×ÂCå5?´<>Þó<£8e.ƒäÌí.GM
¾édK$¨<>R

BIN
test/gfx/seed28.bin Normal file

Binary file not shown.

BIN
test/gfx/seed29.bin Normal file

Binary file not shown.

BIN
test/gfx/seed3.bin Normal file

Binary file not shown.

BIN
test/gfx/seed4.bin Normal file

Binary file not shown.

BIN
test/gfx/seed5.bin Normal file

Binary file not shown.

BIN
test/gfx/seed6.bin Normal file

Binary file not shown.

BIN
test/gfx/seed7.bin Normal file

Binary file not shown.

BIN
test/gfx/seed8.bin Normal file

Binary file not shown.

1
test/gfx/seed9.bin Normal file
View File

@@ -0,0 +1 @@
ЅЈКСE6ЬЭ <20>Љ<7F><D089>*OЦИqяе)ЪіDтД№mыЦeWЧсУиёЫ{Ы3Ba<><61>TЌй<D08C>јic:ёДKбіЙФ%Я"Жо<D096>.WfІе/ѓSЕћAё+к<08>Ј<EFBFBD><D088>ђnUнч<D0BD>tr1неD<><44>Ќq.щфЮ(oё`VdК<64>ЬЬИЖp<D096>uBЛ&д;x<,Т<>`\w<>rПhЖ§.<2E>ЦЈдC%Vхі_]Р

11
test/gfx/test.sh Executable file
View 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

View File

@@ -14,7 +14,7 @@ fi
# Tests included with the repository
for dir in asm link fix; do
for dir in asm link fix gfx; do
pushd $dir
./test.sh
popd