| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/features.gni") | 5 import("//build/config/features.gni") |
| 6 import("//testing/test.gni") | 6 import("//testing/test.gni") |
| 7 | 7 |
| 8 declare_args() { | 8 declare_args() { |
| 9 compile_suid_client = is_linux | 9 compile_suid_client = is_linux |
| 10 | 10 |
| 11 compile_credentials = is_linux | 11 compile_credentials = is_linux |
| 12 | 12 |
| 13 compile_seccomp_bpf_demo = | 13 compile_seccomp_bpf_demo = |
| 14 is_linux && (current_cpu == "x86" || current_cpu == "x64") | 14 is_linux && (cpu_arch == "x86" || cpu_arch == "x64") |
| 15 } | 15 } |
| 16 | 16 |
| 17 # We have two principal targets: sandbox and sandbox_linux_unittests | 17 # We have two principal targets: sandbox and sandbox_linux_unittests |
| 18 # All other targets are listed as dependencies. | 18 # All other targets are listed as dependencies. |
| 19 # There is one notable exception: for historical reasons, chrome_sandbox is | 19 # There is one notable exception: for historical reasons, chrome_sandbox is |
| 20 # the setuid sandbox and is its own target. | 20 # the setuid sandbox and is its own target. |
| 21 | 21 |
| 22 group("sandbox") { | 22 group("sandbox") { |
| 23 deps = [ | 23 deps = [ |
| 24 ":sandbox_services", | 24 ":sandbox_services", |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 sources += [ | 56 sources += [ |
| 57 "seccomp-bpf/bpf_tester_compatibility_delegate.h", | 57 "seccomp-bpf/bpf_tester_compatibility_delegate.h", |
| 58 "seccomp-bpf/bpf_tests.h", | 58 "seccomp-bpf/bpf_tests.h", |
| 59 "seccomp-bpf/sandbox_bpf_test_runner.cc", | 59 "seccomp-bpf/sandbox_bpf_test_runner.cc", |
| 60 "seccomp-bpf/sandbox_bpf_test_runner.h", | 60 "seccomp-bpf/sandbox_bpf_test_runner.h", |
| 61 ] | 61 ] |
| 62 deps += [ ":seccomp_bpf" ] | 62 deps += [ ":seccomp_bpf" ] |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 # Sources shared by sandbox_linux_unittests and sandbox_linux_jni_unittests. | 66 # The main sandboxing test target. |
| 67 source_set("sandbox_linux_unittests_sources") { | 67 test("sandbox_linux_unittests") { |
| 68 testonly = true | |
| 69 | |
| 70 sources = [ | 68 sources = [ |
| 71 "services/proc_util_unittest.cc", | 69 "services/proc_util_unittest.cc", |
| 72 "services/resource_limits_unittests.cc", | 70 "services/resource_limits_unittests.cc", |
| 73 "services/scoped_process_unittest.cc", | 71 "services/scoped_process_unittest.cc", |
| 74 "services/syscall_wrappers_unittest.cc", | 72 "services/syscall_wrappers_unittest.cc", |
| 75 "services/thread_helpers_unittests.cc", | 73 "services/thread_helpers_unittests.cc", |
| 76 "services/yama_unittests.cc", | 74 "services/yama_unittests.cc", |
| 77 "syscall_broker/broker_file_permission_unittest.cc", | 75 "syscall_broker/broker_file_permission_unittest.cc", |
| 78 "syscall_broker/broker_process_unittest.cc", | 76 "syscall_broker/broker_process_unittest.cc", |
| 79 "tests/main.cc", | 77 "tests/main.cc", |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 if (compile_credentials) { | 120 if (compile_credentials) { |
| 123 sources += [ | 121 sources += [ |
| 124 "integration_tests/namespace_unix_domain_socket_unittest.cc", | 122 "integration_tests/namespace_unix_domain_socket_unittest.cc", |
| 125 "services/credentials_unittest.cc", | 123 "services/credentials_unittest.cc", |
| 126 "services/namespace_sandbox_unittest.cc", | 124 "services/namespace_sandbox_unittest.cc", |
| 127 "services/namespace_utils_unittest.cc", | 125 "services/namespace_utils_unittest.cc", |
| 128 ] | 126 ] |
| 129 } | 127 } |
| 130 } | 128 } |
| 131 | 129 |
| 132 # The main sandboxing test target. | 130 # TODO(GYP) Android version of this test. |
| 133 test("sandbox_linux_unittests") { | 131 # { |
| 134 deps = [ | 132 # # This target is the shared library used by Android APK (i.e. |
| 135 ":sandbox_linux_unittests_sources", | 133 # # JNI-friendly) tests. |
| 136 ] | 134 # "target_name": "sandbox_linux_jni_unittests", |
| 137 } | 135 # "includes": [ |
| 138 | 136 # "sandbox_linux_test_sources.gypi", |
| 139 # This target is the shared library used by Android APK (i.e. | 137 # ], |
| 140 # JNI-friendly) tests. | 138 # "type": "shared_library", |
| 141 shared_library("sandbox_linux_jni_unittests") { | 139 # "conditions": [ |
| 142 testonly = true | 140 # [ "OS == "android"", { |
| 143 deps = [ | 141 # "dependencies": [ |
| 144 ":sandbox_linux_unittests_sources", | 142 # "../testing/android/native_test.gyp:native_test_native_code", |
| 145 ] | 143 # ], |
| 146 if (is_android) { | 144 # }], |
| 147 deps += [ "//testing/android:native_test_native_code" ] | 145 # ], |
| 148 } | 146 # }, |
| 149 } | |
| 150 | 147 |
| 151 component("seccomp_bpf") { | 148 component("seccomp_bpf") { |
| 152 sources = [ | 149 sources = [ |
| 153 "bpf_dsl/bpf_dsl.cc", | 150 "bpf_dsl/bpf_dsl.cc", |
| 154 "bpf_dsl/bpf_dsl.h", | 151 "bpf_dsl/bpf_dsl.h", |
| 155 "bpf_dsl/bpf_dsl_forward.h", | 152 "bpf_dsl/bpf_dsl_forward.h", |
| 156 "bpf_dsl/bpf_dsl_impl.h", | 153 "bpf_dsl/bpf_dsl_impl.h", |
| 157 "bpf_dsl/codegen.cc", | 154 "bpf_dsl/codegen.cc", |
| 158 "bpf_dsl/codegen.h", | 155 "bpf_dsl/codegen.h", |
| 159 "bpf_dsl/cons.h", | 156 "bpf_dsl/cons.h", |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 # 'type': 'none', | 352 # 'type': 'none', |
| 356 # 'variables': { | 353 # 'variables': { |
| 357 # 'test_suite_name': 'sandbox_linux_jni_unittests', | 354 # 'test_suite_name': 'sandbox_linux_jni_unittests', |
| 358 # }, | 355 # }, |
| 359 # 'dependencies': [ | 356 # 'dependencies': [ |
| 360 # 'sandbox_linux_jni_unittests', | 357 # 'sandbox_linux_jni_unittests', |
| 361 # ], | 358 # ], |
| 362 # 'includes': [ '../../build/apk_test.gypi' ], | 359 # 'includes': [ '../../build/apk_test.gypi' ], |
| 363 # } | 360 # } |
| 364 } | 361 } |
| OLD | NEW |