OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 { | 5 { |
6 'variables': { | 6 'variables': { |
7 'conditions': [ | 7 'conditions': [ |
8 ['OS=="linux"', { | 8 ['OS=="linux"', { |
9 'compile_suid_client': 1, | 9 'compile_suid_client': 1, |
10 }, { | 10 }, { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 # Similarly, compile seccomp BPF when we support it | 58 # Similarly, compile seccomp BPF when we support it |
59 [ 'compile_seccomp_bpf==1', { | 59 [ 'compile_seccomp_bpf==1', { |
60 'type': 'static_library', | 60 'type': 'static_library', |
61 'dependencies': [ | 61 'dependencies': [ |
62 'seccomp_bpf', | 62 'seccomp_bpf', |
63 ], | 63 ], |
64 }], | 64 }], |
65 ], | 65 ], |
66 }, | 66 }, |
67 { | 67 { |
| 68 # The main sandboxing test target. |
68 'target_name': 'sandbox_linux_unittests', | 69 'target_name': 'sandbox_linux_unittests', |
69 'type': '<(gtest_target_type)', | 70 'includes': [ |
70 'dependencies': [ | 71 'sandbox_linux_test_sources.gypi', |
71 'sandbox', | |
72 '../testing/gtest.gyp:gtest', | |
73 ], | 72 ], |
74 'sources': [ | 73 'type': 'executable', |
75 'tests/main.cc', | 74 }, |
76 'tests/unit_tests.cc', | 75 { |
77 'tests/unit_tests.h', | 76 # This target is the shared library used by Android APK (i.e. |
78 'services/broker_process_unittest.cc', | 77 # JNI-friendly) tests. |
| 78 'target_name': 'sandbox_linux_jni_unittests', |
| 79 'includes': [ |
| 80 'sandbox_linux_test_sources.gypi', |
79 ], | 81 ], |
80 'include_dirs': [ | 82 'type': 'shared_library', |
81 '../..', | |
82 ], | |
83 'conditions': [ | 83 'conditions': [ |
84 [ 'compile_suid_client==1', { | 84 [ 'OS == "android" and gtest_target_type == "shared_library"', { |
85 'sources': [ | |
86 'suid/client/setuid_sandbox_client_unittest.cc', | |
87 ], | |
88 }], | |
89 [ 'compile_seccomp_bpf==1', { | |
90 'sources': [ | |
91 'seccomp-bpf/bpf_tests.h', | |
92 'seccomp-bpf/codegen_unittest.cc', | |
93 'seccomp-bpf/errorcode_unittest.cc', | |
94 'seccomp-bpf/sandbox_bpf_unittest.cc', | |
95 'seccomp-bpf/syscall_iterator_unittest.cc', | |
96 'seccomp-bpf/syscall_unittest.cc', | |
97 ], | |
98 }], | |
99 ['OS == "android" and gtest_target_type == "shared_library"', { | |
100 'dependencies': [ | 85 'dependencies': [ |
101 '../testing/android/native_test.gyp:native_test_native_code', | 86 '../testing/android/native_test.gyp:native_test_native_code', |
102 ] | 87 ], |
103 }], | 88 }], |
104 ], | 89 ], |
105 }, | 90 }, |
106 { | 91 { |
107 'target_name': 'seccomp_bpf', | 92 'target_name': 'seccomp_bpf', |
108 'type': 'static_library', | 93 'type': 'static_library', |
109 'sources': [ | 94 'sources': [ |
110 'seccomp-bpf/basicblock.cc', | 95 'seccomp-bpf/basicblock.cc', |
111 'seccomp-bpf/basicblock.h', | 96 'seccomp-bpf/basicblock.h', |
112 'seccomp-bpf/codegen.cc', | 97 'seccomp-bpf/codegen.cc', |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 'suid/client/setuid_sandbox_client.cc', | 194 'suid/client/setuid_sandbox_client.cc', |
210 'suid/client/setuid_sandbox_client.h', | 195 'suid/client/setuid_sandbox_client.h', |
211 ], | 196 ], |
212 'dependencies': [ | 197 'dependencies': [ |
213 '../base/base.gyp:base', | 198 '../base/base.gyp:base', |
214 ], | 199 ], |
215 'include_dirs': [ | 200 'include_dirs': [ |
216 '..', | 201 '..', |
217 ], | 202 ], |
218 }, | 203 }, |
219 | |
220 ], | 204 ], |
221 'conditions': [ | 205 'conditions': [ |
222 # Strategy copied from base_unittests_apk in base/base.gyp. | 206 # Strategy copied from base_unittests_apk in base/base.gyp. |
223 [ 'OS=="android" and gtest_target_type == "shared_library"', { | 207 [ 'OS=="android" and gtest_target_type == "shared_library"', { |
224 'targets': [ | 208 'targets': [ |
225 { | 209 { |
226 'target_name': 'sandbox_linux_unittests_apk', | 210 'target_name': 'sandbox_linux_jni_unittests_apk', |
227 'type': 'none', | 211 'type': 'none', |
228 'dependencies': [ | |
229 'sandbox_linux_unittests', | |
230 ], | |
231 'variables': { | 212 'variables': { |
232 'test_suite_name': 'sandbox_linux_unittests', | 213 'test_suite_name': 'sandbox_linux_jni_unittests', |
233 'input_shlib_path': | 214 'input_shlib_path': |
234 '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)sandbox_linux_unittests' | 215 '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)' |
| 216 'sandbox_linux_jni_unittests' |
235 '<(SHARED_LIB_SUFFIX)', | 217 '<(SHARED_LIB_SUFFIX)', |
236 }, | 218 }, |
| 219 'dependencies': [ |
| 220 'sandbox_linux_jni_unittests', |
| 221 ], |
237 'includes': [ '../../build/apk_test.gypi' ], | 222 'includes': [ '../../build/apk_test.gypi' ], |
238 } | 223 } |
239 ], | 224 ], |
240 }], | 225 }], |
241 ], | 226 ], |
242 } | 227 } |
OLD | NEW |