diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2013-07-26 17:04:21 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2013-07-26 17:35:11 +0200 |
commit | 30ffdb205971bf9c2c0c376d24b081ff2964e739 (patch) | |
tree | 0866b85fbe19afa92b6ac4761ada027f7225ff91 /tests | |
parent | 10eec70ba47dd5f48698e2346f05c65448bb92f8 (diff) |
Test Python syntax on make check
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 8 | ||||
-rwxr-xr-x | tests/test_pycompile.sh | 30 |
2 files changed, 36 insertions, 2 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 13d34fc..184b79e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -19,14 +19,18 @@ # 02110-1301 USA TESTS = test_dict test_set test_tio test_expr test_getpeercred test_cfg \ - test_myldap.sh test_common test_nsscmds.sh test_pamcmds.sh + test_myldap.sh test_common test_nsscmds.sh test_pamcmds.sh \ + test_pycompile.sh + +AM_TESTS_ENVIRONMENT = PYTHON='@PYTHON@'; export PYTHON; check_PROGRAMS = test_dict test_set test_tio test_expr test_getpeercred \ test_cfg test_myldap test_common \ lookup_netgroup lookup_shadow EXTRA_DIST = nslcd-test.conf test_myldap.sh test_nsscmds.sh test_pamcmds.sh \ - in_testenv.sh test_pamcmds.expect usernames.txt + test_pycompile.sh in_testenv.sh test_pamcmds.expect \ + usernames.txt CLEANFILES = $(EXTRA_PROGRAMS) diff --git a/tests/test_pycompile.sh b/tests/test_pycompile.sh new file mode 100755 index 0000000..21a1751 --- /dev/null +++ b/tests/test_pycompile.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +# test_pycompile.sh - see if all Python files compile +# +# Copyright (C) 2013 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +set -e + +# find source directory +srcdir="${srcdir-`dirname "$0"`}" +top_srcdir="${top_srcdir-${srcdir}/..}" +python="${PYTHON-python}" + +# compile all Python files +${python} -m compileall -f -q "${top_srcdir}" |