~vanvugt/nux/fix-805874

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Neil Jagdish Patel
  • Date: 2011-06-21 17:36:23 UTC
  • Revision ID: neil.patel@canonical.com-20110621173623-1150ipfycan4837c
Make tests optional to allow for gtest not being in main

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
AC_SUBST(UNITY_SUPPORT_TEST_LIBS)
173
173
 
174
174
dnl ************************************
175
 
dnl Check for googletest and googlemock
 
175
dnl Enable/disable tests
176
176
dnl ************************************
177
177
 
178
 
AC_LANG_PUSH([C++])
179
 
AC_CHECK_HEADER([gtest/gtest.h],
180
 
                [],
181
 
                [AC_MSG_ERROR([you are missing google-test, apt-get install libgtest-dev])])
182
 
AC_CHECK_HEADER([gmock/gmock.h],
183
 
                [],
184
 
                [AC_MSG_ERROR([you are missing google-mock, apt-get install google-mock])])
185
 
AC_LANG_POP([C++])
 
178
AC_ARG_ENABLE([tests],
 
179
              [AC_HELP_STRING([--enable-tests=@<:@no/yes@:>@],
 
180
              [Enable Nux Testing @<:@default=yes@:>@])],
 
181
              [],
 
182
              [enable_tests=yes])
 
183
AS_IF([test "x$enable_tests" = "xyes"],
 
184
      [
 
185
       # Check for googletest and googlemock
 
186
       AC_LANG_PUSH([C++])
 
187
       AC_CHECK_HEADER([gtest/gtest.h],
 
188
                       [],
 
189
                       [AC_MSG_ERROR([you are missing google-test, apt-get install libgtest-dev])])
 
190
       AC_CHECK_HEADER([gmock/gmock.h],
 
191
                       [],
 
192
                       [AC_MSG_ERROR([you are missing google-mock, apt-get install google-mock])])
 
193
       AC_LANG_POP([C++])
 
194
      ]
 
195
)
 
196
AM_CONDITIONAL(BUILD_TESTS, [test "x$enable_tests" = "xyes"])
 
197
 
186
198
 
187
199
dnl ===========================================================================
188
200
 
334
346
echo -e "${GREEN} • Misc Options:${RESET}"
335
347
echo -e "        Build Examples    : ${BOLD_WHITE}${enable_examples}${RESET}"
336
348
echo -e "        Build Gpu Tests   : ${BOLD_WHITE}${enable_gputests}${RESET}"
 
349
echo -e "        Build Nux Tests   : ${BOLD_WHITE}${enable_tests}${RESET}"
337
350
echo ""
338
351
 
339
352
echo -e "${RESET}"