Home | History | Annotate | Download | only in test
      1 # Copyright 2014 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 import("//testing/test.gni")
      6 
      7 static_library("test_support") {
      8   testonly = true
      9   sources = [
     10     "mojo_test_base.cc",
     11     "mojo_test_base.h",
     12     "test_utils.h",
     13     "test_utils_posix.cc",
     14     "test_utils_win.cc",
     15   ]
     16 
     17   if (!is_ios) {
     18     sources += [
     19       "multiprocess_test_helper.cc",
     20       "multiprocess_test_helper.h",
     21     ]
     22   }
     23 
     24   deps = [
     25     "//base",
     26     "//base/test:test_support",
     27     "//mojo/edk/system",
     28     "//mojo/public/cpp/system",
     29     "//testing/gtest",
     30   ]
     31 }
     32 
     33 source_set("run_all_unittests") {
     34   testonly = true
     35   sources = [
     36     "run_all_unittests.cc",
     37   ]
     38 
     39   deps = [
     40     ":test_support",
     41     ":test_support_impl",
     42     "//base",
     43     "//base/test:test_support",
     44     "//mojo/edk/system",
     45     "//mojo/public/c/test_support",
     46     "//testing/gtest",
     47   ]
     48 
     49   if (is_linux && !is_component_build) {
     50     public_configs = [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
     51   }
     52 }
     53 
     54 source_set("run_all_perftests") {
     55   testonly = true
     56   deps = [
     57     ":test_support_impl",
     58     "//base",
     59     "//base/test:test_support",
     60     "//mojo/edk/system",
     61     "//mojo/edk/test:test_support",
     62     "//mojo/public/c/test_support",
     63   ]
     64 
     65   sources = [
     66     "run_all_perftests.cc",
     67   ]
     68 
     69   if (is_linux && !is_component_build) {
     70     public_configs = [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
     71   }
     72 }
     73 
     74 static_library("test_support_impl") {
     75   testonly = true
     76   deps = [
     77     "//base",
     78     "//base/test:test_support",
     79     "//mojo/public/c/test_support",
     80     "//mojo/public/cpp/system",
     81   ]
     82 
     83   sources = [
     84     "test_support_impl.cc",
     85     "test_support_impl.h",
     86   ]
     87 }
     88 
     89 # Public SDK test targets follow. These targets are not defined within the
     90 # public SDK itself as running the unittests requires the EDK.
     91 # TODO(vtl): These don't really belong here. (They should be converted to
     92 # apptests, but even apart from that these targets belong somewhere else.)
     93 
     94 group("public_tests") {
     95   testonly = true
     96   deps = [
     97     ":mojo_public_bindings_unittests",
     98     ":mojo_public_system_perftests",
     99     ":mojo_public_system_unittests",
    100   ]
    101 }
    102 
    103 test("mojo_public_bindings_perftests") {
    104   deps = [
    105     ":run_all_perftests",
    106     "//mojo/edk/test:test_support",
    107     "//mojo/public/cpp/bindings/tests:perftests",
    108   ]
    109 }
    110 
    111 test("mojo_public_bindings_unittests") {
    112   deps = [
    113     ":run_all_unittests",
    114     "//mojo/edk/test:test_support",
    115     "//mojo/public/cpp/bindings/tests",
    116   ]
    117 }
    118 
    119 test("mojo_public_system_perftests") {
    120   deps = [
    121     ":run_all_perftests",
    122     "//mojo/public/c/system/tests:perftests",
    123   ]
    124 }
    125 
    126 test("mojo_public_system_unittests") {
    127   deps = [
    128     ":run_all_unittests",
    129     "//mojo/public/cpp/system/tests",
    130   ]
    131 }
    132