diff --git a/configure.ac b/configure.ac index 83d22d3..1474610 100644 --- a/configure.ac +++ b/configure.ac @@ -264,11 +264,13 @@ AM_CONDITIONAL(USE_ORACLE, test x$with_oracle != xno) AS_IF([test x$with_pgsql != xno], [ AC_CHECK_PGSQL([$with_pgsql]) + USE_PGSQL=1 AC_DEFINE(USE_PGSQL,1,[Define to 1 if you want to compile with PostgreSQL support]) AC_SUBST([PGSQL_LIBS]) AC_SUBST([PGSQL_CFLAGS]) ]) AM_CONDITIONAL(USE_PGSQL, test x$with_pgsql != xno) +AC_SUBST([USE_PGSQL]) # Check for libaio AC_CHECK_AIO diff --git a/tests/include/config.sh.in b/tests/include/config.sh.in index d1543bf..3c53739 100644 --- a/tests/include/config.sh.in +++ b/tests/include/config.sh.in @@ -21,3 +21,4 @@ export SBTEST_VERSION_STRING="sysbench @PACKAGE_VERSION@@SB_GIT_SHA@" export SBTEST_VERSION="@PACKAGE_VERSION@" export SBTEST_HAS_MYSQL=@USE_MYSQL@ +export SBTEST_HAS_PGSQL=@USE_PGSQL@ diff --git a/tests/t/help_drv_mysql.t b/tests/t/help_drv_mysql.t index c5e983e..48030a6 100644 --- a/tests/t/help_drv_mysql.t +++ b/tests/t/help_drv_mysql.t @@ -1,11 +1,11 @@ Skip test if the MySQL driver is not available. - $ if ! sysbench help | sed -n '/Compiled-in database drivers:/,/^$/p' | grep mysql > /dev/null 2>&1 + $ if [ -z "$SBTEST_HAS_MYSQL" ] > then > exit 80 > fi - $ sysbench help | sed -n '/mysql options:/,/^$/p' + $ sysbench --help | sed -n '/mysql options:/,/^$/p' mysql options: --mysql-host=[LIST,...] MySQL server host [localhost] --mysql-port=[LIST,...] MySQL server port [3306] diff --git a/tests/t/help_drv_pgsql.t b/tests/t/help_drv_pgsql.t index b4d788c..9b986ea 100644 --- a/tests/t/help_drv_pgsql.t +++ b/tests/t/help_drv_pgsql.t @@ -1,11 +1,11 @@ Skip test if the PostgreSQL driver is not available. - $ if ! sysbench help | sed -n '/Compiled-in database drivers:/,/^$/p' | grep pgsql > /dev/null 2>&1 + $ if [ -z "$SBTEST_HAS_PGSQL" ] > then > exit 80 > fi - $ sysbench help | sed -n '/pgsql options:/,/^$/p' + $ sysbench --help | sed -n '/pgsql options:/,/^$/p' pgsql options: --pgsql-host=STRING PostgreSQL server host [localhost] --pgsql-port=N PostgreSQL server port [5432]