Tizen 2.0 Release
[external/tizen-coreutils.git] / tests / Makefile.am.in
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 ##test-files-end
23
24 EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
25 noinst_SCRIPTS = $x-tests
26 TESTS_ENVIRONMENT = \
27   CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
28   PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
29
30 editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g'
31
32 TESTS = $x-tests
33
34 mk_script = $(srcdir)/../mk-script
35 $(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am
36         test '$x' = test && prog=../../src/$x || prog=$x; \
37         $(PERL) -I$(srcdir) -w -- $(mk_script) $(srcdir) $$prog > $@.n
38         mv $@.n $@
39         chmod 755 $@
40
41 MAINTAINERCLEANFILES = $x-tests $(maint_gen)
42 CLEANFILES = $(run_gen)
43
44 check: $(maint_gen)
45
46 $(srcdir)/Makefile.am: ../Makefile.am.in Test.pm $(mk_script)
47         rm -f $@ $@t
48         sed -n '1,/^##test-files-begin/p' $(srcdir)/../Makefile.am.in > $@t
49         tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \
50           echo "x = $$tool" >> $@t
51         $(PERL) -I$(srcdir) -w -- $(mk_script) $(srcdir) --list >> $@t
52         sed -n '/^##test-files-end/,$$p' $(srcdir)/../Makefile.am.in >> $@t
53         chmod -w $@t
54         mv $@t $@