diff --git a/scripts/patchtest b/scripts/patchtest
index 6dbb5adb15..e8ace03905 100755
--- a/scripts/patchtest
+++ b/scripts/patchtest
@@ -167,6 +167,17 @@ def main():
         logger.error("patchtest: there are uncommitted changes in the target repo that would be overwritten. Please commit or restore them before running patchtest")
         return 1
 
+    builddir = os.environ.get('BUILDDIR')
+    if builddir:
+        bblayers_conf = os.path.join(builddir, 'conf', 'bblayers.conf')
+        if os.path.exists(bblayers_conf):
+            with open(bblayers_conf) as f:
+                if 'meta-selftest' not in f.read():
+                    logger.error(
+                        "patchtest: meta-selftest layer not found in %s - add it to BBLAYERS before running patchtest" % bblayers_conf
+                    )
+                    return 1
+
     if os.path.isdir(patch_path):
         patch_list = [os.path.join(patch_path, f) for f in sorted(os.listdir(patch_path))]
     else:
