2020-03-12 20:20:54 +08:00
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
|
|
|
|
|
2022-01-12 05:28:53 +08:00
|
|
|
package(features = ["layering_check"])
|
|
|
|
|
2018-01-18 23:14:50 +08:00
|
|
|
cc_library(
|
2018-07-17 06:46:02 +08:00
|
|
|
name = "check_compat",
|
2018-01-18 23:14:50 +08:00
|
|
|
testonly = True,
|
2018-07-17 06:46:02 +08:00
|
|
|
hdrs = ["check_compat.h"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
2022-01-26 03:25:36 +08:00
|
|
|
name = "auto_test_support",
|
2018-07-17 06:46:02 +08:00
|
|
|
testonly = True,
|
2022-01-26 03:25:36 +08:00
|
|
|
srcs = ["auto_test_support.c"],
|
|
|
|
hdrs = ["auto_test_support.h"],
|
|
|
|
deps = [
|
|
|
|
":check_compat",
|
|
|
|
"//c-toxcore/testing:misc_tools",
|
|
|
|
"//c-toxcore/toxcore:Messenger",
|
|
|
|
"//c-toxcore/toxcore:mono_time",
|
2022-02-12 21:38:00 +08:00
|
|
|
"//c-toxcore/toxcore:tox",
|
2022-01-26 03:25:36 +08:00
|
|
|
],
|
2018-01-18 23:14:50 +08:00
|
|
|
)
|
|
|
|
|
2019-11-17 08:24:02 +08:00
|
|
|
flaky_tests = {
|
|
|
|
"crypto_core_test": True,
|
|
|
|
"lan_discovery_test": True,
|
2021-12-15 18:58:12 +08:00
|
|
|
"save_load_test": True,
|
|
|
|
"tox_many_tcp_test": True,
|
2019-11-17 08:24:02 +08:00
|
|
|
}
|
|
|
|
|
2023-11-08 01:46:36 +08:00
|
|
|
extra_args = {
|
|
|
|
"proxy_test": ["$(location //c-toxcore/other/proxy)"],
|
|
|
|
}
|
|
|
|
|
|
|
|
extra_data = {
|
|
|
|
"proxy_test": ["//c-toxcore/other/proxy"],
|
|
|
|
}
|
|
|
|
|
2018-01-18 23:14:50 +08:00
|
|
|
[cc_test(
|
|
|
|
name = src[:-2],
|
2020-03-27 18:27:03 +08:00
|
|
|
size = "small",
|
2018-01-18 23:14:50 +08:00
|
|
|
srcs = [src],
|
2023-11-08 01:46:36 +08:00
|
|
|
args = ["$(location %s)" % src] + extra_args.get(
|
|
|
|
src[:-2],
|
|
|
|
[],
|
|
|
|
),
|
|
|
|
data = glob(["data/*"]) + extra_data.get(
|
|
|
|
src[:-2],
|
|
|
|
[],
|
|
|
|
),
|
2020-03-01 00:01:08 +08:00
|
|
|
flaky = flaky_tests.get(
|
|
|
|
src[:-2],
|
|
|
|
False,
|
|
|
|
),
|
2018-01-18 23:14:50 +08:00
|
|
|
deps = [
|
2022-01-26 03:25:36 +08:00
|
|
|
":auto_test_support",
|
2022-01-28 07:38:58 +08:00
|
|
|
":check_compat",
|
2018-01-18 23:14:50 +08:00
|
|
|
"//c-toxcore/testing:misc_tools",
|
|
|
|
"//c-toxcore/toxav",
|
2022-09-22 21:36:19 +08:00
|
|
|
"//c-toxcore/toxcore:Messenger",
|
2022-01-16 06:10:23 +08:00
|
|
|
"//c-toxcore/toxcore:TCP_client",
|
|
|
|
"//c-toxcore/toxcore:TCP_common",
|
2022-01-12 05:28:53 +08:00
|
|
|
"//c-toxcore/toxcore:TCP_connection",
|
2022-01-16 06:10:23 +08:00
|
|
|
"//c-toxcore/toxcore:TCP_server",
|
2020-12-31 08:00:00 +08:00
|
|
|
"//c-toxcore/toxcore:announce",
|
2022-01-12 05:28:53 +08:00
|
|
|
"//c-toxcore/toxcore:ccompat",
|
|
|
|
"//c-toxcore/toxcore:crypto_core",
|
2020-12-31 08:00:00 +08:00
|
|
|
"//c-toxcore/toxcore:forwarding",
|
2022-01-12 05:28:53 +08:00
|
|
|
"//c-toxcore/toxcore:friend_connection",
|
|
|
|
"//c-toxcore/toxcore:logger",
|
|
|
|
"//c-toxcore/toxcore:mono_time",
|
|
|
|
"//c-toxcore/toxcore:net_crypto",
|
|
|
|
"//c-toxcore/toxcore:network",
|
|
|
|
"//c-toxcore/toxcore:onion",
|
|
|
|
"//c-toxcore/toxcore:onion_announce",
|
|
|
|
"//c-toxcore/toxcore:onion_client",
|
2022-02-12 21:38:00 +08:00
|
|
|
"//c-toxcore/toxcore:tox",
|
2022-02-07 00:41:31 +08:00
|
|
|
"//c-toxcore/toxcore:tox_dispatch",
|
|
|
|
"//c-toxcore/toxcore:tox_events",
|
2022-03-04 04:15:09 +08:00
|
|
|
"//c-toxcore/toxcore:util",
|
2018-01-22 00:58:32 +08:00
|
|
|
"//c-toxcore/toxencryptsave",
|
2022-01-12 05:28:53 +08:00
|
|
|
"@libsodium",
|
|
|
|
"@libvpx",
|
2018-01-18 23:14:50 +08:00
|
|
|
],
|
2020-04-20 08:16:33 +08:00
|
|
|
) for src in glob(["*_test.c"])]
|