This is an archive of the discontinued LLVM Phabricator instance.

[test][llvm-objcopy] Test llvm-objcopy with standard streams
ClosedPublic

Authored by abrachet on Jun 3 2019, 9:55 AM.

Details

Summary

Ensure that redirecting input to stdin is no different than a normal file. Likewise outputting to stdout should be no different than outputting to a file.

Diff Detail

Repository
rL LLVM

Event Timeline

abrachet created this revision.Jun 3 2019, 9:55 AM
llvm/test/tools/llvm-objcopy/ELF/standard-streams.test
3 ↗(On Diff #202743)

cmp ? and the same below
(for consistency)
(if I'm not mistaken all the existing tests use cmp to verify that two binary files are identical)

abrachet updated this revision to Diff 202846.Jun 3 2019, 7:59 PM

Now using cmp rather than diff

abrachet updated this revision to Diff 202866.Jun 4 2019, 12:22 AM

Put test case in ELF/ directory

abrachet marked an inline comment as done.Jun 4 2019, 12:23 AM
jakehehrlich accepted this revision.Jun 4 2019, 12:29 AM

Neat! I didn't even know this was possible TBH

llvm/test/tools/llvm-objcopy/ELF/standard-streams.test
1 ↗(On Diff #202866)

Instead of using cat you can just redirect the file in.

This revision is now accepted and ready to land.Jun 4 2019, 12:29 AM
abrachet updated this revision to Diff 202867.Jun 4 2019, 12:45 AM

Directed a file in instead of piping cat

abrachet marked an inline comment as done.Jun 4 2019, 12:45 AM
jhenderson accepted this revision.Jun 4 2019, 4:01 AM

LGTM, with one nit.

llvm/test/tools/llvm-objcopy/ELF/standard-streams.test
7 ↗(On Diff #202867)

Delete this blank line. There should be a single trailing new line character at the end of the last line in the file with content, but nothing after that.

rupprecht accepted this revision.Jun 4 2019, 3:10 PM
This revision was automatically updated to reflect the committed changes.