#! /bin/sh
-# Copyright (C) 2008-2012 Free Software Foundation, Inc.
+# Copyright (C) 2008-2013 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Make sure nobase_* works for python files.
required=python
-. ./defs || Exit 1
+. test-init.sh
cat >>configure.ac <<EOF
AM_PATH_PYTHON
mydir=$(prefix)/my
my_PYTHON = one.py sub/base.py
nobase_my_PYTHON = two.py sub/nobase.py
-
-test-install-data: install-data
- find inst -print; : For debugging.
- test -f inst/my/one.py
- test -f inst/my/one.pyc
- test -f inst/my/two.py
- test -f inst/my/two.pyc
- test -f inst/my/base.py
- test -f inst/my/base.pyc
- test -f inst/my/sub/nobase.py
- test -f inst/my/sub/nobase.pyc
- test ! -f inst/my/nobase.py
- test ! -f inst/my/nobase.pyc
END
+test_install()
+{
+ $MAKE install-data
+ find inst -print # For debugging.
+ py_installed inst/my/one.py
+ py_installed inst/my/one.pyc
+ py_installed inst/my/two.py
+ py_installed inst/my/two.pyc
+ py_installed inst/my/base.py
+ py_installed inst/my/base.pyc
+ py_installed inst/my/sub/nobase.py
+ py_installed inst/my/sub/nobase.pyc
+ py_installed --not inst/my/nobase.py
+ py_installed --not inst/my/nobase.pyc
+}
+
+test_uninstall()
+{
+ $MAKE uninstall
+ test -d inst/my
+ ! find inst/my -type f -print | grep .
+}
+
mkdir sub
for file in one.py sub/base.py two.py sub/nobase.py; do
./configure --prefix "$(pwd)/inst" --program-prefix=p
$MAKE
-$MAKE test-install-data
-$MAKE uninstall
-
-find inst/my -type f -print | grep . && Exit 1
+test_install
+test_uninstall
$MAKE install-strip
+test_uninstall
# Likewise, in a VPATH build.
-$MAKE uninstall
$MAKE distclean
mkdir build
cd build
../configure --prefix "$(pwd)/inst" --program-prefix=p
-$MAKE
-$MAKE test-install-data
-$MAKE uninstall
-find inst/my -type f -print | grep . && Exit 1
+test_install
+test_uninstall
: