]> granicus.if.org Git - graphviz/commitdiff
Simple unit test added.
authorErwin Janssen <erwinjanssen@outlook.com>
Mon, 8 Aug 2016 09:59:34 +0000 (11:59 +0200)
committerErwin Janssen <erwinjanssen@outlook.com>
Mon, 8 Aug 2016 09:59:34 +0000 (11:59 +0200)
This unit test serves to validate the configuration and installation of the Criterion unit testing framework. This test will only be compiled and run if Criterion is installed.

.gitignore
Makefile.am
configure.ac
tests/Makefile.am [new file with mode: 0644]
tests/lib/Makefile.am [new file with mode: 0644]
tests/lib/common/Makefile.am [new file with mode: 0644]
tests/lib/common/command_line.c [new file with mode: 0644]

index 390b2c149d1875627083cde4f06dedf1626e8eae..6e55de978aa98d7bf240b584a0cd7e6500169c32 100644 (file)
@@ -199,6 +199,11 @@ contrib/prune/prune
 # Files generated during make check
 rtest/ndata
 rtest/nhtml
+tests/**/*.log
+tests/**/*.trs
+
+## Binaries
+tests/lib/common/command_line
 
 # Folders generated by Visual Studio builds
 **/Debug/**
index 46ac9a315e5057ffb1159ab6a64a80c61e05b763..442b6d12822cae7b5be4dcf716b4d848415e8ab7 100644 (file)
@@ -19,7 +19,7 @@ pkginclude_HEADERS = $(top_builddir)/graphviz_version.h
 man_MANS = graphviz.7
 
 # $(subdirs) contains the list from: AC_CONFIG_SUBDIRS
-SUBDIRS = $(subdirs) lib plugin cmd tclpkg doc contrib share graphs rtest
+SUBDIRS = $(subdirs) lib plugin cmd tclpkg doc contrib share graphs rtest tests
 
 .PHONY: doxygen
 doxygen:
index 33f418dbbcfac49b2f1221d743b50f8ebe98ff55..48bc28e20db3dfb6c71188e8ba5733e5d7901f76 100644 (file)
@@ -3287,6 +3287,9 @@ AC_CONFIG_FILES(Makefile
        tclpkg/gv/demo/Makefile
        tclpkg/gv/META.gv
        rtest/Makefile
+  tests/Makefile
+  tests/lib/Makefile
+  tests/lib/common/Makefile
        share/Makefile
        share/examples/Makefile
        share/gui/Makefile
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644 (file)
index 0000000..92600a7
--- /dev/null
@@ -0,0 +1,4 @@
+# $Id$ $Revision$
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = lib 
diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am
new file mode 100644 (file)
index 0000000..9528949
--- /dev/null
@@ -0,0 +1,4 @@
+# $Id$ $Revision$
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = common 
diff --git a/tests/lib/common/Makefile.am b/tests/lib/common/Makefile.am
new file mode 100644 (file)
index 0000000..c745d8e
--- /dev/null
@@ -0,0 +1,15 @@
+# $Id$ $Revision$
+## Process this file with automake to produce Makefile.in
+
+if HAVE_CRITERION
+
+AM_LDFLAGS = \
+       -lcriterion
+
+TESTS = command_line
+
+bin_PROGRAMS = $(TESTS)
+
+command_line_SOURCES = command_line.c
+
+endif
diff --git a/tests/lib/common/command_line.c b/tests/lib/common/command_line.c
new file mode 100644 (file)
index 0000000..80d5197
--- /dev/null
@@ -0,0 +1,8 @@
+#include <criterion/criterion.h>
+
+#include <stdbool.h>
+
+Test(test, success)
+{
+    cr_assert(true);
+}