Home | History | Annotate | Download | only in test
      1 # Copyright 2017 Google Inc. 
      2 # All Rights Reserved.
      3 #
      4 #
      5 # Redistribution and use in source and binary forms, with or without
      6 # modification, are permitted provided that the following conditions are
      7 # met:
      8 #
      9 #     * Redistributions of source code must retain the above copyright
     10 # notice, this list of conditions and the following disclaimer.
     11 #     * Redistributions in binary form must reproduce the above
     12 # copyright notice, this list of conditions and the following disclaimer
     13 # in the documentation and/or other materials provided with the
     14 # distribution.
     15 #     * Neither the name of Google Inc. nor the names of its
     16 # contributors may be used to endorse or promote products derived from
     17 # this software without specific prior written permission.
     18 #
     19 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     20 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     21 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     22 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     23 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     30 #
     31 # Author: misterg (a] google.com (Gennadiy Civil)
     32 #
     33 # Bazel BUILD for The Google C++ Testing Framework (Google Test)
     34 
     35 licenses(["notice"])
     36 
     37 """ gtest own tests """
     38 
     39 #on windows exclude gtest-tuple.h and gtest-tuple_test.cc
     40 cc_test(
     41     name = "gtest_all_test",
     42     size = "small",
     43     srcs =  glob(
     44                     include = [
     45                         "gtest-*.cc",
     46                         "*.h",
     47                         "googletest/include/gtest/**/*.h",
     48                     ],
     49                     exclude = [
     50                         "gtest-unittest-api_test.cc",
     51                         "gtest-tuple_test.cc",
     52                         "googletest/src/gtest-all.cc",
     53                         "gtest_all_test.cc",
     54                         "gtest-death-test_ex_test.cc",
     55                         "gtest-listener_test.cc",
     56                         "gtest-unittest-api_test.cc",
     57                         "gtest-param-test_test.cc",
     58                     ],
     59                 ) + select({
     60         "//:win": [],
     61         "//conditions:default": [
     62             "gtest-tuple_test.cc",
     63         ],
     64         }),
     65     copts = select({
     66         "//:win": ["-DGTEST_USE_OWN_TR1_TUPLE=0"],
     67         "//conditions:default": ["-DGTEST_USE_OWN_TR1_TUPLE=1"],
     68     }),
     69     includes = [
     70         "googletest",
     71         "googletest/include",
     72         "googletest/include/internal",
     73         "googletest/test",
     74     ],
     75     linkopts = select({
     76         "//:win": [],
     77         "//conditions:default": [
     78             "-pthread",
     79         ],
     80     }),
     81     deps = ["//:gtest_main"],
     82 )
     83 
     84 #These googletest tests have their own main()
     85 cc_test(
     86     name = "gtest-listener_test",
     87     size = "small",
     88     srcs = [
     89         "gtest-listener_test.cc",
     90     ],
     91     deps = [
     92         "//:gtest",
     93     ],
     94 )
     95 
     96 cc_test(
     97     name = "gtest-unittest-api_test",
     98     size = "small",
     99     srcs = [
    100         "gtest-unittest-api_test.cc",
    101     ],
    102     deps = [
    103         "//:gtest",
    104     ],
    105 )
    106 
    107 cc_test(
    108     name = "gtest-param-test_test",
    109     size = "small",
    110     srcs = [
    111         "gtest-param-test2_test.cc",
    112         "gtest-param-test_test.cc",
    113         "gtest-param-test_test.h",
    114     ],
    115     deps = [
    116         "//:gtest",
    117     ],
    118 )
    119