Skip to content

Commit

Permalink
bundle gtest with the sources to simplify building and running the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgieseki committed Feb 9, 2017
1 parent d3e18d6 commit 5856868
Show file tree
Hide file tree
Showing 42 changed files with 31,967 additions and 80 deletions.
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.*
*.a
*.la
*.o
*.lo
*.Po
*.obj
*.dvi
Expand Down Expand Up @@ -38,15 +40,21 @@ Makefile.in
autom4te.*
dvisvgm
aclocal.*
ar-lib
compile
libtool
ltmain.sh
missing
cov-int
lcov
/config.*
doc/buildman
doc/dvisvgm.txt
doc/dvisvgm.xml
doc/dvisvgm*.xml
doc/dvisvgm.html
doc/dvisvgm.1
m4/libtool.m4
m4/lt*.m4
doxy
backup/*
Win32
Expand All @@ -64,6 +72,8 @@ install-sh
src/samples
src/psdefs.psc
src/CommandLine.*
test-driver
tests/hashcheck*
tests/*Test
svg2vml
nbproject
Expand Down
12 changes: 11 additions & 1 deletion .hgignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
syntax: glob
*.a
*.la
*.o
*.lo
*.Po
*.obj
*.dvi
Expand Down Expand Up @@ -34,10 +36,12 @@ missing
./config.*
doc/buildman
doc/dvisvgm.txt
doc/dvisvgm.xml
doc/dvisvgm*.xml
doc/dvisvgm.html
doc/dvisvgm.1
doc/*.pdf
m4/libtool.m4
m4/lt*.m4
doxy
Debug
Release
Expand All @@ -49,10 +53,16 @@ vc/zlib*
vc/*.s*
vc/_*
vc/Upgrade*
ar-lib
compile
configure
depcomp
install-sh
libtool
ltmain.sh
src/CommandLine.*
test-driver
tests/hashcheck*
tests/*Test
nbproject
stamp-h1
Expand Down
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ compiler:

before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq autotools-dev libkpathsea-dev libpotrace-dev libfreetype6-dev libgs-dev libz-dev texlive-base python-lxml libgtest-dev
# Ubuntu doesn't provide pre-built gtest libraries, so we have to build them here.
- "cd /usr/src/gtest/ && sudo cmake . && sudo cmake --build . && sudo mv libgtest* /usr/local/lib/ ; cd -"
- sudo apt-get install -qq autotools-dev libkpathsea-dev libpotrace-dev libfreetype6-dev libgs-dev libz-dev texlive-base python-lxml

env:
global:
Expand All @@ -31,6 +29,7 @@ addons:
branch_pattern: coverity_scan

script:
- uname -a
- ./autogen.sh
- ./configure
- make
Expand Down
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = COPYING
SUBDIRS = libs src tests doc
ACLOCAL_AMFLAGS = -I m4

if CODE_COVERAGE_ENABLED
lcov_dir=$(top_builddir)/lcov
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX([11])
AM_PROG_AR
LT_INIT

AC_PROG_RANLIB
AC_LANG(C)
Expand Down
214 changes: 141 additions & 73 deletions tests/Makefile.am

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions tests/create-makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ cat >$out <<EOT
SUBDIRS = data
check_LTLIBRARIES = libgtest.la
libgtest_la_SOURCES = gtest/src/gtest-all.cc gtest/src/gtest_main.cc
libgtest_la_CPPFLAGS = -I\$(top_srcdir)/tests/gtest/include -I\$(top_srcdir)/tests/gtest
libgtest_la_LDFLAGS = -pthread
EXTRA_DIST = gtest/LICENSE \\
gtest/include \\
gtest/src/gtest.cc \\
gtest/src/gtest-death-test.cc \\
gtest/src/gtest-filepath.cc \\
gtest/src/gtest-internal-inl.h \\
gtest/src/gtest-port.cc \\
gtest/src/gtest-printers.cc \\
gtest/src/gtest-test-part.cc \\
gtest/src/gtest-typed-test.cc
AM_CXXFLAGS = -I\$(top_srcdir)/src -Wall -DSRCDIR='"\$(srcdir)"' \$(CODE_COVERAGE_CFLAGS)
TESTS = hashcheck
Expand All @@ -32,7 +47,8 @@ for f in *Test.cpp; do
TESTS += $base
check_PROGRAMS += $base
${base}_SOURCES = $f
${base}_LDADD = ../src/libdvisvgm.a ../libs/xxHash/libxxhash.a -lpotrace -lfreetype -lgtest -lgtest_main -lpthread \$(CODE_COVERAGE_LDFLAGS)
${base}_CPPFLAGS = -I\$(top_srcdir)/tests/gtest/include
${base}_LDADD = ../src/libdvisvgm.a ../libs/xxHash/libxxhash.a libgtest.la -lpotrace -lfreetype \$(CODE_COVERAGE_LDFLAGS)
EOT
done
Expand All @@ -45,7 +61,7 @@ done
#done

cat >>$out <<EOT
EXTRA_DIST = check-conv genhashcheck.py normalize.xsl
EXTRA_DIST += check-conv genhashcheck.py normalize.xsl
TESTS += check-conv
@CODE_COVERAGE_RULES@
Expand Down
28 changes: 28 additions & 0 deletions tests/gtest/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Copyright 2008, Google Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading

0 comments on commit 5856868

Please sign in to comment.