diff options
author | James Henderson <jh7370@my.bristol.ac.uk> | 2019-08-12 11:36:11 +0000 |
---|---|---|
committer | James Henderson <jh7370@my.bristol.ac.uk> | 2019-08-12 11:36:11 +0000 |
commit | f23ce128fd614d5ed7b5c70038c5db8b257c5127 (patch) | |
tree | d3ab7548147936d4d4057564f569c0fc47426948 /llvm/test/tools/llvm-strings/radix.test | |
parent | ccdad6ef486a00ed815ead642d2f62d87d86ee90 (diff) | |
download | bcm5719-llvm-f23ce128fd614d5ed7b5c70038c5db8b257c5127.tar.gz bcm5719-llvm-f23ce128fd614d5ed7b5c70038c5db8b257c5127.zip |
[llvm-strings] Improve testing of llvm-strings
This patch tidies up the llvm-strings testing by:
1. Adding comments to every test.
2. Getting rid of canned input files, and having the tests generate
them on the fly (this makes the tests self-contained).
3. Adding missing test coverage.
4. Renaming some tests that weren't clear as to their purpose.
5. Adding extra checking of various cases, formatting etc.
6. Removing a test that didn't seem to have any useful purpose for
testing llvm-strings.
Reviewed by: rupprecht, grimar, MaskRay
Differential Revision: https://reviews.llvm.org/D66015
llvm-svn: 368555
Diffstat (limited to 'llvm/test/tools/llvm-strings/radix.test')
-rw-r--r-- | llvm/test/tools/llvm-strings/radix.test | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/llvm/test/tools/llvm-strings/radix.test b/llvm/test/tools/llvm-strings/radix.test index 403b8580805..d23fb3cddc8 100644 --- a/llvm/test/tools/llvm-strings/radix.test +++ b/llvm/test/tools/llvm-strings/radix.test @@ -1,7 +1,29 @@ -RUN: llvm-strings %S/Inputs/numbers | FileCheck %s -check-prefix CHECK-NONE -RUN: llvm-strings -t d %S/Inputs/numbers | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace -RUN: llvm-strings -t o %S/Inputs/numbers | FileCheck %s -check-prefix CHECK-OCT --strict-whitespace -RUN: llvm-strings -t x %S/Inputs/numbers | FileCheck %s -check-prefix CHECK-HEX --strict-whitespace +## Show that llvm-strings can handle the -t/--radix switch properly. + +RUN: echo one > %t +RUN: echo two >> %t +RUN: echo three >> %t +RUN: echo four >> %t +RUN: echo five >> %t +RUN: echo six >> %t +RUN: echo seven >> %t +RUN: echo eight >> %t +RUN: echo nine >> %t +RUN: echo ten >> %t + +RUN: llvm-strings %t | FileCheck %s -check-prefix CHECK-NONE --implicit-check-not={{.}} +RUN: llvm-strings -t d %t | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace --implicit-check-not={{.}} +RUN: llvm-strings -t o %t | FileCheck %s -check-prefix CHECK-OCT --strict-whitespace --implicit-check-not={{.}} +RUN: llvm-strings -t x %t | FileCheck %s -check-prefix CHECK-HEX --strict-whitespace --implicit-check-not={{.}} + +## Show --radix works too. +RUN: llvm-strings --radix d %t | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace +RUN: llvm-strings --radix o %t | FileCheck %s -check-prefix CHECK-OCT --strict-whitespace +RUN: llvm-strings --radix x %t | FileCheck %s -check-prefix CHECK-HEX --strict-whitespace + +## Show different syntaxes work. +RUN: llvm-strings --radix=d %t | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace +RUN: llvm-strings -t=d %t | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace CHECK-NONE: {{^}}three CHECK-NONE: {{^}}four @@ -30,3 +52,7 @@ CHECK-HEX: {{^}} 13 five CHECK-HEX: {{^}} 1c seven CHECK-HEX: {{^}} 22 eight CHECK-HEX: {{^}} 28 nine + +## Show that an invalid value is rejected. +RUN: not llvm-strings --radix z %t 2>&1 | FileCheck %s --check-prefix=INVALID +INVALID: llvm-strings{{.*}}: for the --radix option: Cannot find option named 'z'! |