]> granicus.if.org Git - graphviz/commitdiff
Check for unit test framework in configure.ac
authorErwin Janssen <erwinjanssen@outlook.com>
Mon, 8 Aug 2016 09:21:55 +0000 (11:21 +0200)
committerErwin Janssen <erwinjanssen@outlook.com>
Mon, 8 Aug 2016 09:46:51 +0000 (11:46 +0200)
Criterion is a unit testing framework for C and C++ and it's C99 compatible. It allows for fast test writing because, unlike a lot of other C unit test frameworks, it doesn't require a lot of boilerplate code.

This check in configure.ac checks if Criterion is installed on the system.

configure.ac

index f7a730562c80b4f517d2a4e93dbce23d00a2bb82..33f418dbbcfac49b2f1221d743b50f8ebe98ff55 100644 (file)
@@ -3151,6 +3151,25 @@ AM_CONDITIONAL(WITH_CGRAPH, [true])
 
 # -----------------------------------------------------------------------
 
+# Checking for unit testing framework Criterion
+# This framework is used for the unit tests
+AC_CHECK_LIB(
+  criterion,
+  main,
+  [
+    use_criterion="Yes"
+    AC_DEFINE_UNQUOTED(HAVE_CRITERION,1,[Criterion unit testing framework is installed and available for use.])
+  ],
+  [
+    use_criterion="No (Criterion unit testing framework not installed)"
+    AC_MSG_WARN(Criterion unit testing framework not installed)
+  ],
+  []
+)
+AM_CONDITIONAL(HAVE_CRITERION, test $use_criterion = "Yes")
+
+# -----------------------------------------------------------------------
+
 # Generate Makefiles
 AC_CONFIG_FILES(Makefile
        debian/changelog
@@ -3384,4 +3403,6 @@ echo ""
 echo "  tcldot:        $use_tcldot"
 echo "  tclpathplan:   $use_tclpathplan"
 echo "  gdtclft:       $use_gdtclft"
-
+echo ""
+echo "Testing utilities:"
+echo "  criterion:     $use_criterion"