Bug 1242565 - follow up to reuse gtests.o, r=mt
authorFranziskus Kiefer <franziskuskiefer@gmail.com>
Wed, 18 May 2016 15:12:46 +0200
changeset 12161 27342403fb54b0e560a30177512a27c4d620aa66
parent 12160 a9af87b6c9a78eb6eb1374503ba95544aec7d13d
child 12162 79471a8d67fa23bd1ee5d54757fa6bec14dd5716
push id1213
push userfranziskuskiefer@gmail.com
push dateWed, 18 May 2016 13:26:23 +0000
reviewersmt
bugs1242565
Bug 1242565 - follow up to reuse gtests.o, r=mt
.hgignore
external_tests/common/Makefile
external_tests/common/manifest.mn
external_tests/der_gtest/Makefile
external_tests/der_gtest/manifest.mn
external_tests/manifest.mn
external_tests/pk11_gtest/Makefile
external_tests/pk11_gtest/manifest.mn
external_tests/util_gtest/Makefile
external_tests/util_gtest/manifest.mn
--- a/.hgignore
+++ b/.hgignore
@@ -1,6 +1,5 @@
 syntax: glob
 *~
 *OPT.OBJ/*
 *DBG.OBJ/*
 *DBG.OBJD/*
-*.o
new file mode 100644
--- /dev/null
+++ b/external_tests/common/Makefile
@@ -0,0 +1,41 @@
+#! gmake
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#######################################################################
+# (1) Include initial platform-independent assignments (MANDATORY).   #
+#######################################################################
+
+include manifest.mn
+
+#######################################################################
+# (2) Include "global" configuration information. (OPTIONAL)          #
+#######################################################################
+
+include $(CORE_DEPTH)/coreconf/config.mk
+
+#######################################################################
+# (3) Include "component" configuration information. (OPTIONAL)       #
+#######################################################################
+
+#######################################################################
+# (4) Include "local" platform-dependent assignments (OPTIONAL).      #
+#######################################################################
+
+include gtest.mk
+
+#######################################################################
+# (5) Execute "global" rules. (OPTIONAL)                              #
+#######################################################################
+
+include $(CORE_DEPTH)/coreconf/rules.mk
+
+#######################################################################
+# (6) Execute "component" rules. (OPTIONAL)                           #
+#######################################################################
+
+#######################################################################
+# (7) Execute "local" rules. (OPTIONAL).                              #
+#######################################################################
new file mode 100644
--- /dev/null
+++ b/external_tests/common/manifest.mn
@@ -0,0 +1,21 @@
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+CORE_DEPTH = ../..
+DEPTH      = ../..
+MODULE = nss
+
+CPPSRCS = \
+      gtests.cc \
+      $(NULL)
+
+INCLUDES += -I$(CORE_DEPTH)/external_tests/google_test/gtest/include \
+            -I$(CORE_DEPTH)/external_tests/common
+
+REQUIRES = gtest
+
+EXTRA_LIBS = $(DIST)/lib/$(LIB_PREFIX)gtest.$(LIB_SUFFIX)
+
+# NOTE: this is not actually used but required to build gtests.o
+PROGRAM = gtests
\ No newline at end of file
--- a/external_tests/der_gtest/Makefile
+++ b/external_tests/der_gtest/Makefile
@@ -36,10 +36,8 @@ include $(CORE_DEPTH)/coreconf/rules.mk
 #######################################################################
 # (6) Execute "component" rules. (OPTIONAL)                           #
 #######################################################################
 
 
 #######################################################################
 # (7) Execute "local" rules. (OPTIONAL).                              #
 #######################################################################
-
-ALL_TRASH += common
--- a/external_tests/der_gtest/manifest.mn
+++ b/external_tests/der_gtest/manifest.mn
@@ -3,18 +3,19 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 CORE_DEPTH = ../..
 DEPTH      = ../..
 MODULE = nss
 
 CPPSRCS = \
       der_getint_unittest.cc \
-      ../common/gtests.cc \
       $(NULL)
 
 INCLUDES += -I$(CORE_DEPTH)/external_tests/google_test/gtest/include \
             -I$(CORE_DEPTH)/external_tests/common
 
 REQUIRES = nspr nss libdbm gtest
 
 PROGRAM = der_gtest
-EXTRA_LIBS = $(DIST)/lib/$(LIB_PREFIX)gtest.$(LIB_SUFFIX)
+
+EXTRA_LIBS = $(DIST)/lib/$(LIB_PREFIX)gtest.$(LIB_SUFFIX) $(EXTRA_OBJS) \
+             ../common/$(OBJDIR)/gtests$(OBJ_SUFFIX)
--- a/external_tests/manifest.mn
+++ b/external_tests/manifest.mn
@@ -2,13 +2,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 CORE_DEPTH = ..
 DEPTH      = ..
 
 DIRS = \
 	google_test \
+	common \
 	der_gtest \
 	util_gtest \
 	pk11_gtest \
 	ssl_gtest \
 	$(NULL)
--- a/external_tests/pk11_gtest/Makefile
+++ b/external_tests/pk11_gtest/Makefile
@@ -36,10 +36,8 @@ include $(CORE_DEPTH)/coreconf/rules.mk
 #######################################################################
 # (6) Execute "component" rules. (OPTIONAL)                           #
 #######################################################################
 
 
 #######################################################################
 # (7) Execute "local" rules. (OPTIONAL).                              #
 #######################################################################
-
-ALL_TRASH += common
--- a/external_tests/pk11_gtest/manifest.mn
+++ b/external_tests/pk11_gtest/manifest.mn
@@ -6,18 +6,20 @@ CORE_DEPTH = ../..
 DEPTH      = ../..
 MODULE = nss
 
 CPPSRCS = \
       pk11_chacha20poly1305_unittest.cc \
       pk11_pbkdf2_unittest.cc \
       pk11_prf_unittest.cc \
       pk11_rsapss_unittest.cc \
-      ../common/gtests.cc \
       $(NULL)
 
 INCLUDES += -I$(CORE_DEPTH)/external_tests/google_test/gtest/include \
             -I$(CORE_DEPTH)/external_tests/common
 
 REQUIRES = nspr nss libdbm gtest
 
 PROGRAM = pk11_gtest
-EXTRA_LIBS = $(DIST)/lib/$(LIB_PREFIX)gtest.$(LIB_SUFFIX)
+
+EXTRA_LIBS = $(DIST)/lib/$(LIB_PREFIX)gtest.$(LIB_SUFFIX) $(EXTRA_OBJS) \
+             ../common/$(OBJDIR)/gtests$(OBJ_SUFFIX)
+
--- a/external_tests/util_gtest/Makefile
+++ b/external_tests/util_gtest/Makefile
@@ -38,10 +38,8 @@ include $(CORE_DEPTH)/coreconf/rules.mk
 #######################################################################
 # (6) Execute "component" rules. (OPTIONAL)                           #
 #######################################################################
 
 
 #######################################################################
 # (7) Execute "local" rules. (OPTIONAL).                              #
 #######################################################################
-
-ALL_TRASH += common
--- a/external_tests/util_gtest/manifest.mn
+++ b/external_tests/util_gtest/manifest.mn
@@ -2,24 +2,25 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 CORE_DEPTH = ../..
 DEPTH      = ../..
 MODULE = nss
 
 CPPSRCS = \
-	../common/gtests.cc \
 	util_utf8_unittest.cc \
 	$(NULL)
 
 INCLUDES += \
 	-I$(CORE_DEPTH)/external_tests/google_test/gtest/include \
 	-I$(CORE_DEPTH)/external_tests/common \
 	$(NULL)
 
 REQUIRES = nspr gtest
 
 PROGRAM = util_gtest
+
 EXTRA_LIBS = \
 	$(DIST)/lib/$(LIB_PREFIX)gtest.$(LIB_SUFFIX) \
 	$(DIST)/lib/$(LIB_PREFIX)nssutil.$(LIB_SUFFIX) \
+	../common/$(OBJDIR)/gtests$(OBJ_SUFFIX) \
 	$(NULL)