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

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



Reviewed-by: Felipe Huici <felipe.huici@xxxxxxxxx>

On 22.07.19, 18:30, "Vlad-Andrei BĂDOIU (78692)" 
<vlad_andrei.badoiu@xxxxxxxxxxxxxxx> wrote:

    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®.