[llvm] bc1773f - [yamls2obj][test] - Make the Archives/regular.yaml test stricter.

Georgii Rymar via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 07:04:56 PDT 2020


Author: Georgii Rymar
Date: 2020-10-28T17:04:08+03:00
New Revision: bc1773f5b5e90e5fab3202768e516e145881666f

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

LOG: [yamls2obj][test] - Make the Archives/regular.yaml test stricter.

In rG6d656c9691d4 I had to relax the check from

`CONTENT: 21 3c 61 72 63 68 3e 0a 12{{$}}`

to

`CONTENT: 21 3c 61 72 63 68 3e 0a 12`

to fix the FreeBSD bot quickly: http://lab.llvm.org:8011/#/builders/28/builds/547

It turns out that "od" prints a trailing white space on FreeBSD, that is
why EOL mark ({{$}}) can't be used. But we still want to check the output size.

This patch adds a check of output size with "wc -c", similar to how it is done
below in the same test. This restores the original strictness.

Added: 
    

Modified: 
    llvm/test/tools/yaml2obj/Archives/regular.yaml

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/yaml2obj/Archives/regular.yaml b/llvm/test/tools/yaml2obj/Archives/regular.yaml
index 6ab2b67d4412..2cb489d60e96 100644
--- a/llvm/test/tools/yaml2obj/Archives/regular.yaml
+++ b/llvm/test/tools/yaml2obj/Archives/regular.yaml
@@ -21,10 +21,14 @@ Members: [[MEMBERS=<none>]]
 
 ## BOTH: error: "Content" and "Members" cannot be used together
 
+## Check we can use the "Content" key alone.
+
 # RUN: yaml2obj --docnum=1 -DCONTENT="12" %s -o %t.content.a
+# RUN: wc -c < %t.content.a | FileCheck %s --check-prefix=CONTENT-SIZE
 # RUN: od -t x1 -v %t.content.a | FileCheck %s --ignore-case --check-prefix=CONTENT
 
-# CONTENT: 21 3c 61 72 63 68 3e 0a 12
+# CONTENT-SIZE: 9{{$}}
+#      CONTENT: 21 3c 61 72 63 68 3e 0a 12
 
 ## Check we can specify magic bytes of size greater than the normal size (size of "!<arch>\n").
 


        


More information about the llvm-commits mailing list