summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml13
-rw-r--r--Makefile19
-rw-r--r--README14
-rwxr-xr-xruntests24
-rw-r--r--util/util.h8
5 files changed, 52 insertions, 26 deletions
diff --git a/.travis.yml b/.travis.yml
index b5a2a94..8b77c6b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -107,6 +107,7 @@ matrix:
addons:
apt:
sources:
+ - ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
packages:
- clang-4.0
@@ -116,11 +117,23 @@ matrix:
addons:
apt:
sources:
+ - ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- clang-5.0
env:
- MATRIX_EVAL="CC=clang-5.0 CXX=clang++-5.0"
+ - os: linux
+ addons:
+ apt:
+ sources:
+ - ubuntu-toolchain-r-test
+ - sourceline: 'deb https://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main'
+ key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
+ packages:
+ - clang-6.0
+ env:
+ - MATRIX_EVAL="CC=clang-6.0 CXX=clang++-6.0"
before_install:
- eval "${MATRIX_EVAL}"
diff --git a/Makefile b/Makefile
index 1c04cb9..6836e06 100644
--- a/Makefile
+++ b/Makefile
@@ -246,22 +246,13 @@ testofiles: $(TESTOFILES)
test: $(DTESTS) $(TESTS) $(STESTS) debug-test static-test shared-test
debug-test: $(DTESTS)
- @echo
- @echo Running debug binary tests.
- @echo
@./runtests $(DTESTS)
static-test: $(TESTS)
- @echo
- @echo Running static binary tests.
- @echo
@./runtests $(TESTS)
shared-test: $(STESTS)
- @echo
- @echo Running dynamic binary tests.
- @echo
- @LD_LIBRARY_PATH=obj/so:$(LD_LIBRARY_PATH) ./runtests $(STESTS)
+ @./runtests -shared-library-path obj/so $(STESTS)
debug-bigtest: $(DTESTS) $(DBIGTESTS)
@./runtests $(DTESTS) $(DBIGTESTS)
@@ -270,7 +261,7 @@ static-bigtest: $(TESTS) $(BIGTESTS)
@./runtests $(TESTS) $(BIGTESTS)
shared-bigtest: $(STESTS) $(SBIGTESTS)
- @LD_LIBRARY_PATH=obj/so:$(LD_LIBRARY_PATH) ./runtests $(STESTS) $(SBIGTESTS)
+ @./runtests -shared-library-path obj/so $(STESTS) $(SBIGTESTS)
benchmark: obj/test/regexp_benchmark
@@ -314,7 +305,11 @@ shared-testinstall:
@mkdir -p obj
@cp testinstall.cc obj
(cd obj && $(CXX) testinstall.cc -o testinstall $(CXXFLAGS) $(LDFLAGS))
- LD_LIBRARY_PATH=$(DESTDIR)$(libdir) obj/testinstall
+ifeq ($(shell uname),Darwin)
+ DYLD_LIBRARY_PATH="$(DESTDIR)$(libdir):$(DYLD_LIBRARY_PATH)" obj/testinstall
+else
+ LD_LIBRARY_PATH="$(DESTDIR)$(libdir):$(LD_LIBRARY_PATH)" obj/testinstall
+endif
benchlog: obj/test/regexp_benchmark
(echo '==BENCHMARK==' `hostname` `date`; \
diff --git a/README b/README
index 5d8d2ae..681d6d7 100644
--- a/README
+++ b/README
@@ -28,11 +28,11 @@ under the BSD-style license found in the LICENSE file.
RE2's native language is C++.
A C wrapper is at https://github.com/marcomaggi/cre2/.
-An Erlang wrapper is at https://github.com/tuncer/re2/.
+An Erlang wrapper is at https://github.com/tuncer/re2/ and on Hex (hex.pm).
An Inferno wrapper is at https://github.com/powerman/inferno-re2/.
-A Node.js wrapper is at https://github.com/uhop/node-re2/ and on NPM.
-An OCaml wrapper is at https://github.com/janestreet/re2/ and on OPAM.
-A Perl wrapper is at https://github.com/dgl/re-engine-RE2/ and on CPAN.
-A Python wrapper is at https://github.com/facebook/pyre2/.
-An R wrapper is at https://github.com/qinwf/re2r/.
-A Ruby wrapper is at https://github.com/mudge/re2/.
+A Node.js wrapper is at https://github.com/uhop/node-re2/ and on NPM (npmjs.com).
+An OCaml wrapper is at https://github.com/janestreet/re2/ and on OPAM (opam.ocaml.org).
+A Perl wrapper is at https://github.com/dgl/re-engine-RE2/ and on CPAN (cpan.org).
+A Python wrapper is at https://github.com/facebook/pyre2/ and on PyPI (pypi.org).
+An R wrapper is at https://github.com/qinwf/re2r/ and on CRAN (cran.r-project.org).
+A Ruby wrapper is at https://github.com/mudge/re2/ and on RubyGems (rubygems.org).
diff --git a/runtests b/runtests
index 2852244..94584a6 100755
--- a/runtests
+++ b/runtests
@@ -1,11 +1,22 @@
#!/usr/bin/env sh
+# System Integrity Protection on Darwin complicated these matters somewhat.
+# See https://github.com/google/re2/issues/175 for details.
+if [ "x$1" = "x-shared-library-path" ]; then
+ if [ "x$(uname)" = "xDarwin" ]; then
+ DYLD_LIBRARY_PATH="$2:$DYLD_LIBRARY_PATH"
+ export DYLD_LIBRARY_PATH
+ else
+ LD_LIBRARY_PATH="$2:$LD_LIBRARY_PATH"
+ export LD_LIBRARY_PATH
+ fi
+ shift 2
+fi
+
success=true
-for i
-do
+for i; do
printf "%-40s" $i
- if $($i >$i.log 2>&1) 2>/dev/null
- then
+ if $($i >$i.log 2>&1) 2>/dev/null; then
echo PASS
else
echo FAIL';' output in $i.log
@@ -16,6 +27,7 @@ done
if $success; then
echo 'ALL TESTS PASSED.'
exit 0
+else
+ echo 'TESTS FAILED.'
+ exit 1
fi
-echo 'TESTS FAILED.'
-exit 1
diff --git a/util/util.h b/util/util.h
index a69d842..64a3e0e 100644
--- a/util/util.h
+++ b/util/util.h
@@ -12,7 +12,13 @@ using std::string;
#define arraysize(array) (int)(sizeof(array)/sizeof((array)[0]))
#ifndef FALLTHROUGH_INTENDED
-#define FALLTHROUGH_INTENDED do { } while (0)
+#if defined(__clang__)
+#define FALLTHROUGH_INTENDED [[clang::fallthrough]]
+#elif defined(__GNUC__)
+#define FALLTHROUGH_INTENDED [[gnu::fallthrough]]
+#else
+#define FALLTHROUGH_INTENDED do {} while (0)
+#endif
#endif
#ifndef NO_THREAD_SAFETY_ANALYSIS