From bff692a150907dae702c8bb9c50627f3dc49203a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Tue, 12 Jun 2018 22:23:57 +0200 Subject: [PATCH] Add FreeBSD compatibility to test suites --- test/run | 9 +++++++++ test/suites/debug_prefix_map.bash | 2 ++ 2 files changed, 11 insertions(+) diff --git a/test/run b/test/run index 0bbb21c44..4e1efd4bb 100755 --- a/test/run +++ b/test/run @@ -158,6 +158,11 @@ expect_equal_object_files() { test_failed "Please install elfutils to get eu-elfcmp" fi eu-elfcmp -q "$1" "$2" + elif $HOST_OS_FREEBSD && $COMPILER_TYPE_CLANG; then + elfdump -a -w "$1".dump "$1" + elfdump -a -w "$2".dump "$2" + # these were the elfdump fields that seemed to differ (empirically) + diff -I e_shoff -I sh_size -I st_name "$1".dump "$2".dump > /dev/null else cmp -s "$1" "$2" fi @@ -288,6 +293,7 @@ COMPILER_USES_MINGW=false HOST_OS_APPLE=false HOST_OS_LINUX=false +HOST_OS_FREEBSD=false HOST_OS_WINDOWS=false compiler_version="`$COMPILER --version 2>&1 | head -1`" @@ -323,6 +329,9 @@ case $(uname -s) in *Linux*) HOST_OS_LINUX=true ;; + *FreeBSD*) + HOST_OS_FREEBSD=true + ;; esac if $HOST_OS_WINDOWS; then diff --git a/test/suites/debug_prefix_map.bash b/test/suites/debug_prefix_map.bash index 25cc36ff2..d00e65476 100644 --- a/test/suites/debug_prefix_map.bash +++ b/test/suites/debug_prefix_map.bash @@ -23,6 +23,8 @@ EOF objdump_cmd() { if $HOST_OS_APPLE; then xcrun dwarfdump -r0 $1 + elif $HOST_OS_FREEBSD; then + objdump -W $1 else objdump -g $1 fi -- 2.47.2