Move sanitizers_unittests under tools and add README
The sanitizers unittests are not specific to libtracing.
It makes more sense for them to be under tools/.
Change-Id: I6fbb7e9c289039a1e866d044c5fe3b8b6e1eec07
diff --git a/BUILD.gn b/BUILD.gn
index b2c899c..627e062 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -29,7 +29,7 @@
"//libftrace:libftrace_unittests",
"//libtracing:libtracing_benchmarks",
"//libtracing:libtracing_unittests",
- "//libtracing:sanitizers_unittests",
"//tools/ftrace_proto_gen:ftrace_proto_gen_unittests",
+ "//tools/sanitizers_unittests",
]
}
diff --git a/libtracing/BUILD.gn b/libtracing/BUILD.gn
index 3e5f202..6cb3af4 100644
--- a/libtracing/BUILD.gn
+++ b/libtracing/BUILD.gn
@@ -33,14 +33,3 @@
"hello_world_benchmark.cc",
]
}
-
-executable("sanitizers_unittests") {
- testonly = true
- deps += [
- "//buildtools:gtest",
- "//buildtools:gtest_main",
- ]
- sources = [
- "sanitizers_unittest.cc",
- ]
-}
diff --git a/tools/sanitizers_unittests/BUILD.gn b/tools/sanitizers_unittests/BUILD.gn
new file mode 100644
index 0000000..62925b1
--- /dev/null
+++ b/tools/sanitizers_unittests/BUILD.gn
@@ -0,0 +1,24 @@
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+executable("sanitizers_unittests") {
+ testonly = true
+ deps += [
+ "//buildtools:gtest",
+ "//buildtools:gtest_main",
+ ]
+ sources = [
+ "sanitizers_unittest.cc",
+ ]
+}
diff --git a/tools/sanitizers_unittests/README.md b/tools/sanitizers_unittests/README.md
new file mode 100644
index 0000000..19c1dfd
--- /dev/null
+++ b/tools/sanitizers_unittests/README.md
@@ -0,0 +1,7 @@
+LLVM sanitizers smoke tests
+---------------------------
+The only purpose of this binary is to verify that the various build configs for
+sanitizers (`is_asan`, `is_lsan`, `is_msan`, `is_tsan`, `is_ubsan`) do actually
+work and spot violations, rather than unconditionally succeeding.
+All the test fixtures in `sanitizers_unittests` are expected to fail under their
+corresponding sanitizer configuration. A green test means failure here.
diff --git a/libtracing/sanitizers_unittest.cc b/tools/sanitizers_unittests/sanitizers_unittest.cc
similarity index 100%
rename from libtracing/sanitizers_unittest.cc
rename to tools/sanitizers_unittests/sanitizers_unittest.cc