summaryrefslogtreecommitdiff
path: root/test/GNU/check-stateful
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-11-13 00:43:22 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-11-13 00:43:22 +0000
commit1e27fedc75e11311af66666655996aa5fe2960e2 (patch)
tree237b9f2200b45149beb1f7dc27cfbd3f72259e21 /test/GNU/check-stateful
parentdb524b69d0cc2d982c3d9f8496a33d7bff9308b8 (diff)
downloadiconv-1e27fedc75e11311af66666655996aa5fe2960e2.tar.gz
iconv-1e27fedc75e11311af66666655996aa5fe2960e2.tar.bz2
Import GNU libiconv testsuite, suitably hacked to fit into our buildsystem.
This still needs a bit of work, not least to get sensible automated testing. It currently requires manual inspection of the output, which isn't all that great. svn path=/trunk/iconv/; revision=5690
Diffstat (limited to 'test/GNU/check-stateful')
-rwxr-xr-xtest/GNU/check-stateful26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/GNU/check-stateful b/test/GNU/check-stateful
new file mode 100755
index 0000000..027b52c
--- /dev/null
+++ b/test/GNU/check-stateful
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+# Simple check of a stateful encoding.
+# Usage: check-stateful TOP SRCDIR CHARSET
+
+use warnings;
+use strict;
+
+if (@ARGV < 3) {
+ print "Usage: check-stateful <top> <srcdir> <charset>\n";
+ exit;
+}
+
+my $top = shift @ARGV;
+my $srcdir = shift @ARGV;
+my $charset = shift @ARGV;
+
+# charset, modified for use in filenames.
+my $charsetf = $charset;
+$charsetf =~ s/:/-/g;
+
+`$top/Iconv -f $charset -t UTF-8 -o tmp-snippet $srcdir/$charsetf-snippet`;
+`cmp $srcdir/$charsetf-snippet.UTF-8 tmp-snippet`;
+`$top/Iconv -f UTF-8 -t $charset -o tmp-snippet $srcdir/$charsetf-snippet.UTF-8`;
+`cmp $srcdir/$charsetf-snippet tmp-snippet`;
+`rm -f tmp-snippet`;
+