From 2d8700ca0761ad51b44aea03e8a663a95bd263a8 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 26 Mar 2009 17:58:27 +0000 Subject: Always add aliases to post targets. Build module sources when testing (with the wrapper) Fix testsuite to actually run. svn path=/trunk/iconv/; revision=6902 --- Makefile | 4 + aliases/Makefile | 4 +- module/INDEX | 0 module/Makefile | 4 +- test/GNU/Makefile | 216 ++++++++++++++++++++++++----------------------- test/GNU/check-stateful | 21 ++--- test/GNU/check-stateless | 28 +++--- 7 files changed, 143 insertions(+), 134 deletions(-) create mode 100644 module/INDEX diff --git a/Makefile b/Makefile index e4ab0f9..d5d700b 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,10 @@ include build/makefiles/Makefile.tools TESTRUNNER := $(PERL) build/testtools/testrunner.pl +ifneq ($(HOST),riscos) + export UNICODE_DIR := $(CURDIR)/riscos/!Boot/Resources/!Unicode/ +endif + # Toolchain flags WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \ -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ diff --git a/aliases/Makefile b/aliases/Makefile index ab4a720..119181c 100644 --- a/aliases/Makefile +++ b/aliases/Makefile @@ -18,8 +18,6 @@ $(aliases): $(makealiases) $(addprefix $(DIR)data/, $(aliases_DATA)) $(makealiases): $(addprefix $(DIR), $(makealiases_SRCS)) $(Q)$(HOST_CC) $(HOST_CFLAGS) -o $@ $^ -ifeq ($(MAKECMDGOALS),riscos-dist) - POST_TARGETS := $(POST_TARGETS) $(aliases) -endif +POST_TARGETS := $(POST_TARGETS) $(aliases) include build/makefiles/Makefile.subdir diff --git a/module/INDEX b/module/INDEX new file mode 100644 index 0000000..e69de29 diff --git a/module/Makefile b/module/Makefile index 192774d..90114cf 100644 --- a/module/Makefile +++ b/module/Makefile @@ -1,5 +1,7 @@ ifeq ($(COMPONENT_TYPE),riscos-module) - DIR_SOURCES := header.cmhg module.c menu.c wrapper.c + DIR_SOURCES := header.cmhg module.c menu.c endif +DIR_TEST_ITEMS := iconv:module.c;menu.c;wrapper.c + include build/makefiles/Makefile.subdir diff --git a/test/GNU/Makefile b/test/GNU/Makefile index 0a91e89..0daa5f6 100644 --- a/test/GNU/Makefile +++ b/test/GNU/Makefile @@ -3,116 +3,116 @@ DIR_TEST_ITEMS := table-from:table-from.c table-to:table-to.c DIR_TEST_ITEMS := $(DIR_TEST_ITEMS) genutf8:genutf8.c gengb18030z:gengb18030z.c testGNU: $(DIR) - $(CURDIR)/$ $(CURDIR)/$ $(CURDIR)/$ $(CURDIR)/$ $(CURDIR)/$ \n"; + print "Usage: check-stateful \n"; exit; } -my $top = shift @ARGV; -my $srcdir = shift @ARGV; -my $charset = shift @ARGV; +my $builddir = shift @ARGV; +my $exeext = shift @ARGV; +my $srcdir = shift @ARGV; +my $charset = shift @ARGV; # charset, modified for use in filenames. my $charsetf = $charset; $charsetf =~ s/:/-/g; -command("$top/Iconv -f $charset -t UTF-8 -o $srcdir/tmp-snippet $srcdir/$charsetf-snippet"); -command("cmp $srcdir/$charsetf-snippet.UTF-8 $srcdir/tmp-snippet"); -command("$top/Iconv -f UTF-8 -t $charset -o $srcdir/tmp-snippet $srcdir/$charsetf-snippet.UTF-8"); -command("cmp $srcdir/$charsetf-snippet $srcdir/tmp-snippet"); -command("rm -f $srcdir/tmp-snippet"); +command("$builddir/module_iconv$exeext -f $charset -t UTF-8 -o $builddir/tmp-snippet $srcdir/$charsetf-snippet"); +command("cmp $srcdir/$charsetf-snippet.UTF-8 $builddir/tmp-snippet"); +command("$builddir/module_iconv$exeext -f UTF-8 -t $charset -o $builddir/tmp-snippet $srcdir/$charsetf-snippet.UTF-8"); +command("cmp $srcdir/$charsetf-snippet $builddir/tmp-snippet"); +command("rm -f $builddir/tmp-snippet"); sub command { my $cmd = shift; diff --git a/test/GNU/check-stateless b/test/GNU/check-stateless index 42479ed..23b5c1b 100755 --- a/test/GNU/check-stateless +++ b/test/GNU/check-stateless @@ -1,43 +1,45 @@ #!/usr/bin/perl # Complete check of a stateless encoding. -# Usage: check-stateless TOP SRCDIR CHARSET +# Usage: check-stateless BUILDDIR SRCDIR CHARSET use warnings; use strict; if (@ARGV < 3) { - print "Usage: check-stateless \n"; exit; } -my $top = shift @ARGV; -my $srcdir = shift @ARGV; -my $charset = shift @ARGV; +my $builddir = shift @ARGV; +my $srcdir = shift @ARGV; +my $charset = shift @ARGV; + +my $prefix = $builddir . "/test_GNU_"; # charset, modified for use in filenames. my $charsetf = $charset; $charsetf =~ s/:/-/g; # iconv in one direction. -command("$srcdir/table-from $charset > $srcdir/tmp-$charsetf.TXT"); +command("${prefix}table-from $charset > $builddir/tmp-$charsetf.TXT"); # iconv in the other direction. -command("$srcdir/table-to $charset | sort > $srcdir/tmp-$charsetf.INVERSE.TXT"); +command("${prefix}table-to $charset | sort > $builddir/tmp-$charsetf.INVERSE.TXT"); # Check 1: charmap and iconv forward should be identical. -command("cmp $srcdir/$charsetf.TXT $srcdir/tmp-$charsetf.TXT 2> /dev/null"); +command("cmp $srcdir/$charsetf.TXT $builddir/tmp-$charsetf.TXT 2> /dev/null"); # Check 2: the difference between the charmap and iconv backward. -command("sed -e '/ .* 0x/d' < $srcdir/$charsetf.TXT > $srcdir/tmp-noprecomposed-$charsetf.TXT"); +command("sed -e '/ .* 0x/d' < $srcdir/$charsetf.TXT > $builddir/tmp-noprecomposed-$charsetf.TXT"); if (-f "$srcdir/$charsetf.IRREVERSIBLE.TXT") { - command("cat $srcdir/tmp-noprecomposed-$charsetf.TXT $srcdir/$charsetf.IRREVERSIBLE.TXT | sort | uniq -u > $srcdir/tmp-orig-$charsetf.INVERSE.TXT"); + command("cat $builddir/tmp-noprecomposed-$charsetf.TXT $srcdir/$charsetf.IRREVERSIBLE.TXT | sort | uniq -u > $builddir/tmp-orig-$charsetf.INVERSE.TXT"); } else { - command("cp $srcdir/tmp-noprecomposed-$charsetf.TXT $srcdir/tmp-orig-$charsetf.INVERSE.TXT"); + command("cp $builddir/tmp-noprecomposed-$charsetf.TXT $builddir/tmp-orig-$charsetf.INVERSE.TXT"); } -command("cmp $srcdir/tmp-orig-$charsetf.INVERSE.TXT $srcdir/tmp-$charsetf.INVERSE.TXT 2> /dev/null"); +command("cmp $builddir/tmp-orig-$charsetf.INVERSE.TXT $builddir/tmp-$charsetf.INVERSE.TXT 2> /dev/null"); -command("rm -f $srcdir/tmp-$charsetf.TXT $srcdir/tmp-$charsetf.INVERSE.TXT $srcdir/tmp-noprecomposed-$charsetf.TXT $srcdir/tmp-orig-$charsetf.INVERSE.TXT"); +command("rm -f $builddir/tmp-$charsetf.TXT $builddir/tmp-$charsetf.INVERSE.TXT $builddir/tmp-noprecomposed-$charsetf.TXT $builddir/tmp-orig-$charsetf.INVERSE.TXT"); sub command { my $cmd = shift; -- cgit v1.2.3