|
1 |
| -# Copyright 2019 the V8 project authors. All rights reserved. |
| 1 | +# Copyright 2018 The Chromium Authors |
2 | 2 | # Use of this source code is governed by a BSD-style license that can be
|
3 | 3 | # found in the LICENSE file.
|
4 | 4 |
|
5 |
| -static_library("encoding") { |
| 5 | +# This BUILD.gn file is specific to the standalone project. Do not |
| 6 | +# copy this downstream. |
| 7 | + |
| 8 | +import("//testing/test.gni") |
| 9 | + |
| 10 | +static_library("crdtp") { |
6 | 11 | sources = [
|
7 |
| - "encoding/encoding.cc", |
8 |
| - "encoding/encoding.h", |
| 12 | + "crdtp/cbor.cc", |
| 13 | + "crdtp/cbor.h", |
| 14 | + "crdtp/dispatch.cc", |
| 15 | + "crdtp/dispatch.h", |
| 16 | + "crdtp/error_support.cc", |
| 17 | + "crdtp/error_support.h", |
| 18 | + "crdtp/export.h", |
| 19 | + "crdtp/find_by_first.h", |
| 20 | + "crdtp/frontend_channel.h", |
| 21 | + "crdtp/glue.h", |
| 22 | + "crdtp/json.cc", |
| 23 | + "crdtp/json.h", |
| 24 | + "crdtp/parser_handler.h", |
| 25 | + "crdtp/protocol_core.cc", |
| 26 | + "crdtp/protocol_core.h", |
| 27 | + "crdtp/serializable.cc", |
| 28 | + "crdtp/serializable.h", |
| 29 | + "crdtp/span.cc", |
| 30 | + "crdtp/span.h", |
| 31 | + "crdtp/status.cc", |
| 32 | + "crdtp/status.h", |
9 | 33 | ]
|
| 34 | + deps = [ ":crdtp_platform" ] |
10 | 35 | }
|
11 | 36 |
|
12 |
| -# encoding_test is part of the unittests, defined in |
13 |
| -# test/unittests/BUILD.gn. |
| 37 | +# A small adapter library which only :crdtp may depend on. |
| 38 | +static_library("crdtp_platform") { |
| 39 | + sources = [ |
| 40 | + "crdtp/json_platform.cc", |
| 41 | + "crdtp/json_platform.h", |
| 42 | + ] |
| 43 | +} |
14 | 44 |
|
15 |
| -import("../../gni/v8.gni") |
| 45 | +# In this (upstream) standalone package, we declare crdtp_test, and a |
| 46 | +# few minimal files in testing (accessed via test_platform.{h,cc}) to |
| 47 | +# make it look like Chromium's testing package. In Chromium, |
| 48 | +# we run these tests as part of the content_unittests, declared in |
| 49 | +# content/test/BUILD.gn, and in V8, we run them via unittests, declared |
| 50 | +# in test/unittests/BUILD.gn. |
16 | 51 |
|
17 |
| -v8_source_set("encoding_test") { |
| 52 | +test("crdtp_test") { |
18 | 53 | sources = [
|
19 |
| - "encoding/encoding_test.cc", |
20 |
| - "encoding/encoding_test_helper.h", |
21 |
| - ] |
22 |
| - configs = [ |
23 |
| - "../..:external_config", |
24 |
| - "../..:internal_config_base", |
| 54 | + "crdtp/cbor_test.cc", |
| 55 | + "crdtp/dispatch_test.cc", |
| 56 | + "crdtp/error_support_test.cc", |
| 57 | + "crdtp/find_by_first_test.cc", |
| 58 | + "crdtp/json_test.cc", |
| 59 | + "crdtp/protocol_core_test.cc", |
| 60 | + "crdtp/serializable_test.cc", |
| 61 | + "crdtp/span_test.cc", |
| 62 | + "crdtp/status_test.cc", |
| 63 | + "crdtp/status_test_support.cc", |
| 64 | + "crdtp/status_test_support.h", |
| 65 | + "crdtp/test_string_traits.cc", |
| 66 | + "crdtp/test_string_traits.h", |
25 | 67 | ]
|
| 68 | + include_dirs = [ "." ] |
26 | 69 | deps = [
|
27 |
| - ":encoding", |
28 |
| - "../..:v8_libbase", |
29 |
| - "../../src/inspector:inspector_string_conversions", |
| 70 | + ":crdtp", |
| 71 | + ":crdtp_test_platform", |
| 72 | + ] |
| 73 | +} |
| 74 | + |
| 75 | +# A small adapter library which only :crdtp_test may depend on. |
| 76 | +static_library("crdtp_test_platform") { |
| 77 | + sources = [ |
| 78 | + "crdtp/test_platform.cc", |
| 79 | + "crdtp/test_platform.h", |
| 80 | + ] |
| 81 | + testonly = true |
| 82 | + include_dirs = [ "." ] |
| 83 | + public_deps = [ |
| 84 | + "//base", |
30 | 85 | "//testing/gmock",
|
31 | 86 | "//testing/gtest",
|
| 87 | + "//testing/gtest:gtest_main", |
32 | 88 | ]
|
33 |
| - testonly = true |
| 89 | +} |
| 90 | + |
| 91 | +# A command line utility for converting between JSON and CBOR. |
| 92 | +executable("transcode") { |
| 93 | + sources = [ "crdtp/transcode.cc" ] |
| 94 | + deps = [ ":crdtp" ] |
34 | 95 | }
|
0 commit comments