From af555fb4a3b058a0fa4169c38891d5d58883b37d Mon Sep 17 00:00:00 2001 From: Alexander Shaposhnikov Date: Thu, 10 May 2018 15:56:04 +0000 Subject: [PATCH] [llvm-objcopy] Add tests for help messages This diff slightly reorganizes the tests and improves the test coverage of help messages / error reports. Test plan: make check-all Differential revision: https://reviews.llvm.org/D46589 llvm-svn: 331993 --- llvm/test/tools/llvm-objcopy/help-message.test | 19 +++++++++++++------ llvm/test/tools/llvm-objcopy/strip-debug.test | 4 ---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/llvm/test/tools/llvm-objcopy/help-message.test b/llvm/test/tools/llvm-objcopy/help-message.test index 5f49967..504ce21 100644 --- a/llvm/test/tools/llvm-objcopy/help-message.test +++ b/llvm/test/tools/llvm-objcopy/help-message.test @@ -1,8 +1,15 @@ -# RUN: llvm-objcopy --help | FileCheck --check-prefix=CHECK-OBJCOPY %s -# RUN: not llvm-objcopy 2>&1 | FileCheck --check-prefix=CHECK-OBJCOPY %s +# RUN: llvm-objcopy --help | FileCheck --check-prefix=OBJCOPY-USAGE %s +# RUN: not llvm-objcopy 2>&1 | FileCheck --check-prefix=OBJCOPY-USAGE %s +# RUN: not llvm-objcopy -abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s +# RUN: not llvm-objcopy -strip-debug 2>&1 | FileCheck %s --check-prefix=NO-INPUT-FILES -# RUN: llvm-strip --help | FileCheck --check-prefix=CHECK-STRIP %s -# RUN: not llvm-strip 2>&1 | FileCheck --check-prefix=CHECK-STRIP %s +# RUN: llvm-strip --help | FileCheck --check-prefix=STRIP-USAGE %s +# RUN: not llvm-strip 2>&1 | FileCheck --check-prefix=STRIP-USAGE %s +# RUN: not llvm-strip -abcabc 2>&1 | FileCheck --check-prefix=UNKNOWN-ARG %s +# RUN: not llvm-strip -strip-debug 2>&1 | FileCheck %s --check-prefix=NO-INPUT-FILES -# CHECK-OBJCOPY: USAGE: llvm-objcopy -# CHECK-STRIP: USAGE: llvm-strip + +# OBJCOPY-USAGE: USAGE: llvm-objcopy +# STRIP-USAGE: USAGE: llvm-strip +# UNKNOWN-ARG: unknown argument '-abcabc' +# NO-INPUT-FILES: No input file specified diff --git a/llvm/test/tools/llvm-objcopy/strip-debug.test b/llvm/test/tools/llvm-objcopy/strip-debug.test index e24843d..33ccf78 100644 --- a/llvm/test/tools/llvm-objcopy/strip-debug.test +++ b/llvm/test/tools/llvm-objcopy/strip-debug.test @@ -10,8 +10,6 @@ # RUN: llvm-readobj -file-headers -sections -symbols %t3 | FileCheck %s # RUN: cmp %t2 %t3 -# RUN: not llvm-strip -strip-debug 2>&1 | FileCheck %s --check-prefix=NO-INPUT-FILES - !ELF FileHeader: Class: ELFCLASS64 @@ -62,5 +60,3 @@ Symbols: # CHECK-NEXT: Section: .text # CHECK-NEXT: } # CHECK-NEXT: ] - -# NO-INPUT-FILES: No input file specified -- 2.7.4