mirror of
https://github.com/uutils/coreutils
synced 2024-10-01 13:35:03 +00:00
util: modify scripts for code coverage to be compatible with BSD OS
- Use /usr/bin/env bash instead of /bin/sh to use OSTYPE - Use readlink from GNU coreutils on BSD OS in util/build-code_coverage.sh and util/show-code_coverage.sh scripts Signed-off-by: Laurent Cheylus <foxy@free.fr>
This commit is contained in:
parent
d450d5a463
commit
aef204461c
|
@ -1,15 +1,25 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# spell-checker:ignore (abbrevs/acronyms) HTML gcno llvm
|
||||
# spell-checker:ignore (jargon) toolchain
|
||||
# spell-checker:ignore (rust) Ccodegen Cinline Coverflow Cpanic RUSTC RUSTDOCFLAGS RUSTFLAGS RUSTUP Zpanic
|
||||
# spell-checker:ignore (shell) OSID esac
|
||||
# spell-checker:ignore (utils) genhtml grcov lcov readlink sccache shellcheck uutils
|
||||
# spell-checker:ignore (shell) OSID OSTYPE esac
|
||||
# spell-checker:ignore (utils) genhtml grcov lcov greadlink readlink sccache shellcheck uutils
|
||||
|
||||
FEATURES_OPTION="--features feat_os_unix"
|
||||
|
||||
# Use GNU coreutils for readlink on *BSD
|
||||
case "$OSTYPE" in
|
||||
*bsd*)
|
||||
READLINK="greadlink"
|
||||
;;
|
||||
*)
|
||||
READLINK="readlink"
|
||||
;;
|
||||
esac
|
||||
|
||||
ME="${0}"
|
||||
ME_dir="$(dirname -- "$(readlink -fm -- "${ME}")")"
|
||||
ME_dir="$(dirname -- "$("${READLINK}" -fm -- "${ME}")")"
|
||||
REPO_main_dir="$(dirname -- "${ME_dir}")"
|
||||
|
||||
cd "${REPO_main_dir}" &&
|
||||
|
|
|
@ -1,9 +1,19 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# spell-checker:ignore (vars) OSID binfmt
|
||||
# spell-checker:ignore (vars) OSID OSTYPE binfmt greadlink
|
||||
|
||||
# Use GNU coreutils for readlink on *BSD
|
||||
case "$OSTYPE" in
|
||||
*bsd*)
|
||||
READLINK="greadlink"
|
||||
;;
|
||||
*)
|
||||
READLINK="readlink"
|
||||
;;
|
||||
esac
|
||||
|
||||
ME="${0}"
|
||||
ME_dir="$(dirname -- "$(readlink -fm -- "${ME}")")"
|
||||
ME_dir="$(dirname -- "$("${READLINK}" -fm -- "${ME}")")"
|
||||
REPO_main_dir="$(dirname -- "${ME_dir}")"
|
||||
|
||||
export COVERAGE_REPORT_DIR="${REPO_main_dir}/target/debug/coverage-nix"
|
||||
|
|
Loading…
Reference in a new issue