diff --git a/.gitignore b/.gitignore index d0cc7ab6..86710b3a 100644 --- a/.gitignore +++ b/.gitignore @@ -43,5 +43,10 @@ missing mkinstalldirs omf.make stamp-* +test-driver testbuild.log +tests/*.log +tests/*.trs +tests/test-suite.log +tests/test_dummy xmldocs.make diff --git a/Makefile.am b/Makefile.am index 481ff2ae..50458770 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = compose data doc include lib po src +SUBDIRS = compose data doc include lib po src tests # Only build GParted help documentation when enabled. (Can be disabled # with './configure --disable-doc'). if BUILD_HELP_DOC diff --git a/configure.ac b/configure.ac index 702ad3dc..8368c10b 100644 --- a/configure.ac +++ b/configure.ac @@ -383,6 +383,7 @@ lib/Makefile lib/gtest/Makefile src/Makefile po/Makefile.in +tests/Makefile ]) AC_OUTPUT diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 00000000..e3475517 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,19 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/lib/gtest/include \ + $(GTEST_CPPFLAGS) +AM_CXXFLAGS = -Wall $(GTEST_CXXFLAGS) +AM_LDFLAGS = $(GTEST_LDFLAGS) +LDADD = \ + $(GTEST_LIBS) \ + $(top_srcdir)/lib/gtest/lib/libgtest_main.la \ + $(top_srcdir)/lib/gtest/lib/libgtest.la + +# Programs to be built by "make check" +check_PROGRAMS = \ + test_dummy + +# Test cases to be run by "make check" +TESTS = $(check_PROGRAMS) + +test_dummy_SOURCES = test_dummy.cc diff --git a/tests/test_dummy.cc b/tests/test_dummy.cc new file mode 100644 index 00000000..22453a4c --- /dev/null +++ b/tests/test_dummy.cc @@ -0,0 +1,14 @@ +/* Copyright (C) 2017 Mike Fleetwood + * + * Copying and distribution of this file, with or without modification, + * are permitted in any medium without royalty provided the copyright + * notice and this notice are preserved. This file is offered as-is, + * without any warranty. + */ + +#include "gtest/gtest.h" + +TEST( DummyTest, Success ) +{ + EXPECT_TRUE( true ); +}