[Mlir-commits] [mlir] 4e7c0a3 - Update MLIR generate-test-checks.py to add the notice from the source into the generated file

Mehdi Amini llvmlistbot at llvm.org
Mon Sep 20 16:20:11 PDT 2021


Author: Mehdi Amini
Date: 2021-09-20T23:19:40Z
New Revision: 4e7c0a37c9c92baa655d244f5bfde91d52b138d0

URL: https://github.com/llvm/llvm-project/commit/4e7c0a37c9c92baa655d244f5bfde91d52b138d0
DIFF: https://github.com/llvm/llvm-project/commit/4e7c0a37c9c92baa655d244f5bfde91d52b138d0.diff

LOG: Update MLIR generate-test-checks.py to add the notice from the source into the generated file

Folks may not read the source of the tool and miss these instructions.

Differential Revision: https://reviews.llvm.org/D110082

Added: 
    

Modified: 
    mlir/utils/generate-test-checks.py

Removed: 
    


################################################################################
diff  --git a/mlir/utils/generate-test-checks.py b/mlir/utils/generate-test-checks.py
index f6197554eaa79..474f812c9c0bc 100755
--- a/mlir/utils/generate-test-checks.py
+++ b/mlir/utils/generate-test-checks.py
@@ -32,7 +32,14 @@
 import re
 import sys
 
-ADVERT = '// NOTE: Assertions have been autogenerated by '
+ADVERT_BEGIN = '// NOTE: Assertions have been autogenerated by '
+ADVERT_END = """
+// The script is designed to make adding checks to
+// a test case fast, it is *not* designed to be authoritative
+// about what constitutes a good test! The CHECK should be
+// minimized and named to reflect the test intent.
+"""
+
 
 # Regex command to match an SSA identifier.
 SSA_RE_STR = '[0-9]+|[a-zA-Z$._-][a-zA-Z0-9$._-]*'
@@ -172,7 +179,7 @@ def main():
 
   # Generate a note used for the generated check file.
   script_name = os.path.basename(__file__)
-  autogenerated_note = (ADVERT + 'utils/' + script_name)
+  autogenerated_note = (ADVERT_BEGIN + 'utils/' + script_name + "\n" + ADVERT_END)
 
   source_segments = None
   if args.source:


        


More information about the Mlir-commits mailing list