From 150914707089969bde30fbc6276abc00f3211ba3 Mon Sep 17 00:00:00 2001 From: Jelte Jansen Date: Thu, 7 Apr 2011 10:59:26 +0200 Subject: [PATCH] [trac781] Initial creation of empty lib --- configure.ac | 2 ++ src/lib/Makefile.am | 4 ++-- src/lib/crypto/Makefile.am | 11 +++++++++++ src/lib/crypto/crypto.cc | 25 +++++++++++++++++++++++++ src/lib/crypto/crypto.h | 26 ++++++++++++++++++++++++++ src/lib/crypto/tests/Makefile.am | 23 +++++++++++++++++++++++ src/lib/crypto/tests/run_unittests.cc | 24 ++++++++++++++++++++++++ 7 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 src/lib/crypto/Makefile.am create mode 100644 src/lib/crypto/crypto.cc create mode 100644 src/lib/crypto/crypto.h create mode 100644 src/lib/crypto/tests/Makefile.am create mode 100644 src/lib/crypto/tests/run_unittests.cc diff --git a/configure.ac b/configure.ac index 1c063c4894..fbc17025ba 100644 --- a/configure.ac +++ b/configure.ac @@ -667,6 +667,8 @@ AC_CONFIG_FILES([Makefile src/lib/config/Makefile src/lib/config/tests/Makefile src/lib/config/tests/testdata/Makefile + src/lib/crypto/Makefile + src/lib/crypto/tests/Makefile src/lib/dns/Makefile src/lib/dns/tests/Makefile src/lib/dns/tests/testdata/Makefile diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 8525b8da06..bb7b06d9d3 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = exceptions dns cc config python xfr bench log asiolink \ - nsas cache resolve testutils datasrc server_common +SUBDIRS = exceptions crypto dns cc config python xfr bench log \ + asiolink nsas cache resolve testutils datasrc server_common diff --git a/src/lib/crypto/Makefile.am b/src/lib/crypto/Makefile.am new file mode 100644 index 0000000000..bbce502d10 --- /dev/null +++ b/src/lib/crypto/Makefile.am @@ -0,0 +1,11 @@ +SUBDIRS = . tests + +AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib +AM_CPPFLAGS += $(BOOST_INCLUDES) +AM_CXXFLAGS = $(B10_CXXFLAGS) + +CLEANFILES = *.gcno *.gcda + +lib_LTLIBRARIES = libcrypto.la + +libcrypto_la_SOURCES = crypto.h diff --git a/src/lib/crypto/crypto.cc b/src/lib/crypto/crypto.cc new file mode 100644 index 0000000000..b18d80d324 --- /dev/null +++ b/src/lib/crypto/crypto.cc @@ -0,0 +1,25 @@ +// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +#include "crypto.h" + +namespace isc { +namespace crypto { + +void +init() { +} + +} // namespace crypto +} // namespace isc diff --git a/src/lib/crypto/crypto.h b/src/lib/crypto/crypto.h new file mode 100644 index 0000000000..bd17c0e1d2 --- /dev/null +++ b/src/lib/crypto/crypto.h @@ -0,0 +1,26 @@ +// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +#ifndef _ISC_CRYPTO_H +#define _ISC_CRYPTO_H + +namespace isc { +namespace crypto { + +void init(); + +} // namespace crypto +} // namespace isc + +#endif // _ISC_CRYPTO_H diff --git a/src/lib/crypto/tests/Makefile.am b/src/lib/crypto/tests/Makefile.am new file mode 100644 index 0000000000..42bfa3b41e --- /dev/null +++ b/src/lib/crypto/tests/Makefile.am @@ -0,0 +1,23 @@ +SUBDIRS = . + +AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib +AM_CPPFLAGS += $(BOOST_INCLUDES) +AM_CXXFLAGS = $(B10_CXXFLAGS) + +if USE_STATIC_LINK +AM_LDFLAGS = -static +endif + +CLEANFILES = *.gcno *.gcda + +TESTS = +if HAVE_GTEST +TESTS += run_unittests +run_unittests_SOURCES = run_unittests.cc +run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) +run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) +run_unittests_LDADD = $(GTEST_LDADD) +run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la +endif + +noinst_PROGRAMS = $(TESTS) diff --git a/src/lib/crypto/tests/run_unittests.cc b/src/lib/crypto/tests/run_unittests.cc new file mode 100644 index 0000000000..d5e20c9d58 --- /dev/null +++ b/src/lib/crypto/tests/run_unittests.cc @@ -0,0 +1,24 @@ +// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +#include + +#include + +int +main(int argc, char* argv[]) { + ::testing::InitGoogleTest(&argc, argv); + + return (RUN_ALL_TESTS()); +}