mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 02:37:35 +00:00
Meta+Tests: Allow running FLAC spec tests
The FLAC "spec tests", or rather the test suite by xiph that exercises weird FLAC features and edge cases, can be found at https://github.com/ietf-wg-cellar/flac-test-files and is a good challenge for our FLAC decoder to become more spec compliant. Running these tests is similar to LibWasm spec tests, you need to pass INCLUDE_FLAC_SPEC_TESTS to CMake. As of integrating these tests, 23 out of 63 fail. :yakplus:
This commit is contained in:
parent
6587638ffe
commit
c91511b883
8 changed files with 108 additions and 0 deletions
|
@ -12,6 +12,7 @@ serenity_option(ENABLE_COMPILETIME_HEADER_CHECK OFF CACHE BOOL "Enable compileti
|
|||
serenity_option(ENABLE_TIME_ZONE_DATABASE_DOWNLOAD ON CACHE BOOL "Enable download of the IANA Time Zone Database at build time")
|
||||
serenity_option(ENABLE_UNICODE_DATABASE_DOWNLOAD ON CACHE BOOL "Enable download of Unicode UCD and CLDR files at build time")
|
||||
serenity_option(INCLUDE_WASM_SPEC_TESTS OFF CACHE BOOL "Download and include the WebAssembly spec testsuite")
|
||||
serenity_option(INCLUDE_FLAC_SPEC_TESTS OFF CACHE BOOL "Download and include the FLAC spec testsuite")
|
||||
|
||||
serenity_option(HACKSTUDIO_BUILD OFF CACHE BOOL "Automatically enabled when building from HackStudio")
|
||||
|
||||
|
|
29
Meta/CMake/flac_spec_tests.cmake
Normal file
29
Meta/CMake/flac_spec_tests.cmake
Normal file
|
@ -0,0 +1,29 @@
|
|||
include(utils)
|
||||
|
||||
if(INCLUDE_FLAC_SPEC_TESTS)
|
||||
if (CMAKE_PROJECT_NAME STREQUAL "SerenityOS")
|
||||
set(SOURCE_DIR "${SerenityOS_SOURCE_DIR}")
|
||||
else()
|
||||
set(SOURCE_DIR "${SERENITY_PROJECT_ROOT}")
|
||||
endif()
|
||||
set(FLAC_SPEC_TEST_GZ_URL https://github.com/ietf-wg-cellar/flac-test-files/archive/refs/heads/main.tar.gz)
|
||||
|
||||
set(FLAC_TEST_PATH ${CMAKE_BINARY_DIR}/Tests/LibAudio/FLAC CACHE PATH "Location of FLAC tests")
|
||||
set(FLAC_SPEC_TEST_GZ_PATH ${FLAC_TEST_PATH}/flac-spec-testsuite.tar.gz)
|
||||
set(FLAC_SPEC_TEST_PATH ${FLAC_TEST_PATH}/SpecTests)
|
||||
|
||||
if(NOT EXISTS ${FLAC_SPEC_TEST_GZ_PATH})
|
||||
message(STATUS "Downloading the IETF CELLAR FLAC testsuite from ${FLAC_SPEC_TEST_GZ_URL}...")
|
||||
download_file(${FLAC_SPEC_TEST_GZ_URL} ${FLAC_SPEC_TEST_GZ_PATH})
|
||||
endif()
|
||||
|
||||
if(EXISTS ${FLAC_SPEC_TEST_GZ_PATH} AND NOT EXISTS ${FLAC_SPEC_TEST_PATH})
|
||||
file(MAKE_DIRECTORY ${FLAC_SPEC_TEST_PATH})
|
||||
message(STATUS "Extracting the FLAC testsuite from ${FLAC_SPEC_TEST_GZ_PATH}...")
|
||||
execute_process(COMMAND "${TAR_TOOL}" -xzf ${FLAC_SPEC_TEST_GZ_PATH} -C ${FLAC_TEST_PATH} RESULT_VARIABLE tar_result)
|
||||
if (NOT tar_result EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to unzip ${FLAC_TEST_PATH} from ${FLAC_SPEC_TEST_GZ_PATH} with status ${tar_result}")
|
||||
endif()
|
||||
file(RENAME "${FLAC_TEST_PATH}/flac-test-files-main/subset" ${FLAC_SPEC_TEST_PATH})
|
||||
endif()
|
||||
endif()
|
|
@ -61,6 +61,7 @@ if (ENABLE_FUZZERS_LIBFUZZER OR ENABLE_FUZZERS_OSSFUZZ)
|
|||
endif()
|
||||
|
||||
include(wasm_spec_tests)
|
||||
include(flac_spec_tests)
|
||||
include(lagom_compile_options)
|
||||
|
||||
include(GNUInstallDirs) # make sure to include before we mess w/RPATH
|
||||
|
@ -643,6 +644,12 @@ if (BUILD_LAGOM)
|
|||
lagom_test(${source} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/AK)
|
||||
endforeach()
|
||||
|
||||
# LibAudio
|
||||
file(GLOB LIBAUDIO_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibAudio/*.cpp")
|
||||
foreach(source ${LIBAUDIO_TEST_SOURCES})
|
||||
lagom_test(${source} LIBS LibAudio WORKING_DIRECTORY ${FLAC_TEST_PATH})
|
||||
endforeach()
|
||||
|
||||
# LibCore
|
||||
lagom_test(../../Tests/LibCore/TestLibCoreIODevice.cpp WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibCore)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue