Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 672542
Collapse All | Expand All

(-)a/configure.ac (-21 / +15 lines)
Lines 1312-1317 if test "${enable_async_push}" = "yes"; then Link Here
1312
       )
1312
       )
1313
fi
1313
fi
1314
AC_ARG_ENABLE(
1315
       [tests],
1316
       AS_HELP_STRING([--enable-tests], [enable unit tests @<:@default=no@:>@])
1317
)
1318
1319
if test "${enable_tests}" = "yes"; then
1320
       PKG_CHECK_MODULES([CMOCKA], [cmocka])
1321
       TEST_CFLAGS="${CMOCKA_CFLAGS}"
1322
       TEST_LDFLAGS="${CMOCKA_LIBS}"
1323
       AC_SUBST([TEST_CFLAGS])
1324
       AC_SUBST([TEST_LDFLAGS])
1325
fi
1326
AM_CONDITIONAL([ENABLE_TESTS], [test "${enable_tests}" = "yes"])
1327
AM_CONDITIONAL([CMOCKA_INITIALIZED], [false])
1328
1314
CONFIGURE_DEFINES="`set | grep '^enable_.*=' ; set | grep '^with_.*='`"
1329
CONFIGURE_DEFINES="`set | grep '^enable_.*=' ; set | grep '^with_.*='`"
1315
AC_DEFINE_UNQUOTED([CONFIGURE_DEFINES], ["`echo ${CONFIGURE_DEFINES}`"], [Configuration settings])
1330
AC_DEFINE_UNQUOTED([CONFIGURE_DEFINES], ["`echo ${CONFIGURE_DEFINES}`"], [Configuration settings])
Lines 1360-1386 AC_SUBST([VENDOR_SRC_ROOT]) Link Here
1360
AC_SUBST([VENDOR_BUILD_ROOT])
1375
AC_SUBST([VENDOR_BUILD_ROOT])
1361
AC_SUBST([VENDOR_DIST_ROOT])
1376
AC_SUBST([VENDOR_DIST_ROOT])
1362
TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_LIBS} -lcmocka -L\$(abs_top_builddir)/vendor/dist/lib -Wl,-rpath,\$(abs_top_builddir)/vendor/dist/lib"
1363
TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_CFLAGS} -I\$(top_srcdir)/include -I\$(abs_top_builddir)/vendor/dist/include"
1364
1365
AC_SUBST([TEST_LDFLAGS])
1366
AC_SUBST([TEST_CFLAGS])
1367
1368
# Check if cmake is available and cmocka git submodule is initialized,
1369
# needed for unit testing
1370
AC_CHECK_PROGS([CMAKE], [cmake])
1371
if test -n "${CMAKE}"; then
1372
   if test -f "${srcdir}/vendor/cmocka/CMakeLists.txt"; then
1373
      AM_CONDITIONAL([CMOCKA_INITIALIZED], [true])
1374
   else
1375
      AM_CONDITIONAL([CMOCKA_INITIALIZED], [false])
1376
      AC_MSG_RESULT([!! WARNING !! The cmoka git submodule has not been initialized or updated.  Unit testing cannot be performed.])
1377
   fi
1378
else
1379
   AC_MSG_RESULT([!! WARNING !! CMake is NOT available.  Unit testing cannot be performed.])
1380
   AM_CONDITIONAL([CMOCKA_INITIALIZED], [false])
1381
fi
1382
1383
AC_CONFIG_FILES([
1377
AC_CONFIG_FILES([
1384
       version.sh
1378
       version.sh
(-)a/tests/unit_tests/Makefile.am (-1 / +1 lines)
Lines 1-5 Link Here
1
AUTOMAKE_OPTIONS = foreign
1
AUTOMAKE_OPTIONS = foreign
2
if CMOCKA_INITIALIZED
2
if ENABLE_TESTS
3
SUBDIRS = example_test openvpn plugins
3
SUBDIRS = example_test openvpn plugins
4
endif
4
endif

Return to bug 672542