[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/LIBGOOGLETEST PATCH 3/3] Initial port of googletest to Unikraft


  • To: "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
  • Date: Mon, 22 Jul 2019 16:29:57 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=stud.acs.upb.ro;dmarc=pass action=none header.from=stud.acs.upb.ro;dkim=pass header.d=stud.acs.upb.ro;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lT1O5PhZvyz3Z3GfYpvcfyS3SHK+hf+Yvyi374JpMUc=; b=VQ8hCVChYuXVBROhRcg0NQSBjI+3ex69hGUSyTrDI2IeBaqmmIFhgfAKDyPQhw+GHhybsbez+/QB4BBg/DMpFx9mRKbJVxLE/Sq71ii+rL/gPKNy3cAx89GGAYB6LdeG2j6yic/nyN6IXL3xn5MhT8CqinKrgSqq7LkFaNZKyRUoTXyFKanulFBTprQADJ11NOv8DSw9B15hJkWFFK+VmHVIETAq8NVbGp3b3t8PIe+KzN+J+l67sWSV3UTnzN+THe2orL60TBxp6dMIUegtCHtOBjC7F8NRtyKN7l4qv8e+yKu1Vjut8nk7o/Hx+58BXPU8D2ws3aB8ZdMPMTzA9Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cPVBLjhvw+mZ0BBhUUN1enPIsBKohWpBwuwOKviAaFYd7BLPhIImi91P9H9hNBKr09OKfV/5uyex59s8ELtczRy89HYZpartRzgPBcaYQtKjPt9dFeDnidvtz5uePuaWW7tmicNwM1yQNUxoNyQGG1yXExW3BDb9wk0BPS8SgRatBG9nvzUKUeRxYh21G8zo6Wjyd6dP9WTEChVEjYLyJ/qkRnH4Fq4ZLehC2fjkrAtpsmG41U6ry5nX4HDLmyoLpFP1RE5hE6RlL/09auh/gKlHxY5qn83+aGzQp/4yFJNPvhNijCV4PmsxAPUTVBEeGWIrXHJ8aJrs6EP4ikKvyA==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=vlad_andrei.badoiu@xxxxxxxxxxxxxxx;
  • Cc: "felipe.huici@xxxxxxxxx" <felipe.huici@xxxxxxxxx>, Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>, "costin.lupu@xxxxxxxxx" <costin.lupu@xxxxxxxxx>
  • Delivery-date: Mon, 22 Jul 2019 16:30:05 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHVQKqzCxMQofRhQ0iFPv96jfj7Dg==
  • Thread-topic: [UNIKRAFT/LIBGOOGLETEST PATCH 3/3] Initial port of googletest to Unikraft

This is our initial port of googletest to Unikraft as an external library. 
Libcxx is
required. When adding the library to the dependency list it should stay after
libcxx and newlib.
 (eg. ...:$(UK_LIBS)/libunwind:$(UK_LIBS)/compiler-rt:$(UK_LIBS)/libcxxabi:
$(UK_LIBS)/libcxx:$(UK_LIBS)/newlib:$(UK_LIBS)/googletest:...)

This library has a config option, LIBGOOGLETEST_BUILD_MAIN, that builds the
gtest_main.cc file. This is because some libraries do not have any main function
in their unit tests and expect googletest to provide it.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
---
 Config.uk   | 10 +++++++
 Makefile.uk | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)
 create mode 100644 Config.uk
 create mode 100644 Makefile.uk

diff --git a/Config.uk b/Config.uk
new file mode 100644
index 0000000..862d4ee
--- /dev/null
+++ b/Config.uk
@@ -0,0 +1,10 @@
+menuconfig LIBGOOGLETEST
+    bool "Google Testing and Mocking Framework"
+    select LIBCXX
+    default n
+
+if LIBGOOGLETEST
+    config LIBGOOGLETEST_BUILD_MAIN
+    bool "Build googletest with main"
+    default n
+endif
diff --git a/Makefile.uk b/Makefile.uk
new file mode 100644
index 0000000..91f654e
--- /dev/null
+++ b/Makefile.uk
@@ -0,0 +1,75 @@
+#  libgoogletest Makefile.uk
+#
+#  Authors: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
+#
+#  Copyright (c) 2019, Politehnica University of Bucharest. All rights 
reserved.
+#
+#  Redistribution and use in source and binary forms, with or without
+#  modification, are permitted provided that the following conditions
+#  are met:
+#
+#  1. Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#  2. Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#  3. Neither the name of the copyright holder nor the names of its
+#     contributors may be used to endorse or promote products derived from
+#     this software without specific prior written permission.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+#  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+#  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+#  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+#  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+#  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+#  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+#  POSSIBILITY OF SUCH DAMAGE.
+#
+#  THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
+#
+
+################################################################################
+# Library registration
+################################################################################
+$(eval $(call addlib_s,libgoogletest,$(CONFIG_LIBGOOGLETEST)))
+
+################################################################################
+# Sources
+################################################################################
+LIBGOOGLETEST_VERSION=1.8.1
+LIBGOOGLETEST_URL=https://github.com/google/googletest/archive/release-$(LIBGOOGLETEST_VERSION).zip
+$(eval $(call fetch,libgoogletest,$(LIBGOOGLETEST_URL)))
+
+################################################################################
+# Helpers
+################################################################################
+LIBGOOGLETEST_SUBDIR=googletest-release-$(LIBGOOGLETEST_VERSION)
+LIBGOOGLETEST_SRC = $(LIBGOOGLETEST_ORIGIN)/$(LIBGOOGLETEST_SUBDIR)
+
+################################################################################
+# Library includes
+################################################################################
+CINCLUDES-$(CONFIG_LIBGOOGLETEST) += -I$(LIBGOOGLETEST_SRC)/googletest/
+CINCLUDES-$(CONFIG_LIBGOOGLETEST) += -I$(LIBGOOGLETEST_SRC)/googletest/include
+
+CXXINCLUDES-$(CONFIG_LIBGOOGLETEST) += -I$(LIBGOOGLETEST_SRC)/googletest/
+CXXINCLUDES-$(CONFIG_LIBGOOGLETEST) += 
-I$(LIBGOOGLETEST_SRC)/googletest/include
+
+################################################################################
+# Global flags
+################################################################################
+CONFIG_FLAGS += -D GTEST_HAS_CXXABI_H_ -D GTEST_LANG_CXX11
+LIBGOOGLETEST_CFLAGS-y         += $(CONFIG_FLAGS)
+LIBGOOGLETEST_CXXFLAGS-y       += $(CONFIG_FLAGS)
+
+################################################################################
+# Library sources
+################################################################################
+ifdef CONFIG_LIBGOOGLETEST_BUILD_MAIN
+LIBGOOGLETEST_SRCS-y += $(LIBGOOGLETEST_SRC)/googletest/src/gtest_main.cc
+endif
+LIBGOOGLETEST_SRCS-y += $(LIBGOOGLETEST_SRC)/googletest/src/gtest-all.cc
-- 
2.21.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.