From a132154c188e2b895cb9674c95b856af278aaaee Mon Sep 17 00:00:00 2001
From: Simran Basi <sbasi@google.com>
Date: Tue, 6 Feb 2018 15:15:06 -0800
Subject: [PATCH] build: Default test modules to null-suite

The LOCAL_COMPATIBILITY_SUITE tag is used to package tests and
auto-generate test configs for use in the test infrastructure
and locally by atest.

Rather than update hundreds of makefiles across the tree, this
change adds significant atest support to many unittests.

Bug: 73000943, 72969679, 71510529
Test: `atest NotificationStressTests` works as expected.
Change-Id: I1b0a779b8366aee4b4df98181267f72fcb68916a
---
 core/base_rules.mk | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/core/base_rules.mk b/core/base_rules.mk
index 3ff3bd3f2..9d7daa000 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -494,6 +494,17 @@ endif
 endif
 endif
 
+# For modules tagged as tests but lacking a suite tag, set null-suite as the default.
+# We only support adding a default suite to native tests, native benchmarks, and instrumentation tests.
+# This is because they are the only tests we currently auto-generate test configs for.
+ifneq ($(filter $(my_module_tags),tests),)
+ifndef LOCAL_COMPATIBILITY_SUITE
+ifneq ($(filter NATIVE_TESTS NATIVE_BENCHMARK APPS, $(LOCAL_MODULE_CLASS)),)
+LOCAL_COMPATIBILITY_SUITE := null-suite
+endif
+endif
+endif
+
 ###########################################################
 ## Compatibility suite files.
 ###########################################################