]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
tests: Improve the unit test framework integration with automake
authorTom Hromatka <tom.hromatka@oracle.com>
Thu, 19 Sep 2019 20:40:37 +0000 (14:40 -0600)
committerDhaval Giani <dhaval.giani@oracle.com>
Tue, 8 Oct 2019 17:51:22 +0000 (10:51 -0700)
Prior to this commit, the unit test framework behaved slightly
differently depending upon how the libcgroup git repo was
cloned.  This commit standardizes the unit test framework's
behavior by initializing the googletest submodule when
bootstrap.sh is invoked.

This commit also cleans up a potential issue on some versions
of automake that don't properly expand $(top_builddir) early
in the automake process.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
bootstrap.sh
tests/gunit/Makefile.am

index 08a054ff2f608db53122ee5b95e6b323751bc02c..2a1386a17a33e42d99cb2c7ee0bee7dc2489ca1e 100755 (executable)
@@ -8,6 +8,14 @@ if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
        echo "Activated pre-commit hook."
 fi
 
+# configure googletest
+git submodule update --init --recursive
+pushd googletest
+git checkout release-1.8.1
+cmake .
+make
+popd
+
 aclocal
 libtoolize -c
 autoconf
index 8bc014c0fd5e0005c5bc56eb49cb9042b9dfdb5f..1f54ad9377f5de081acbe48c6b04edb114b48bb6 100644 (file)
 
 AM_CPPFLAGS = -I$(top_srcdir)/include \
              -I$(top_srcdir)/src \
-             -I$(top_srcdir)/googletest/googletest/include \
-             -I$(top_srcdir)/googletest/googletest \
+             -I$(top_builddir)/googletest/googletest/include \
+             -I$(top_builddir)/googletest/googletest \
              -std=c++11
-LDADD = $(top_builddir)/src/.libs/libcgroupfortesting.la \
+LDADD = ../../src/.libs/libcgroupfortesting.la \
        libgtest.la
 
-libgtest_la_SOURCES = $(top_srcdir)/googletest/googletest/src/gtest-all.cc
-libgtest_la_CPPFLAGS = -I$(top_srcdir)/googletest/googletest/include \
-                      -I$(top_srcdir)/googletest/googletest
+libgtest_la_SOURCES = ../../googletest/googletest/src/gtest-all.cc
+libgtest_la_CPPFLAGS = -I$(top_builddir)/googletest/googletest/include \
+                      -I$(top_builddir)/googletest/googletest
+libgtest_la_LDFLAGS = -lpthread
 
 check_LTLIBRARIES = libgtest.la
 check_PROGRAMS = gtest