Tizen 2.0 Release
[external/tizen-coreutils.git] / tests / head / Makefile.am
1 # Make coreutils tests.                                 -*-Makefile-*-
2
3 # Copyright (C) 1997, 1998, 2000, 2003, 2004, 2006 Free Software
4 # Foundation, Inc.
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 # 02110-1301, USA.
20
21 ##test-files-begin
22 x = head
23 explicit = in in-1024
24 maint_gen = idem-0.I idem-0.X idem-1.I idem-1.X idem-2.I idem-2.X idem-3.I \
25 idem-3.X basic-0-10.I basic-0-10.X basic-0-09.I basic-0-09.X basic-0-11.I \
26 basic-0-11.X obs-0.I obs-0.X obs-1.I obs-1.X obs-2.I obs-2.X obs-3.I obs-3.X \
27 fail-1.I fail-1.X null-1.I null-1.X no-oct-1.I no-oct-1.X no-oct-2.I \
28 no-oct-2.X no-oct-3.I no-oct-3.X no-oct-4.I no-oct-4.X posix-0.I posix-0.X \
29 posix-1.I posix-1.X posix-2.I posix-2.X posix-3.I posix-3.X
30 run_gen = idem-0.O idem-0.E idem-1.O idem-1.E idem-2.O idem-2.E idem-3.O \
31 idem-3.E basic-0-10.O basic-0-10.E basic-0-09.O basic-0-09.E basic-0-11.O \
32 basic-0-11.E obs-0.O obs-0.E obs-1.O obs-1.E obs-2.O obs-2.E obs-3.O obs-3.E \
33 obs-4.O obs-4.E obs-5.O obs-5.E fail-1.O fail-1.E null-1.O null-1.E \
34 no-oct-1.O no-oct-1.E no-oct-2.O no-oct-2.E no-oct-3.O no-oct-3.E no-oct-4.O \
35 no-oct-4.E posix-0.O posix-0.E posix-1.O posix-1.E posix-2.O posix-2.E \
36 posix-3.O posix-3.E posix-4.O posix-4.E posix-5.O posix-5.E
37 ##test-files-end
38
39 EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
40 noinst_SCRIPTS = $x-tests
41 TESTS_ENVIRONMENT = \
42   CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
43   PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
44
45 editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g'
46
47 TESTS = $x-tests
48
49 mk_script = $(srcdir)/../mk-script
50 $(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am
51         test '$x' = test && prog=../../src/$x || prog=$x; \
52         $(PERL) -I$(srcdir) -w -- $(mk_script) $(srcdir) $$prog > $@.n
53         mv $@.n $@
54         chmod 755 $@
55
56 MAINTAINERCLEANFILES = $x-tests $(maint_gen)
57 CLEANFILES = $(run_gen)
58
59 check: $(maint_gen)
60
61 $(srcdir)/Makefile.am: ../Makefile.am.in Test.pm $(mk_script)
62         rm -f $@ $@t
63         sed -n '1,/^##test-files-begin/p' $(srcdir)/../Makefile.am.in > $@t
64         tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \
65           echo "x = $$tool" >> $@t
66         $(PERL) -I$(srcdir) -w -- $(mk_script) $(srcdir) --list >> $@t
67         sed -n '/^##test-files-end/,$$p' $(srcdir)/../Makefile.am.in >> $@t
68         chmod -w $@t
69         mv $@t $@