blob: 503a29ffd53d16a21c96038d1d7ee57fecf7a2de [file] [log] [blame]
Brian Silvermana8ae8e92018-07-07 15:33:10 -07001licenses(["notice"])
2
3_copts = [
4 "-fno-strict-aliasing",
5 "-Wall",
6 "-Wcast-align",
7 "-Wconversion",
8 "-Wctor-dtor-privacy",
9 "-Werror",
10 "-Wextra",
11 "-Wno-missing-braces",
12 "-Wnon-virtual-dtor",
13 "-Wold-style-cast",
14 "-Woverloaded-virtual",
15 "-Wpedantic",
16 "-Wshadow",
17 "-Wsign-conversion",
18]
19
20[cc_test(
21 name = filename[:-5],
22 srcs = [filename],
23 copts = _copts + [
24 "-DNO_SELFTEST=true",
25 "-fexceptions",
26 "-frtti",
27 "-DGSL_THROW_ON_CONTRACT_VIOLATION",
28 ],
29 deps = [
30 ":test",
31 "//third_party/Catch2",
32 "//third_party/GSL",
33 ],
34) for filename in glob(
35 include = ["*_tests.cpp"],
36 exclude = ["no_exception*"],
37)]
38
39[cc_test(
40 name = filename[:-5],
41 srcs = [filename],
42 copts = _copts + [
43 "-DGSL_TERMINATE_ON_CONTRACT_VIOLATION",
44 ],
45 deps = [
46 ":test",
47 "//third_party/Catch2",
48 "//third_party/GSL",
49 ],
50) for filename in glob(["no_exception*_tests.cpp"])]
51
52cc_library(
53 name = "test",
54 srcs = ["test.cpp"],
55 copts = _copts + [
56 "-DNO_SELFTEST=true",
57 "-fexceptions",
58 "-frtti",
59 "-DGSL_THROW_ON_CONTRACT_VIOLATION",
60 ],
61 deps = [
62 "//third_party/Catch2",
63 "//third_party/GSL",
64 ],
65)