diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-10-12 02:44:25 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-10-12 02:44:25 +0200 |
commit | de580e7999400b7d8789ce3747db4f2a63f2538b (patch) | |
tree | 968cd75d779c844123dc10a0b3999f80628c90cc | |
parent | bc7d2545d47bf54acebb38ab3d1e2dd7251ddb99 (diff) | |
download | blogc-de580e7999400b7d8789ce3747db4f2a63f2538b.tar.gz blogc-de580e7999400b7d8789ce3747db4f2a63f2538b.tar.bz2 blogc-de580e7999400b7d8789ce3747db4f2a63f2538b.zip |
build: use bash, but get it properly during build time
hardcoding it for travis, as bash is always installed there.
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | Makefile.am | 12 | ||||
-rwxr-xr-x | build-aux/travis-build.sh | 2 | ||||
-rwxr-xr-x | build-aux/travis-deploy.sh | 2 | ||||
-rwxr-xr-x | build-aux/valgrind.sh | 4 | ||||
-rw-r--r-- | configure.ac | 19 | ||||
-rwxr-xr-x | tests/blogc-git-receiver/check_post_receive.sh.in (renamed from tests/blogc-git-receiver/check_post_receive.sh) | 2 | ||||
-rwxr-xr-x | tests/blogc-git-receiver/check_pre_receive.sh.in (renamed from tests/blogc-git-receiver/check_pre_receive.sh) | 2 | ||||
-rwxr-xr-x | tests/blogc-git-receiver/check_shell.sh.in (renamed from tests/blogc-git-receiver/check_shell.sh) | 2 |
9 files changed, 30 insertions, 18 deletions
@@ -59,8 +59,11 @@ blogc*.html /tests/blogc/check_source_parser /tests/blogc/check_template_parser /tests/blogc-git-receiver/check_pre_receive_parser +/tests/blogc-git-receiver/check_pre_receive.sh /tests/blogc-git-receiver/check_post_receive +/tests/blogc-git-receiver/check_post_receive.sh /tests/blogc-git-receiver/check_shell_command_parser +/tests/blogc-git-receiver/check_shell.sh /tests/blogc-runserver/check_httpd_utils /tests/blogc-runserver/check_mime /tests/common/check_config_parser diff --git a/Makefile.am b/Makefile.am index 212bcfe..8aed820 100644 --- a/Makefile.am +++ b/Makefile.am @@ -92,7 +92,7 @@ endif check_PROGRAMS = \ $(NULL) -dist_check_SCRIPTS = \ +check_SCRIPTS = \ $(NULL) @@ -322,7 +322,7 @@ endif if BUILD_TESTS if BUILD_GIT_RECEIVER -dist_check_SCRIPTS += \ +check_SCRIPTS += \ tests/blogc-git-receiver/check_post_receive.sh \ tests/blogc-git-receiver/check_pre_receive.sh \ tests/blogc-git-receiver/check_shell.sh \ @@ -654,7 +654,11 @@ endif TESTS = \ $(check_PROGRAMS) \ - $(dist_check_SCRIPTS) \ + $(check_SCRIPTS) \ + $(NULL) + +CLEANFILES += \ + $(check_SCRIPTS) \ $(NULL) @@ -684,5 +688,5 @@ if USE_VALGRIND valgrind: all $(MAKE) check TESTS_ENVIRONMENT=" \ VALGRIND=$(VALGRIND) \ - $(top_srcdir)/build-aux/valgrind.sh" + $(BASH) -e $(top_srcdir)/build-aux/valgrind.sh" endif diff --git a/build-aux/travis-build.sh b/build-aux/travis-build.sh index 106c230..53cf589 100755 --- a/build-aux/travis-build.sh +++ b/build-aux/travis-build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -ex diff --git a/build-aux/travis-deploy.sh b/build-aux/travis-deploy.sh index dea0b0f..51aac3e 100755 --- a/build-aux/travis-deploy.sh +++ b/build-aux/travis-deploy.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e diff --git a/build-aux/valgrind.sh b/build-aux/valgrind.sh index 3de3855..64091a1 100755 --- a/build-aux/valgrind.sh +++ b/build-aux/valgrind.sh @@ -1,7 +1,3 @@ -#!/bin/sh - -set -e - export TESTS_ENVIRONMENT=" ${VALGRIND:-valgrind} \ --tool=memcheck \ diff --git a/configure.ac b/configure.ac index e5b9ac9..4779308 100644 --- a/configure.ac +++ b/configure.ac @@ -147,11 +147,12 @@ AS_IF([test "x$enable_tests" != "xno"], [ ], [ have_bgr_deps=yes ]) + AC_PATH_PROG([bash], [bash]) AC_PATH_PROG([tee], [tee]) - AS_IF([test "x$ac_cv_path_tee" = "x"], [ - have_tee=no + AS_IF([test "x$ac_cv_path_bash" = "x" -o "x$ac_cv_path_tee" = "x"], [ + have_blogc_deps=no ], [ - have_tee=yes + have_blogc_deps=yes ]) ], [ have_tests=no @@ -161,8 +162,8 @@ AS_IF([test "x$have_tests" = "xyes"], [ AS_IF([test "x$have_cmocka" = "xyes"],, [ AC_MSG_ERROR([tests requested but cmocka not found]) ]) - AS_IF([test "x$have_tee" = "xyes"],, [ - AC_MSG_ERROR([tests requested but tee not found]) + AS_IF([test "x$have_blogc_deps" = "xyes"],, [ + AC_MSG_ERROR([tests requested but bash and/or tee not found]) ]) AS_IF([test "x$have_bgr_deps" = "xyes"], , [ AS_IF([test "x$have_git_receiver" = "xyes"], [ @@ -173,6 +174,8 @@ AS_IF([test "x$have_tests" = "xyes"], [ AM_CONDITIONAL([BUILD_TESTS], [test "x$have_tests" = "xyes"]) AM_CONDITIONAL([USE_CMOCKA], [test "x$have_cmocka" = "xyes"]) AM_CONDITIONAL([USE_BGR_DEPS], [test "x$have_bgr_deps" = "xyes"]) +BASH="$ac_cv_path_bash" +AC_SUBST(BASH) AC_CHECK_HEADERS([sys/stat.h time.h]) @@ -182,6 +185,12 @@ AC_CONFIG_FILES([ Makefile blogc.spec ]) +AC_CONFIG_FILES([tests/blogc-git-receiver/check_pre_receive.sh], + [chmod +x tests/blogc-git-receiver/check_pre_receive.sh]) +AC_CONFIG_FILES([tests/blogc-git-receiver/check_post_receive.sh], + [chmod +x tests/blogc-git-receiver/check_post_receive.sh]) +AC_CONFIG_FILES([tests/blogc-git-receiver/check_shell.sh], + [chmod +x tests/blogc-git-receiver/check_shell.sh]) AC_OUTPUT diff --git a/tests/blogc-git-receiver/check_post_receive.sh b/tests/blogc-git-receiver/check_post_receive.sh.in index ac07c64..6ed7f9d 100755 --- a/tests/blogc-git-receiver/check_post_receive.sh +++ b/tests/blogc-git-receiver/check_post_receive.sh.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@BASH@ set -xe -o pipefail diff --git a/tests/blogc-git-receiver/check_pre_receive.sh b/tests/blogc-git-receiver/check_pre_receive.sh.in index 2df713a..10fd4d9 100755 --- a/tests/blogc-git-receiver/check_pre_receive.sh +++ b/tests/blogc-git-receiver/check_pre_receive.sh.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@BASH@ set -xe -o pipefail diff --git a/tests/blogc-git-receiver/check_shell.sh b/tests/blogc-git-receiver/check_shell.sh.in index f563c02..0099df3 100755 --- a/tests/blogc-git-receiver/check_shell.sh +++ b/tests/blogc-git-receiver/check_shell.sh.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@BASH@ set -xe -o pipefail |