Commit Graph

20 Commits

Author SHA1 Message Date
ngie
96f6a9dbf0 Reword the comment above NO_WERROR 2019-02-21 06:51:35 +00:00
ngie
2a1bbdb288 Move NO_WTHREAD_SAFETY to googletest.test.inc.mk
This variable is necessary to compile with googletest at a global level. Move
it there.
2019-02-21 06:49:20 +00:00
ngie
f958f5ea89 Use gmock/gtest headers when PRIVATELIB is defined
The move to /usr/include/private prefixed paths seems to require a bit more
effort in order to compile programs.

Install the headers to /usr/include/private/g{mock,test}/... and automatically
include /usr/include/private in GTESTS_CXXFLAGS to make compilation seamless. I
will work on the more global problem later with @bdrewery.
2019-02-21 04:47:44 +00:00
ngie
1caf89bac7 Build death tests programmatically
The previous code hardcoded the death test build definitions in a duplicative
manner. The new code doesn't.
2019-02-21 03:37:31 +00:00
ngie
09f964ad8e Correct gmock/gtest expectations w.r.t. C++11/RTTI
Long story short, some of the tests were failing because they expected either
dynamic_cast or RTTI to be functional and it wasn't.

Move all common CXXFLAGS out to googletest.test.inc.mk and reference it from
googletest.test.mk and .../googletest/Makefile.inc
2019-02-20 20:09:59 +00:00
ngie
4099b16d0e Fix test compilation for gmock_main tests, similar to r344345 2019-02-20 09:33:55 +00:00
ngie
7c2d50de5c Fix test compilation for gmock tests, similar to r344345 2019-02-20 08:04:08 +00:00
ngie
a808cd588e Add glue Makefile.inc to make the next hop to the googletest/Makefile.inc 2019-02-20 08:01:00 +00:00
ngie
7ac9e8b06e Oh wait... those helper programs were for the py tests
We don't need to install those. Leave that testing for the package's tests
2019-02-20 07:52:55 +00:00
ngie
442a232cf0 Apply lessons learned in r344345 on gtest_main tests
The key difference is that some of the programs were previously being compiled
and installed as tests, which is incorrect. Treat them like helpers instead.
2019-02-20 07:49:09 +00:00
ngie
7558b53b56 Fix gtest test compilation and build more tests
My previous work to integrate these tests was incomplete/incorrect, because I
misunderstood how the cmake macros worked.

This addresses items with the gtest tests, which in turn fixes test compilation
and adds more tests which I had previously missed.

Due to an unknown issue with gtest_stress_test, I had to add pthread to LIBADD,
even though I shouldn't have added it to that (it was failing to link -lpthread
to libprivategtest.a). Add a XXX comment to note that something's awry there
and deserves additional investigation.
2019-02-20 07:29:50 +00:00
ngie
6c414a2a16 Add more port-related flags to Makefile.inc 2019-02-20 06:54:32 +00:00
ngie
6d65890bd8 Sprinkle ${HAS_TESTS} in Makefiles
While here, reindent `SUBDIR.${MK_TESTS}`
2019-02-20 06:03:21 +00:00
ngie
0a39b03ab8 Add glue Makefile for tests under lib/googletest/... 2019-02-20 03:07:11 +00:00
ngie
88f8f55bb6 Use GTESTS instead of PLAIN_TESTS_CXX
The former is from googletest.test.mk, whereas the latter is from plain.test.mk.

As noted in r344328, Kyua will adopt more native GoogleTest support. Thus, it's
more desirable to make the test interface more of an opaque blackbox for the
testcase implementer.
2019-02-20 01:11:30 +00:00
ngie
8cbe78f95d Fix up dependency finding for libg{mock,test}_main
- Look up the corresponding non-*_main libraries via LDFLAGS using the
  directories provided in src.libnames.mk. This will allow the libraries to
  be built in the "make libraries" phase of buildworld.
- gtest_main relies on gtest, but didn't explicitly call out the dependency
  in `LIBADD`. Fill in this missing blank.
2019-02-20 00:19:11 +00:00
ngie
5d625b5435 Unconditionally build/install libg{mock,test}_main
They are supporting libraries and as such, will need to be built/installed
when MK_TESTS == no during buildworld, i.e., the "make libraries" phase.

Otherwise, dependent components cannot rely on the libraries, like
`cddl/usr.sbin/zfsd/tests`.
2019-02-20 00:15:25 +00:00
ngie
d983e20ce7 Add missing INCSGROUPS definition
This will install the gmock headers, like the gtest headers
2019-02-19 22:46:50 +00:00
ngie
f00acc7c9e Compile the tests without -Werror for now
I'm working on resolving the issue upstream on github
2019-02-13 05:41:04 +00:00
ngie
8cb6ba9426 Merge build glue for libraries and tests done on github
I need to doublecheck my work vs the port, but I believe that this covers the
initial integration of all upstream tests.

Ref: https://github.com/ngie-eign/freebsd/tree/googletest-integration
2019-02-13 04:58:15 +00:00