chore: Mark unsafe code as testonly.

We want to ensure that nobody links against testing code in production.
This commit is contained in:
iphydf 2022-01-16 02:02:53 +00:00
parent f52bc798c8
commit 044ae636a3
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
3 changed files with 12 additions and 0 deletions

View File

@ -13,6 +13,7 @@ cc_library(
cc_binary(
name = "DHT_bootstrap",
testonly = 1,
srcs = ["DHT_bootstrap.c"],
deps = [
"//c-toxcore/testing:misc_tools",

View File

@ -4,6 +4,7 @@ package(features = ["layering_check"])
#cc_binary(
# name = "cracker",
# testonly = 1,
# srcs = ["cracker.c"],
# copts = ["-fopenmp"],
# linkopts = ["-fopenmp"],
@ -15,6 +16,7 @@ package(features = ["layering_check"])
cc_binary(
name = "cracker_simple",
testonly = 1,
srcs = ["cracker_simple.c"],
deps = [
"//c-toxcore/testing:misc_tools",
@ -25,6 +27,7 @@ cc_binary(
cc_binary(
name = "minimal-save-generator",
testonly = 1,
srcs = ["minimal-save-generator.c"],
deps = [
"//c-toxcore/toxcore:ccompat",
@ -34,6 +37,7 @@ cc_binary(
cc_binary(
name = "sign",
testonly = 1,
srcs = ["sign.c"],
copts = ["-w"],
deps = [
@ -45,6 +49,7 @@ cc_binary(
cc_binary(
name = "strkey",
testonly = 1,
srcs = ["strkey.c"],
copts = ["-w"],
deps = [
@ -56,6 +61,7 @@ cc_binary(
cc_binary(
name = "save-generator",
testonly = 1,
srcs = ["save-generator.c"],
deps = [
"//c-toxcore/testing:misc_tools",

View File

@ -22,6 +22,7 @@ sh_test(
cc_library(
name = "misc_tools",
testonly = 1,
srcs = ["misc_tools.c"],
hdrs = ["misc_tools.h"],
visibility = ["//c-toxcore:__subpackages__"],
@ -34,6 +35,7 @@ cc_library(
cc_library(
name = "trace",
testonly = 1,
srcs = ["trace.cc"],
visibility = ["//c-toxcore:__subpackages__"],
alwayslink = True,
@ -41,6 +43,7 @@ cc_library(
cc_binary(
name = "DHT_test",
testonly = 1,
srcs = ["DHT_test.c"],
deps = [
":misc_tools",
@ -53,6 +56,7 @@ cc_binary(
cc_binary(
name = "Messenger_test",
testonly = 1,
srcs = ["Messenger_test.c"],
deps = [
":misc_tools",
@ -63,6 +67,7 @@ cc_binary(
cc_binary(
name = "random_testing",
testonly = 1,
srcs = ["random_testing.cc"],
deps = [
":misc_tools",