blob: 1e2d19ce9c9c5588d08ff9b0ab4cbc66aa735f8a [file] [log] [blame]
Paul Wankadiaf3a95882015-09-26 03:21:18 +10001# Copyright 2009 The RE2 Authors. All Rights Reserved.
2# Use of this source code is governed by a BSD-style
3# license that can be found in the LICENSE file.
4
Paul Wankadiaa96b4642015-04-27 20:29:47 +10005# Bazel (http://bazel.io/) BUILD file for RE2.
Ming Zhaodd223322015-04-21 11:41:18 -07006
7licenses(["notice"])
8
Shahms King63e4dbd2016-03-04 10:45:44 -08009exports_files(["LICENSE"])
10
Ming Zhaodd223322015-04-21 11:41:18 -070011cc_library(
Paul Wankadiaa96b4642015-04-27 20:29:47 +100012 name = "re2",
13 srcs = [
14 "re2/bitstate.cc",
15 "re2/compile.cc",
16 "re2/dfa.cc",
17 "re2/filtered_re2.cc",
18 "re2/mimics_pcre.cc",
19 "re2/nfa.cc",
20 "re2/onepass.cc",
21 "re2/parse.cc",
22 "re2/perl_groups.cc",
23 "re2/prefilter.cc",
24 "re2/prefilter.h",
25 "re2/prefilter_tree.cc",
26 "re2/prefilter_tree.h",
27 "re2/prog.cc",
28 "re2/prog.h",
29 "re2/re2.cc",
30 "re2/regexp.cc",
31 "re2/regexp.h",
32 "re2/set.cc",
33 "re2/simplify.cc",
Paul Wankadia791beff2015-11-17 00:15:44 +110034 "re2/stringpiece.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100035 "re2/tostring.cc",
36 "re2/unicode_casefold.cc",
37 "re2/unicode_casefold.h",
38 "re2/unicode_groups.cc",
39 "re2/unicode_groups.h",
40 "re2/walker-inl.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100041 "util/flags.h",
42 "util/hash.cc",
Paul Wankadia7e482002015-10-24 12:17:07 +110043 "util/logging.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100044 "util/logging.h",
45 "util/mutex.h",
46 "util/rune.cc",
47 "util/sparse_array.h",
48 "util/sparse_set.h",
49 "util/stringprintf.cc",
50 "util/strutil.cc",
51 "util/utf.h",
52 "util/util.h",
53 "util/valgrind.cc",
54 "util/valgrind.h",
55 ],
56 hdrs = [
57 "re2/filtered_re2.h",
58 "re2/re2.h",
59 "re2/set.h",
Paul Wankadia791beff2015-11-17 00:15:44 +110060 "re2/stringpiece.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100061 "re2/variadic_function.h",
62 ],
Paul Wankadia46d730b2016-01-03 17:38:22 +110063 copts = ["-pthread"],
Paul Wankadiaa96b4642015-04-27 20:29:47 +100064 includes = ["."],
65 linkopts = ["-pthread"],
66 visibility = ["//visibility:public"],
Ming Zhaodd223322015-04-21 11:41:18 -070067)
68
Ming Zhaodd223322015-04-21 11:41:18 -070069cc_library(
Paul Wankadiaa96b4642015-04-27 20:29:47 +100070 name = "test",
71 testonly = 1,
72 srcs = [
73 "re2/testing/backtrack.cc",
74 "re2/testing/dump.cc",
Paul Wankadiaf3a95882015-09-26 03:21:18 +100075 "re2/testing/exhaustive_tester.cc",
76 "re2/testing/null_walker.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100077 "re2/testing/regexp_generator.cc",
78 "re2/testing/string_generator.cc",
79 "re2/testing/tester.cc",
80 "util/pcre.cc",
81 "util/random.cc",
82 "util/test.cc",
Paul Wankadiaf3a95882015-09-26 03:21:18 +100083 "util/thread.cc",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100084 ],
85 hdrs = [
Paul Wankadiaf3a95882015-09-26 03:21:18 +100086 "re2/testing/exhaustive_tester.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100087 "re2/testing/regexp_generator.h",
88 "re2/testing/string_generator.h",
89 "re2/testing/tester.h",
90 "util/pcre.h",
91 "util/random.h",
92 "util/test.h",
Paul Wankadiaf3a95882015-09-26 03:21:18 +100093 "util/thread.h",
Paul Wankadiaa96b4642015-04-27 20:29:47 +100094 ],
95 includes = ["."],
Paul Wankadia791beff2015-11-17 00:15:44 +110096 deps = [":re2"],
Ming Zhaodd223322015-04-21 11:41:18 -070097)
98
99load("re2_test", "re2_test")
100
101re2_test("charclass_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800102
Ming Zhaodd223322015-04-21 11:41:18 -0700103re2_test("compile_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800104
Ming Zhaodd223322015-04-21 11:41:18 -0700105re2_test("filtered_re2_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800106
Ming Zhaodd223322015-04-21 11:41:18 -0700107re2_test("mimics_pcre_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800108
Ming Zhaodd223322015-04-21 11:41:18 -0700109re2_test("parse_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800110
Ming Zhaodd223322015-04-21 11:41:18 -0700111re2_test("possible_match_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800112
Ming Zhaodd223322015-04-21 11:41:18 -0700113re2_test("re2_arg_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800114
Paul Wankadia1add8042016-02-09 20:37:03 +1100115re2_test("re2_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800116
Ming Zhaodd223322015-04-21 11:41:18 -0700117re2_test("regexp_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800118
Ming Zhaodd223322015-04-21 11:41:18 -0700119re2_test("required_prefix_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800120
Ming Zhaodd223322015-04-21 11:41:18 -0700121re2_test("search_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800122
Ming Zhaodd223322015-04-21 11:41:18 -0700123re2_test("set_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800124
Ming Zhaodd223322015-04-21 11:41:18 -0700125re2_test("simplify_test")
Shahms King63e4dbd2016-03-04 10:45:44 -0800126
Ming Zhaodd223322015-04-21 11:41:18 -0700127re2_test("string_generator_test")
128
Shahms King63e4dbd2016-03-04 10:45:44 -0800129re2_test(
130 "dfa_test",
131 size = "large",
132)
133
134re2_test(
135 "exhaustive1_test",
136 size = "large",
137)
138
139re2_test(
140 "exhaustive2_test",
141 size = "large",
142)
143
144re2_test(
145 "exhaustive3_test",
146 size = "large",
147)
148
149re2_test(
150 "exhaustive_test",
151 size = "large",
152)
153
154re2_test(
155 "random_test",
156 size = "large",
157)
Paul Wankadiaf3a95882015-09-26 03:21:18 +1000158
159# TODO: Add support for regexp_benchmark.