From: chaoskagami Date: Tue, 27 Sep 2016 02:39:33 +0000 (-0400) Subject: Make unittests a compile-time option X-Git-Tag: v0.3.0~10 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=716fc5bdf2ab59aa84f14ec4f6963ecf7f6d004e;p=corbenik%2Fcorbenik.git Make unittests a compile-time option --- diff --git a/configure.ac b/configure.ac index bf60672..4055927 100644 --- a/configure.ac +++ b/configure.ac @@ -17,11 +17,17 @@ LT_INIT AC_ARG_ENABLE([chainloader], AS_HELP_STRING([--disable-chainloader], [Disable chainloading of external programs])) +AC_ARG_ENABLE([unittests], + AS_HELP_STRING([--enable-unittests], [Include unit tests in resultant binary.])) + AC_PREFIX_DEFAULT([/corbenik]) +UNITTESTS=0 +test "$enable_unittests" = "yes" && UNITTESTS=1 +AC_DEFINE_UNQUOTED([UNITTESTS], [$UNITTESTS]) + CHAINLOADER=1 test "$enable_chainloader" = "no" && CHAINLOADER=0 - AC_DEFINE_UNQUOTED([CHAINLOADER], [$CHAINLOADER]) AC_CONFIG_FILES([Makefile source/Makefile external/Makefile include/Makefile]) @@ -46,6 +52,7 @@ ldflags: ${LDFLAGS} ocflags: ${OCFLAGS} Chainloader: ${CHAINLOADER} +Chainloader: ${UNITTESTS} " AC_OUTPUT diff --git a/include/corbconf.h b/include/corbconf.h index 4e74f00..cec84b7 100644 --- a/include/corbconf.h +++ b/include/corbconf.h @@ -3,6 +3,4 @@ #include -#define UNITTESTS 1 - #endif