Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1057584 - Add gtest framework and initial tests optionally (2/4).…
… Build Changes. r=rrelyea
  • Loading branch information
Camilo Viecco committed Sep 8, 2014
1 parent f7b565c commit a804709
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 1 deletion.
6 changes: 5 additions & 1 deletion coreconf/ruleset.mk
Expand Up @@ -112,11 +112,15 @@ ifndef TARGETS
TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM)
endif

# Make both .cpp and .cc work.
CPPSRCS1 = $(CPPSRCS:.cpp=$(OBJ_SUFFIX))
CPPSRCS2 = $(CPPSRCS1:.cc=$(OBJ_SUFFIX))

ifndef OBJS
SIMPLE_OBJS = $(JRI_STUB_CFILES) \
$(addsuffix $(OBJ_SUFFIX), $(JMC_GEN)) \
$(CSRCS:.c=$(OBJ_SUFFIX)) \
$(CPPSRCS:.cpp=$(OBJ_SUFFIX)) \
$(CPPSRCS2) \
$(ASFILES:$(ASM_SUFFIX)=$(OBJ_SUFFIX)) \
$(BUILT_CSRCS:.c=$(OBJ_SUFFIX)) \
$(BUILT_CPPSRCS:.cpp=$(OBJ_SUFFIX)) \
Expand Down
44 changes: 44 additions & 0 deletions external_tests/Makefile
@@ -0,0 +1,44 @@
#! 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). #
#######################################################################


#######################################################################
# (5) Execute "global" rules. (OPTIONAL) #
#######################################################################

include $(CORE_DEPTH)/coreconf/rules.mk

#######################################################################
# (6) Execute "component" rules. (OPTIONAL) #
#######################################################################



#######################################################################
# (7) Execute "local" rules. (OPTIONAL). #
#######################################################################
45 changes: 45 additions & 0 deletions external_tests/google_test/Makefile
@@ -0,0 +1,45 @@
#! 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). #
#######################################################################


#######################################################################
# (5) Execute "global" rules. (OPTIONAL) #
#######################################################################

include $(CORE_DEPTH)/coreconf/rules.mk

#######################################################################
# (6) Execute "component" rules. (OPTIONAL) #
#######################################################################


#######################################################################
# (7) Execute "local" rules. (OPTIONAL). #
#######################################################################

MKSHLIB = $(CCC) $(DSO_LDOPTS) $(DARWIN_SDK_SHLIBFLAGS)
22 changes: 22 additions & 0 deletions external_tests/google_test/manifest.mn
@@ -0,0 +1,22 @@
#
# 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 = ../..

MODULE = gtest
LIBRARY_NAME = gtest
LIBRARY_VERSION = 1

INCLUDES += -Igtest/include/ -Igtest

CPPSRCS = \
gtest/src/gtest-all.cc \
$(NULL)


EXPORTS = \
$(NULL)



11 changes: 11 additions & 0 deletions external_tests/manifest.mn
@@ -0,0 +1,11 @@
#
# 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 \
ssl_gtest \
$(NULL)
48 changes: 48 additions & 0 deletions external_tests/ssl_gtest/Makefile
@@ -0,0 +1,48 @@
#! 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 ../../cmd/platlibs.mk

#######################################################################
# (5) Execute "global" rules. (OPTIONAL) #
#######################################################################

include $(CORE_DEPTH)/coreconf/rules.mk

#######################################################################
# (6) Execute "component" rules. (OPTIONAL) #
#######################################################################


#######################################################################
# (7) Execute "local" rules. (OPTIONAL). #
#######################################################################

MKPROG = $(CXX)
CFLAGS += -std=c++0x
include ../../cmd/platrules.mk

21 changes: 21 additions & 0 deletions external_tests/ssl_gtest/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 = \
ssl_loopback_unittest.cc \
ssl_gtest.cc \
test_io.cc \
tls_parser.cc \
$(NULL)

INCLUDES += -I$(CORE_DEPTH)/external_tests/google_test/gtest/include

REQUIRES = nspr nss libdbm gtest

PROGRAM = ssl_gtest
EXTRA_LIBS = $(DIST)/lib/$(LIB_PREFIX)gtest.$(LIB_SUFFIX)
4 changes: 4 additions & 0 deletions manifest.mn
Expand Up @@ -11,3 +11,7 @@ IMPORTS = nspr20/v4.8 \
RELEASE = nss

DIRS = coreconf lib cmd

ifdef NSS_BUILD_GTESTS
DIRS += external_tests
endif

0 comments on commit a804709

Please sign in to comment.