Skip to content

Commit

Permalink
[ar, ranlib] Add testcases for '--help', '--version' options [#4]
Browse files Browse the repository at this point in the history
Some XFAILed.
  • Loading branch information
tschwinge committed Jan 7, 2021
1 parent 52149d2 commit b4e1cbf
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/ar/help-1-xfail-1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Variant of 'help-1.test'.
XFAIL: *
See <https://github.com/MentorEmbedded/nvptx-tools/issues/4> "nvptx-none-ar and nvptx-none-ranlib".

RUN: %target_ar_cmd --help > %t.stdout 2> %t.stderr
RUN: < %t.stdout head -n 1 | grep -qe '^Usage: nvptx-none-ar '
RUN: ! test -s %t.stderr
4 changes: 4 additions & 0 deletions test/ar/help-1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RUN: %target_ar_cmd --help > %t.stdout 2> %t.stderr
RUN_TODO('help-1-xfail-1.test'): < %t.stdout head -n 1 | grep -qe '^Usage: nvptx-none-ar '
RUN: test -s %t.stdout
RUN: ! test -s %t.stderr
7 changes: 7 additions & 0 deletions test/ar/version-1-xfail-1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Variant of 'version-1.test'.
XFAIL: *
See <https://github.com/MentorEmbedded/nvptx-tools/issues/4> "nvptx-none-ar and nvptx-none-ranlib".

RUN: %target_ar_cmd --version > %t.stdout 2> %t.stderr
RUN: < %t.stdout head -n 1 | grep -qe '^nvptx-none-ar '
RUN: ! test -s %t.stderr
4 changes: 4 additions & 0 deletions test/ar/version-1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RUN: %target_ar_cmd --version > %t.stdout 2> %t.stderr
RUN_TODO('version-1-xfail-1.test'): < %t.stdout head -n 1 | grep -qe '^nvptx-none-ar '
RUN: test -s %t.stdout
RUN: ! test -s %t.stderr
6 changes: 6 additions & 0 deletions test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@
config.suffixes = ['.test']


config.substitutions.append(('%target_ar_cmd', config.target_ar))


config.substitutions.append(('%target_as_cmd', config.target_as))


config.substitutions.append(('%target_ld_cmd', config.target_ld))


config.substitutions.append(('%target_ranlib_cmd', config.target_ranlib))


if config.target_run:
config.available_features.add('target_run')

Expand Down
6 changes: 6 additions & 0 deletions test/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ abs_top_builddir = r'@abs_top_builddir@'
config.test_exec_root = abs_builddir


config.target_ar = r'@AR@'


config.target_as = 'nvptx-none-as'
config.target_as = os.path.join(abs_top_builddir, config.target_as)

Expand All @@ -23,6 +26,9 @@ config.target_ld = 'nvptx-none-ld'
config.target_ld = os.path.join(abs_top_builddir, config.target_ld)


config.target_ranlib = r'@RANLIB@'


config.target_run = r'@NVPTX_RUN@'
# This one is optional.
if config.target_run:
Expand Down
7 changes: 7 additions & 0 deletions test/ranlib/help-1-xfail-1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Variant of 'help-1.test'.
XFAIL: *
See <https://github.com/MentorEmbedded/nvptx-tools/issues/4> "nvptx-none-ar and nvptx-none-ranlib".

RUN: %target_ranlib_cmd --help > %t.stdout 2> %t.stderr
RUN: < %t.stdout head -n 1 | grep -qe '^Usage: nvptx-none-ranlib '
RUN: ! test -s %t.stderr
4 changes: 4 additions & 0 deletions test/ranlib/help-1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RUN: %target_ranlib_cmd --help > %t.stdout 2> %t.stderr
RUN_TODO('help-1-xfail-1.test'): < %t.stdout head -n 1 | grep -qe '^Usage: nvptx-none-ranlib '
RUN: test -s %t.stdout
RUN: ! test -s %t.stderr
7 changes: 7 additions & 0 deletions test/ranlib/version-1-xfail-1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Variant of 'version-1.test'.
XFAIL: *
See <https://github.com/MentorEmbedded/nvptx-tools/issues/4> "nvptx-none-ar and nvptx-none-ranlib".

RUN: %target_ranlib_cmd --version > %t.stdout 2> %t.stderr
RUN: < %t.stdout head -n 1 | grep -qe '^nvptx-none-ranlib '
RUN: ! test -s %t.stderr
4 changes: 4 additions & 0 deletions test/ranlib/version-1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RUN: %target_ranlib_cmd --version > %t.stdout 2> %t.stderr
RUN_TODO('version-1-xfail-1.test'): < %t.stdout head -n 1 | grep -qe '^nvptx-none-ranlib '
RUN: test -s %t.stdout
RUN: ! test -s %t.stderr

0 comments on commit b4e1cbf

Please sign in to comment.