2020-01-17 21:05:03 +08:00
|
|
|
# Copyright 2019 Google LLC
|
2019-05-06 20:03:29 +08:00
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2020-12-15 01:15:40 +08:00
|
|
|
if(SAPI_LIB_TYPE STREQUAL "STATIC")
|
|
|
|
set(_sandbox2_linkopts -static)
|
|
|
|
else()
|
|
|
|
set(_sandbox2_linkopts ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
endif()
|
2019-05-06 20:03:29 +08:00
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:abort
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_abort
|
2019-05-06 20:03:29 +08:00
|
|
|
abort.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_testcase_abort PROPERTIES
|
|
|
|
OUTPUT_NAME abort)
|
|
|
|
add_executable(sandbox2::testcase_abort ALIAS sandbox2_testcase_abort)
|
|
|
|
target_link_libraries(sandbox2_testcase_abort PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
|
|
|
sapi::raw_logging
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:add_policy_on_syscalls
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_add_policy_on_syscalls
|
2019-05-06 20:03:29 +08:00
|
|
|
add_policy_on_syscalls.cc
|
|
|
|
)
|
|
|
|
add_executable(sandbox2::testcase_add_policy_on_syscalls
|
2020-12-14 17:13:03 +08:00
|
|
|
ALIAS sandbox2_testcase_add_policy_on_syscalls)
|
|
|
|
set_target_properties(sandbox2_testcase_add_policy_on_syscalls PROPERTIES
|
|
|
|
OUTPUT_NAME add_policy_on_syscalls
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_add_policy_on_syscalls PRIVATE
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:buffer
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_buffer
|
2019-05-06 20:03:29 +08:00
|
|
|
buffer.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_buffer ALIAS sandbox2_testcase_buffer)
|
|
|
|
set_target_properties(sandbox2_testcase_buffer PROPERTIES
|
|
|
|
OUTPUT_NAME buffer
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_buffer PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
absl::str_format
|
|
|
|
sandbox2::buffer
|
|
|
|
sandbox2::comms
|
|
|
|
sapi::base
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:ipc
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_ipc
|
2019-05-06 20:03:29 +08:00
|
|
|
ipc.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_testcase_ipc PROPERTIES
|
|
|
|
OUTPUT_NAME ipc
|
|
|
|
)
|
|
|
|
add_executable(sandbox2::testcase_ipc ALIAS sandbox2_testcase_ipc)
|
|
|
|
target_link_libraries(sandbox2_testcase_ipc PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
absl::strings
|
|
|
|
sandbox2::client
|
|
|
|
sandbox2::comms
|
|
|
|
sapi::base
|
|
|
|
sapi::raw_logging
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:malloc_system
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_malloc_system
|
2019-05-06 20:03:29 +08:00
|
|
|
malloc.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_malloc_system ALIAS
|
|
|
|
sandbox2_testcase_malloc_system)
|
|
|
|
set_target_properties(sandbox2_testcase_malloc_system PROPERTIES
|
|
|
|
OUTPUT_NAME malloc_system
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_malloc_system PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:minimal_dynamic
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_minimal_dynamic
|
2019-05-06 20:03:29 +08:00
|
|
|
minimal.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_testcase_minimal_dynamic PROPERTIES
|
|
|
|
OUTPUT_NAME minimal_dynamic
|
|
|
|
)
|
|
|
|
add_executable(sandbox2::testcase_minimal_dynamic ALIAS
|
|
|
|
sandbox2_testcase_minimal_dynamic)
|
|
|
|
target_link_libraries(sandbox2_testcase_minimal_dynamic PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:minimal
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_minimal
|
2019-05-06 20:03:29 +08:00
|
|
|
minimal.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_minimal ALIAS sandbox2_testcase_minimal)
|
|
|
|
set_target_properties(sandbox2_testcase_minimal PROPERTIES
|
|
|
|
OUTPUT_NAME minimal
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_minimal PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:personality
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_personality
|
2019-05-06 20:03:29 +08:00
|
|
|
personality.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_personality ALIAS
|
|
|
|
sandbox2_testcase_personality)
|
|
|
|
set_target_properties(sandbox2_testcase_personality PROPERTIES
|
|
|
|
OUTPUT_NAME personality
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_personality PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:pidcomms
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_pidcomms
|
2019-05-06 20:03:29 +08:00
|
|
|
pidcomms.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_pidcomms ALIAS sandbox2_testcase_pidcomms)
|
|
|
|
set_target_properties(sandbox2_testcase_pidcomms PROPERTIES
|
|
|
|
OUTPUT_NAME pidcomms
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_pidcomms PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::client
|
|
|
|
sandbox2::comms
|
|
|
|
sapi::base
|
|
|
|
sapi::raw_logging
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:policy
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_policy
|
2019-05-06 20:03:29 +08:00
|
|
|
policy.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_policy ALIAS sandbox2_testcase_policy)
|
|
|
|
set_target_properties(sandbox2_testcase_policy PROPERTIES
|
|
|
|
OUTPUT_NAME policy
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_policy PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::config
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:print_fds
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_print_fds
|
2019-05-06 20:03:29 +08:00
|
|
|
print_fds.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_print_fds ALIAS sandbox2_testcase_print_fds)
|
|
|
|
set_target_properties(sandbox2_testcase_print_fds PROPERTIES
|
|
|
|
OUTPUT_NAME print_fds
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_print_fds PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:sanitizer
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_sanitizer
|
2019-05-06 20:03:29 +08:00
|
|
|
sanitizer.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_sanitizer ALIAS sandbox2_testcase_sanitizer)
|
|
|
|
set_target_properties(sandbox2_testcase_sanitizer PROPERTIES
|
|
|
|
OUTPUT_NAME sanitizer
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_sanitizer PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
2021-12-07 18:22:46 +08:00
|
|
|
# sandboxed_api/sandbox2/testcases:close_fds
|
|
|
|
add_executable(sandbox2_testcase_close_fds
|
|
|
|
close_fds.cc
|
|
|
|
)
|
|
|
|
add_executable(sandbox2::testcase_close_fds ALIAS sandbox2_testcase_close_fds)
|
|
|
|
set_target_properties(sandbox2_testcase_close_fds PROPERTIES
|
|
|
|
OUTPUT_NAME close_fds
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_close_fds PRIVATE
|
|
|
|
sapi::base
|
|
|
|
${_sandbox2_linkopts}
|
|
|
|
absl::strings
|
|
|
|
absl::flat_hash_set
|
|
|
|
glog::glog
|
|
|
|
sandbox2::sanitizer
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-05-06 20:03:29 +08:00
|
|
|
# sandboxed_api/sandbox2/testcases:sleep
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_sleep
|
2019-05-06 20:03:29 +08:00
|
|
|
sleep.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_sleep ALIAS sandbox2_testcase_sleep)
|
|
|
|
set_target_properties(sandbox2_testcase_sleep PROPERTIES
|
|
|
|
OUTPUT_NAME sleep
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_sleep PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:symbolize
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_symbolize
|
2019-05-06 20:03:29 +08:00
|
|
|
symbolize.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_symbolize ALIAS sandbox2_testcase_symbolize)
|
|
|
|
set_target_properties(sandbox2_testcase_symbolize PROPERTIES
|
|
|
|
OUTPUT_NAME symbolize
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_symbolize PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
absl::core_headers
|
|
|
|
absl::strings
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::temp_file
|
|
|
|
sapi::strerror
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
|
|
|
sapi::raw_logging
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
2019-05-15 23:04:36 +08:00
|
|
|
# sandboxed_api/sandbox2/testcases:starve
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_starve
|
2019-05-15 23:04:36 +08:00
|
|
|
starve.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_starve ALIAS sandbox2_testcase_starve)
|
|
|
|
set_target_properties(sandbox2_testcase_starve PROPERTIES
|
|
|
|
OUTPUT_NAME starve
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_starve PRIVATE
|
2019-05-15 23:04:36 +08:00
|
|
|
sapi::base
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-05-06 20:03:29 +08:00
|
|
|
# sandboxed_api/sandbox2/testcases:tsync
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_tsync
|
2019-05-06 20:03:29 +08:00
|
|
|
tsync.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_tsync ALIAS sandbox2_testcase_tsync)
|
|
|
|
set_target_properties(sandbox2_testcase_tsync PROPERTIES
|
|
|
|
OUTPUT_NAME tsync
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_tsync PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::client
|
|
|
|
sandbox2::comms
|
2019-07-30 21:48:16 +08:00
|
|
|
sapi::base
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:hostname
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_hostname
|
2019-05-06 20:03:29 +08:00
|
|
|
hostname.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_hostname ALIAS sandbox2_testcase_hostname)
|
|
|
|
set_target_properties(sandbox2_testcase_hostname PROPERTIES
|
|
|
|
OUTPUT_NAME hostname
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_hostname PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:limits
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_limits
|
2019-05-06 20:03:29 +08:00
|
|
|
limits.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_limits ALIAS sandbox2_testcase_limits)
|
|
|
|
set_target_properties(sandbox2_testcase_limits PROPERTIES
|
|
|
|
OUTPUT_NAME limits
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_limits PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2/testcases:namespace
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_testcase_namespace
|
2019-05-06 20:03:29 +08:00
|
|
|
namespace.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2::testcase_namespace ALIAS sandbox2_testcase_namespace)
|
|
|
|
set_target_properties(sandbox2_testcase_namespace PROPERTIES
|
|
|
|
OUTPUT_NAME namespace
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_testcase_namespace PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
2020-12-15 01:15:40 +08:00
|
|
|
${_sandbox2_linkopts}
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|