security/nss/external_tests/ssl_gtest/ssl_gtest.cc
author Kai Engert <kaie@kuix.de>
Thu, 22 Jan 2015 12:26:00 -0500
changeset 251103 6b4103d8c3f769d4d97937a9d5a3a9cba8884247
parent 231229 60b7d13cfb6f187e9d953470262be6123ed1d1db
child 259100 773d9db35988ccbfc8a0fa96379d540721754c82
permissions -rw-r--r--
Bug 1107731 - Upgrade Mozilla 37 to use NSS 3.17.4. a=sledru

#include "nspr.h"
#include "nss.h"
#include "ssl.h"

#include "test_io.h"

#define GTEST_HAS_RTTI 0
#include "gtest/gtest.h"

std::string g_working_dir_path;

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

  for (int i = 0; i < argc; i++) {
    if (!strcmp(argv[i], "-d")) {
      g_working_dir_path = argv[i + 1];
      ++i;
    }
  }

  NSS_Initialize(g_working_dir_path.c_str(), "", "", SECMOD_DB, NSS_INIT_READONLY);
  NSS_SetDomesticPolicy();
  int rv = RUN_ALL_TESTS();

  NSS_Shutdown();

  nss_test::Poller::Shutdown();

  return rv;
}