Skip to content

Commit

Permalink
abi: fix unit test for abi on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
bapt committed Nov 21, 2024
1 parent 1b09d40 commit 1ab91e6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/frontend/abi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,22 @@ tests_init \
override

native_body() {
_expected="$(uname -s):$(uname -r | cut -d. -f1):$(uname -p | sed s/x86_64/amd64/)\n"
thisarch=$(uname -p)
if [ "$thisarch" = "unknonw" ]; then
thisarch=$(uname -m)
fi
OS=$(uname -s)
if [ "${OS}" = "Linux" ]; then
version=$(readelf -n /bin/uname | awk '/ABI: / { split($NF, a, "."); print a[1]"."a[2] }')
else
version=$(uname -r | cut -d. -f1)
fi
_expected="${OS}:${version}:$(echo $thisarch | sed s/x86_64/amd64/)\n"
atf_check \
-o inline:"${_expected}" \
pkg config abi

_expected="$(uname -s | tr '[:upper:]' '[:lower:]'):$(uname -r | cut -d. -f1):$(uname -p | sed 's/x86_64/x86:64/; s/amd64/x86:64/')\n"
_expected="$(uname -s | tr '[:upper:]' '[:lower:]'):${version}:$(echo $thisarch | sed 's/x86_64/x86:64/; s/amd64/x86:64/')\n"
atf_check \
-o inline:"${_expected}" \
pkg config altabi
Expand Down

0 comments on commit 1ab91e6

Please sign in to comment.