diff --git a/t/CMakeLists.txt b/t/CMakeLists.txt index 2ceef8b..87a3a51 100644 --- a/t/CMakeLists.txt +++ b/t/CMakeLists.txt @@ -17,6 +17,6 @@ configure_file(gobble.opus . COPYONLY) add_custom_target( check - COMMAND prove "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" + COMMAND prove "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" DEPENDS opustags gobble.opus system.t opus.t ogg.t cli.t ) diff --git a/t/opustags.t b/t/opustags.t index ed5c7e5..f0fcb01 100755 --- a/t/opustags.t +++ b/t/opustags.t @@ -1,9 +1,5 @@ #!/usr/bin/env perl -# This test assumes the following system environment: -# - The current locale is UTF-8. -# - Locale fr_FR.ISO-8859-1 is available. - use strict; use warnings; use utf8; @@ -19,6 +15,12 @@ use Symbol 'gensym'; my $opustags = '../opustags'; BAIL_OUT("$opustags does not exist or is not executable") if (! -x $opustags); +my $is_utf8; +open(my $ctype, 'locale -k LC_CTYPE |'); +while (<$ctype>) { $is_utf8 = 1 if (/^charmap="UTF-?8"$/i) } +close($ctype); +BAIL_OUT("this test must be run from an UTF-8 environment") unless $is_utf8; + sub opustags { my %opt; %opt = %{pop @_} if ref $_[-1];