Home | History | Annotate | Download | only in googletest
      1 # Copyright (C) 2013 The Android Open Source Project
      2 #
      3 # Redistribution and use in source and binary forms, with or without
      4 # modification, are permitted provided that the following conditions are
      5 # met:
      6 #
      7 #     * Redistributions of source code must retain the above copyright
      8 # notice, this list of conditions and the following disclaimer.
      9 #     * Redistributions in binary form must reproduce the above
     10 # copyright notice, this list of conditions and the following disclaimer
     11 # in the documentation and/or other materials provided with the
     12 # distribution.
     13 #     * Neither the name of Google Inc. nor the names of its
     14 # contributors may be used to endorse or promote products derived from
     15 # this software without specific prior written permission.
     16 #
     17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     28 
     29 LOCAL_PATH := $(call my-dir)/googletest
     30 
     31 # Common definitions
     32 
     33 googletest_includes := $(LOCAL_PATH)/include
     34 
     35 googletest_sources := \
     36   src/gtest-death-test.cc \
     37   src/gtest-filepath.cc \
     38   src/gtest-port.cc \
     39   src/gtest-printers.cc \
     40   src/gtest-test-part.cc \
     41   src/gtest-typed-test.cc \
     42   src/gtest.cc
     43 
     44 googletest_main_sources := \
     45   src/gtest_main.cc
     46 
     47 # GoogleTest library modules.
     48 
     49 include $(CLEAR_VARS)
     50 LOCAL_MODULE := googletest_static
     51 LOCAL_SRC_FILES := $(googletest_sources)
     52 LOCAL_C_INCLUDES := $(googletest_includes)
     53 LOCAL_EXPORT_C_INCLUDES := $(googletest_includes)
     54 include $(BUILD_STATIC_LIBRARY)
     55 
     56 include $(CLEAR_VARS)
     57 LOCAL_MODULE := googletest_shared
     58 LOCAL_SRC_FILES := $(googletest_sources)
     59 LOCAL_C_INCLUDES := $(googletest_includes)
     60 LOCAL_CFLAGS := -DGTEST_CREATE_SHARED_LIBRARY
     61 LOCAL_EXPORT_C_INCLUDES := $(googletest_includes)
     62 include $(BUILD_SHARED_LIBRARY)
     63 
     64 # GoogleTest 'main' helper modules.
     65 
     66 include $(CLEAR_VARS)
     67 LOCAL_MODULE := googletest_main
     68 LOCAL_SRC_FILES := $(googletest_main_sources)
     69 LOCAL_STATIC_LIBRARIES := googletest_static
     70 include $(BUILD_STATIC_LIBRARY)
     71 
     72 include $(CLEAR_VARS)
     73 LOCAL_MODULE := googletest_main_shared
     74 LOCAL_SRC_FILES := $(googletest_main_sources)
     75 LOCAL_SHARED_LIBRARIES := googletest_shared
     76 include $(BUILD_STATIC_LIBRARY)
     77 
     78 # The GoogleTest test programs.
     79 #
     80 
     81 # The unit test suite itself.
     82 # This excludes tests that require a Python wrapper to run properly.
     83 # Note that this is _very_ slow to compile :)
     84 include $(CLEAR_VARS)
     85 LOCAL_MODULE := googletest_unittest
     86 
     87 # IMPORTANT: The test looks at the name of its executable and expects
     88 # the following. Otherwise OutputFileHelpersTest.GetCurrentExecutableName
     89 # will FAIL.
     90 #
     91 LOCAL_MODULE_FILENAME := gtest_all_test
     92 LOCAL_SRC_FILES := \
     93     test/gtest-filepath_test.cc \
     94     test/gtest-linked_ptr_test.cc \
     95     test/gtest-message_test.cc \
     96     test/gtest-options_test.cc \
     97     test/gtest-port_test.cc \
     98     test/gtest_pred_impl_unittest.cc \
     99     test/gtest_prod_test.cc \
    100     test/gtest-test-part_test.cc \
    101     test/gtest-typed-test_test.cc \
    102     test/gtest-typed-test2_test.cc \
    103     test/gtest_unittest.cc \
    104     test/production.cc
    105 LOCAL_STATIC_LIBRARIES := googletest_main
    106 include $(BUILD_EXECUTABLE)
    107 
    108 # The GoogleTest samples.
    109 # These are much quicker to build and run.
    110 
    111 include $(CLEAR_VARS)
    112 LOCAL_MODULE := googletest_sample_1
    113 LOCAL_SRC_FILES := \
    114     samples/sample1.cc \
    115     samples/sample1_unittest.cc
    116 LOCAL_STATIC_LIBRARIES := googletest_main_shared
    117 include $(BUILD_EXECUTABLE)
    118 
    119 include $(CLEAR_VARS)
    120 LOCAL_MODULE := googletest_sample_2
    121 LOCAL_SRC_FILES := \
    122     samples/sample2.cc \
    123     samples/sample2_unittest.cc
    124 LOCAL_STATIC_LIBRARIES := googletest_main_shared
    125 include $(BUILD_EXECUTABLE)
    126 
    127 include $(CLEAR_VARS)
    128 LOCAL_MODULE := googletest_sample_3
    129 LOCAL_SRC_FILES := \
    130     samples/sample3_unittest.cc
    131 LOCAL_STATIC_LIBRARIES := googletest_main_shared
    132 include $(BUILD_EXECUTABLE)
    133 
    134 include $(CLEAR_VARS)
    135 LOCAL_MODULE := googletest_sample_4
    136 LOCAL_SRC_FILES := \
    137     samples/sample4.cc \
    138     samples/sample4_unittest.cc
    139 LOCAL_STATIC_LIBRARIES := googletest_main_shared
    140 include $(BUILD_EXECUTABLE)
    141 
    142 include $(CLEAR_VARS)
    143 LOCAL_MODULE := googletest_sample_5
    144 LOCAL_SRC_FILES := \
    145     samples/sample1.cc \
    146     samples/sample5_unittest.cc
    147 LOCAL_STATIC_LIBRARIES := googletest_main_shared
    148 include $(BUILD_EXECUTABLE)
    149 
    150 include $(CLEAR_VARS)
    151 LOCAL_MODULE := googletest_sample_6
    152 LOCAL_SRC_FILES := \
    153     samples/sample6_unittest.cc
    154 LOCAL_STATIC_LIBRARIES := googletest_main_shared
    155 include $(BUILD_EXECUTABLE)
    156 
    157 include $(CLEAR_VARS)
    158 LOCAL_MODULE := googletest_sample_7
    159 LOCAL_SRC_FILES := \
    160     samples/sample7_unittest.cc
    161 LOCAL_STATIC_LIBRARIES := googletest_main_shared
    162 include $(BUILD_EXECUTABLE)
    163 
    164 include $(CLEAR_VARS)
    165 LOCAL_MODULE := googletest_sample_8
    166 LOCAL_SRC_FILES := \
    167     samples/sample8_unittest.cc
    168 LOCAL_STATIC_LIBRARIES := googletest_main_shared
    169 include $(BUILD_EXECUTABLE)
    170 
    171 include $(CLEAR_VARS)
    172 LOCAL_MODULE := googletest_sample_9
    173 LOCAL_SRC_FILES := \
    174     samples/sample9_unittest.cc
    175 LOCAL_STATIC_LIBRARIES := googletest_main_shared
    176 include $(BUILD_EXECUTABLE)
    177