[all-commits] [llvm/llvm-project] 88dd7c: [llvm-readelf][test] - Refine the merged.test

Georgii Rymar via All-commits all-commits at lists.llvm.org
Fri Aug 21 05:08:40 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 88dd7c85497a104ab7e3e52e41fe61be7175d8a9
      https://github.com/llvm/llvm-project/commit/88dd7c85497a104ab7e3e52e41fe61be7175d8a9
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-08-21 (Fri, 21 Aug 2020)

  Changed paths:
    M llvm/test/tools/llvm-readobj/ELF/merged.test

  Log Message:
  -----------
  [llvm-readelf][test] - Refine the merged.test

The testing in merged.test is not ideal.
It uses the following set of flags: `-aeWhSrnudlVgIs`
and the precompiled object `trivial.obj.elf-i386`.

In fact, this object, for example, does not contain versioning stuff,
so specifying `-V` does not make much sense for it, so it is not really tested.
Also, we want to avoid using of precompiled objects, ideally we
want to use a YAML that triggers an output for each of the short options in use:

```
-a: --all
-e: --headers
-W: --wide
-h: --file-headers, --file-header
-S: --section-headers, --sections
-r: --relocations
-n: --notes
-u: --unwind
-d: --dynamic-table
-l: --program-headers
-V: --version-info
-g: --elf-section-groups
-I: --elf-hash-histogram
-s: --symbols
```

Note that, for example, we do not need to have groups to test `-g`, because for a
object with no groups llvm-readelf still prints "There are no section groups in this file.",
but that is not always the case. E.g. for `-d` we don't print anything when we have
no dynamic table, so we have to describe it in a YAML to test `-d` properly.

Also, we probably want to test cases with and without `-a`(-all) option separately
to be sure that we handle all options and not only the first one in the sequence.

Differential revision: https://reviews.llvm.org/D86283




More information about the All-commits mailing list