[all-commits] [llvm/llvm-project] 0c5bee: [test] do not parse ls output for file size; NFCI

Bryan Chan via All-commits all-commits at lists.llvm.org
Mon Dec 30 10:35:27 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0c5bee8fdd40bbbad9d3f5cce06785c72632fbd0
      https://github.com/llvm/llvm-project/commit/0c5bee8fdd40bbbad9d3f5cce06785c72632fbd0
  Author: Bryan Chan <bryan.chan at huawei.com>
  Date:   2019-12-30 (Mon, 30 Dec 2019)

  Changed paths:
    M llvm/test/tools/llvm-profdata/show-prof-size.test
    M llvm/test/tools/yaml2obj/ELF/custom-null-section.yaml

  Log Message:
  -----------
  [test] do not parse ls output for file size; NFCI

Parsing `ls -l` output to obtain the size of a file is unreliable; the
exact output format is not specified, and some user or group names may
contain multiple words, causing `cut -f5 -d' '` to extract an incorrect
value. `wc -c`, on the other hand, is portable, and there are precendents
of its use in test cases.




More information about the All-commits mailing list