Add checks for decoding from and encoding to UTF-8 filenames
This commit is contained in:
parent
1bec35e337
commit
61649d09aa
@ -18,6 +18,10 @@ if(NOT UNIX)
|
|||||||
add_test(NAME flac_help
|
add_test(NAME flac_help
|
||||||
COMMAND $<TARGET_FILE:flacapp> --help
|
COMMAND $<TARGET_FILE:flacapp> --help
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
add_test(NAME flac_utf8_test COMMAND $<TARGET_FILE:flacapp> -t
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/flac-to-flac-metadata-test-files/שלום.flac"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/flac-to-flac-metadata-test-files/Prøve.flac"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/flac-to-flac-metadata-test-files/🤔.flac")
|
||||||
add_test(NAME metaflac_help
|
add_test(NAME metaflac_help
|
||||||
COMMAND $<TARGET_FILE:metaflac> --help
|
COMMAND $<TARGET_FILE:metaflac> --help
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
@ -36,7 +40,7 @@ endif()
|
|||||||
|
|
||||||
configure_file(common.sh.in common.sh @ONLY)
|
configure_file(common.sh.in common.sh @ONLY)
|
||||||
|
|
||||||
set(ALL_TESTS libFLAC grabbag flac metaflac replaygain seeking streams compression)
|
set(ALL_TESTS libFLAC grabbag)
|
||||||
|
|
||||||
add_test(NAME libFLAC
|
add_test(NAME libFLAC
|
||||||
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_libFLAC.sh"
|
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_libFLAC.sh"
|
||||||
@ -51,26 +55,44 @@ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/cuesheets")
|
|||||||
add_test(NAME grabbag
|
add_test(NAME grabbag
|
||||||
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_grabbag.sh"
|
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_grabbag.sh"
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
add_test(NAME flac
|
if(BUILD_PROGRAMS)
|
||||||
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_flac.sh"
|
add_test(NAME flac
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_flac.sh"
|
||||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/metaflac-test-files")
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
add_test(NAME metaflac
|
# UTF-8 must be tested separately on Windows because busybox-w32 doesn't support UTF-8
|
||||||
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_metaflac.sh"
|
if(BUSYBOX_EXE)
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
add_test(NAME flac_utf8_test COMMAND $<TARGET_FILE:flacapp> -t
|
||||||
add_test(NAME replaygain
|
"${CMAKE_CURRENT_SOURCE_DIR}/flac-to-flac-metadata-test-files/שלום.flac"
|
||||||
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_replaygain.sh"
|
"${CMAKE_CURRENT_SOURCE_DIR}/flac-to-flac-metadata-test-files/Prøve.flac"
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
"${CMAKE_CURRENT_SOURCE_DIR}/flac-to-flac-metadata-test-files/🤔.flac")
|
||||||
add_test(NAME seeking
|
list(APPEND ALL_TESTS flac_utf8_test)
|
||||||
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_seeking.sh"
|
endif()
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/metaflac-test-files")
|
||||||
add_test(NAME streams
|
add_test(NAME metaflac
|
||||||
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_streams.sh"
|
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_metaflac.sh"
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
# increase this if standard 1500 seconds are not enough
|
add_test(NAME replaygain
|
||||||
# set_tests_properties(streams PROPERTIES TIMEOUT 1500)
|
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_replaygain.sh"
|
||||||
add_test(NAME compression
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_compression.sh"
|
add_test(NAME seeking
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_seeking.sh"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
add_test(NAME streams
|
||||||
|
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_streams.sh"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
# increase this if standard 1500 seconds are not enough
|
||||||
|
# set_tests_properties(streams PROPERTIES TIMEOUT 1500)
|
||||||
|
add_test(NAME compression
|
||||||
|
COMMAND ${BUSYBOX_EXE} ${BUSYBOX_CMD} "${CMAKE_CURRENT_SOURCE_DIR}/test_compression.sh"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
list(APPEND ALL_TESTS flac metaflac replaygain seeking streams compression)
|
||||||
|
endif()
|
||||||
|
|
||||||
set_property(TEST ${ALL_TESTS} APPEND PROPERTY ENVIRONMENT ECHO_C=\\c)
|
|
||||||
|
set_property(TEST ${ALL_TESTS} APPEND PROPERTY ENVIRONMENT FLAC__TEST_LEVEL=1)
|
||||||
|
if(BUSYBOX_EXE)
|
||||||
|
set_property(TEST ${ALL_TESTS} APPEND PROPERTY ENVIRONMENT ECHO_N=-n)
|
||||||
|
set_property(TEST ${ALL_TESTS} APPEND PROPERTY ENVIRONMENT WIN32BUSYBOX=yes)
|
||||||
|
else()
|
||||||
|
set_property(TEST ${ALL_TESTS} APPEND PROPERTY ENVIRONMENT ECHO_C=\\c)
|
||||||
|
endif()
|
||||||
|
BIN
test/flac-to-flac-metadata-test-files/Prøve.flac
Normal file
BIN
test/flac-to-flac-metadata-test-files/Prøve.flac
Normal file
Binary file not shown.
BIN
test/flac-to-flac-metadata-test-files/שלום.flac
Normal file
BIN
test/flac-to-flac-metadata-test-files/שלום.flac
Normal file
Binary file not shown.
BIN
test/flac-to-flac-metadata-test-files/🤔.flac
Normal file
BIN
test/flac-to-flac-metadata-test-files/🤔.flac
Normal file
Binary file not shown.
@ -1290,6 +1290,36 @@ if [ "$FLAC__TEST_LEVEL" -gt 1 ] ; then
|
|||||||
test_total_samples_overflow 68719476737 0
|
test_total_samples_overflow 68719476737 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
# test handling of UTF-8 filenames
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
test_utf8_handling ()
|
||||||
|
{
|
||||||
|
echo $ECHO_N "Test decoding from $1... " $ECHO_C
|
||||||
|
run_flac -d $testdatadir/$1 -o out.wav
|
||||||
|
if [ -f out.wav ] ; then
|
||||||
|
echo "OK"
|
||||||
|
else
|
||||||
|
die "Decoding failed"
|
||||||
|
fi
|
||||||
|
echo $ECHO_N "Test encoding to $1... " $ECHO_C
|
||||||
|
run_flac out.wav -o $1
|
||||||
|
if [ -f $1 ] ; then
|
||||||
|
echo "OK"
|
||||||
|
else
|
||||||
|
die "Encoding failed"
|
||||||
|
fi
|
||||||
|
rm $1 out.wav
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$WIN32BUSYBOX" != "yes" ]; then
|
||||||
|
test_utf8_handling שלום.flac
|
||||||
|
test_utf8_handling 🤔.flac
|
||||||
|
test_utf8_handling Prøve.flac
|
||||||
|
fi
|
||||||
|
|
||||||
rm -f out.flac out.meta out1.meta
|
rm -f out.flac out.meta out1.meta
|
||||||
|
|
||||||
#@@@ when metaflac handles ogg flac, duplicate flac2flac tests here
|
#@@@ when metaflac handles ogg flac, duplicate flac2flac tests here
|
||||||
|
Loading…
Reference in New Issue
Block a user