Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1244309 - Add gtests for nssutil UTF-8 conversion, based on the o…
…ld C tests. f=mt r=ttaubert
  • Loading branch information
jld committed Mar 18, 2016
1 parent f3c3b1a commit 6125a56
Show file tree
Hide file tree
Showing 9 changed files with 1,227 additions and 6 deletions.
4 changes: 2 additions & 2 deletions circle.yml
Expand Up @@ -5,9 +5,9 @@ checkout:
test:
override:
- make nss_build_all
- cd tests; NSS_TESTS="ssl_gtests pk11_gtests der_gtests" NSS_CYCLES=standard ./all.sh
- cd tests; NSS_TESTS="ssl_gtests pk11_gtests der_gtests util_gtests" NSS_CYCLES=standard ./all.sh
- BUILD_OPT=1 make nss_build_all
- cd tests; BUILD_OPT=1 NSS_TESTS="ssl_gtests pk11_gtests der_gtests" NSS_CYCLES=standard ./all.sh
- cd tests; BUILD_OPT=1 NSS_TESTS="ssl_gtests pk11_gtests der_gtests util_gtests" NSS_CYCLES=standard ./all.sh

machine:
environment:
Expand Down
1 change: 1 addition & 0 deletions external_tests/manifest.mn
Expand Up @@ -8,6 +8,7 @@ DEPTH = ..
DIRS = \
google_test \
der_gtest \
util_gtest \
pk11_gtest \
ssl_gtest \
$(NULL)
45 changes: 45 additions & 0 deletions external_tests/util_gtest/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). #
#######################################################################

include ../common/gtest.mk

CFLAGS += -I$(CORE_DEPTH)/lib/util

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

include $(CORE_DEPTH)/coreconf/rules.mk

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


#######################################################################
# (7) Execute "local" rules. (OPTIONAL). #
#######################################################################
25 changes: 25 additions & 0 deletions external_tests/util_gtest/manifest.mn
@@ -0,0 +1,25 @@
# -*- makefile -*-
# 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 = \
util_gtest.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) \
$(NULL)
9 changes: 9 additions & 0 deletions external_tests/util_gtest/util_gtest.cc
@@ -0,0 +1,9 @@
#define GTEST_HAS_RTTI 0
#include "gtest/gtest.h"

int main(int argc, char **argv) {
// Start the tests
::testing::InitGoogleTest(&argc, argv);

return RUN_ALL_TESTS();
}

0 comments on commit 6125a56

Please sign in to comment.