mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Remove test file download logic from CMakeLists.txt and copy file directly
This commit is contained in:
@@ -27,28 +27,7 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/flac.flac DESTINATION ${CMAKE_CURRENT
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/audio.bin DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/lzma.bin DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/data.bin DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
||||
|
||||
# Download test file from aaru.app if not already present
|
||||
set(TEST_FILE_URL "https://www.claunia.com/tests_aaru/mf2hd_v1.aif")
|
||||
set(TEST_FILE_PATH "${CMAKE_CURRENT_BINARY_DIR}/data/mf2hd_v1.aif")
|
||||
|
||||
if(NOT EXISTS "${TEST_FILE_PATH}")
|
||||
message(STATUS "Downloading test file from ${TEST_FILE_URL}")
|
||||
file(DOWNLOAD "${TEST_FILE_URL}" "${TEST_FILE_PATH}"
|
||||
SHOW_PROGRESS
|
||||
STATUS download_status
|
||||
TIMEOUT 60)
|
||||
list(GET download_status 0 status_code)
|
||||
list(GET download_status 1 status_string)
|
||||
|
||||
if(NOT status_code EQUAL 0)
|
||||
message(WARNING "Failed to download ${TEST_FILE_URL}: ${status_string}")
|
||||
else()
|
||||
message(STATUS "Successfully downloaded test file to ${TEST_FILE_PATH}")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Test file already exists: ${TEST_FILE_PATH}")
|
||||
endif()
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/mf2hd_v1.aif DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/data/)
|
||||
|
||||
# Test executable (all unit tests)
|
||||
add_executable(tests_run crc64.cpp spamsum.cpp crc32.c crc32.h flac.cpp lzma.cpp sha256.cpp md5.cpp sha1.cpp open_image.cpp)
|
||||
|
||||
BIN
tests/data/mf2hd_v1.aif
Executable file
BIN
tests/data/mf2hd_v1.aif
Executable file
Binary file not shown.
Reference in New Issue
Block a user