mirror of
https://github.com/fmang/opustags.git
synced 2025-01-15 20:53:16 +01:00
t: only run opustags.t in UTF-8 environments
This commit is contained in:
parent
191796a3d2
commit
d09d7bd634
@ -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
|
||||
)
|
||||
|
10
t/opustags.t
10
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];
|
||||
|
Loading…
x
Reference in New Issue
Block a user