Merge "Add ftrace_proto_gen_unittests to ci"
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
new file mode 100644
index 0000000..3afea72
--- /dev/null
+++ b/PRESUBMIT.py
@@ -0,0 +1,29 @@
+# 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.
+
+def CheckChange(input, output):
+    results = []
+    results += input.canned_checks.CheckDoNotSubmit(input, output)
+    results += input.canned_checks.CheckChangeHasNoTabs(input, output)
+    results += input.canned_checks.CheckLongLines(input, output, 80)
+    results += input.canned_checks.CheckPatchFormatted(input, output)
+    results += input.canned_checks.CheckGNFormatted(input, output)
+    return results
+
+def CheckChangeOnUpload(input_api, output_api):
+    return CheckChange(input_api, output_api)
+
+def CheckChangeOnCommit(input_api, output_api):
+    return CheckChange(input_api, output_api)
+
diff --git a/build/proto_library.gni b/build/proto_library.gni
index 5ecc80c..c13d3f2 100644
--- a/build/proto_library.gni
+++ b/build/proto_library.gni
@@ -144,6 +144,7 @@
                            [
                              "defines",
                              "include_dirs",
+                             "public_configs",
                              "testonly",
                              "visibility",
                            ])
@@ -155,7 +156,11 @@
       configs += invoker.extra_configs
     }
 
-    public_configs = [
+    if (!defined(invoker.public_configs)) {
+      public_configs = []
+    }
+
+    public_configs += [
       "//buildtools:protobuf_gen_config",
       ":$config_name",
     ]
diff --git a/protozero/protozero_library.gni b/protozero/protozero_library.gni
index 324df6e..83818b7 100644
--- a/protozero/protozero_library.gni
+++ b/protozero/protozero_library.gni
@@ -23,6 +23,7 @@
     generator_plugin_label = "//protozero/src/protoc_plugin"
     generator_plugin_suffix = ".pbzero"
     generator_plugin_options = "wrapper_namespace=pbzero"
+    public_configs = [ "//protozero:protozero_config" ]
     forward_variables_from(invoker,
                            [
                              "defines",
diff --git a/tools/sanitizers_unittests/README.md b/tools/sanitizers_unittests/README.md
index 19c1dfd..81900e5 100644
--- a/tools/sanitizers_unittests/README.md
+++ b/tools/sanitizers_unittests/README.md
@@ -2,6 +2,5 @@
 ---------------------------
 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.
+work and spot violations, rather than unconditionally succeeding if we mess up
+the build config.