sanitycheck: complain loudly about missing platforms

If defconfig files exist under boards/ that don't correspond to
the set of platforms defined in the .ini files under
scripts/sanity_chk/arches, complain about this. We should be at
least compiling all our supported platforms in CI runs.

At the moment it flags 5 boards. Future patches should either add
these boards to the appropriate arch .ini files or remove them
from the kernel.

Change-Id: Id825d6c6bd32089d9f1bead11bc0765685e3771a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
diff --git a/scripts/sanitycheck b/scripts/sanitycheck
index a326ab2..962de9b 100755
--- a/scripts/sanitycheck
+++ b/scripts/sanitycheck
@@ -1190,7 +1190,18 @@
                     self.arches[arch.name] = arch
                     self.platforms.extend(arch.platforms)
 
-
+        # Build up a list of boards based on the presence of
+        # boards/*/*_defconfig files. We want to make sure that the arch.ini
+        # files are not missing any boards
+        all_plats = [plat.name for plat in self.platforms]
+        for dirpath, dirnames, filenames in os.walk(os.path.join(ZEPHYR_BASE,
+                                                                 "boards")):
+            for filename in filenames:
+                if filename.endswith("_defconfig"):
+                    board_name = filename.replace("_defconfig", "")
+                    if board_name not in all_plats:
+                        error("Platform '%s' not specified in any arch .ini file and will not be tested"
+                                % board_name)
         self.instances = {}
 
     def get_last_failed(self):