diff options
author | Pavel Raiskup <praiskup@redhat.com> | 2014-09-22 16:52:28 +0200 |
---|---|---|
committer | Pavel Raiskup <praiskup@redhat.com> | 2014-09-23 08:48:08 +0200 |
commit | 66b8c42003a69f5b46cf6cf531e60129d8f234df (patch) | |
tree | 2e320c64a9ec62c632d2c7bdae89c31dfc85b70e /tests/testsuite.at | |
parent | 6cd95c8b1aa5da85ce752a54f468fa491bfa5065 (diff) | |
download | postgresql-setup-66b8c42003a69f5b46cf6cf531e60129d8f234df.tar.gz postgresql-setup-66b8c42003a69f5b46cf6cf531e60129d8f234df.tar.xz postgresql-setup-66b8c42003a69f5b46cf6cf531e60129d8f234df.zip |
tests: add basic bash syntax check
* tests/testsuite.at: New test.
* configure.ac (AC_INIT): Bump version. Use only major-minor
versions.
Diffstat (limited to 'tests/testsuite.at')
-rw-r--r-- | tests/testsuite.at | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/tests/testsuite.at b/tests/testsuite.at index 81f2b2f..970a414 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -1,17 +1,36 @@ AT_INIT AT_COLOR_TESTS -AT_SETUP([Check files are generated correctly]) -AT_CHECK([file_list=$abs_top_builddir/$TEST_GEN_FILES_LIST -test -f "$file_list" || { echo "no such file '$file_list'" ; exit 1 ; } +m4_define([gen_file_list], [$abs_top_builddir/$TEST_GEN_FILES_LIST]) + +AT_SETUP([Files instantiated correctly]) +AT_CHECK([ +test -f "gen_file_list" || { echo "no such file 'gen_file_list'" ; exit 1 ; } pattern='@[[a-zA-Z0-9_]]*@' while read file; do file=$abs_top_builddir/$file grep $pattern $file && echo "file $file is incomplete" && exit 1 -done < $file_list +done < gen_file_list exit 0 ]) AT_CLEANUP + +AT_SETUP([Basic bash syntax check]) +AT_CHECK([file_list=$abs_top_builddir/$TEST_GEN_FILES_LIST +while read file; do + file=$abs_top_builddir/$file + line="`head -1 $file`" + case "$line" in + "#!/bin/bash") + bash -n $file || exit 1 + ;; + "#!/bin/sh") + sh -n $file || exit 1 + ;; + esac +done < gen_file_list +]) +AT_CLEANUP |