diff options
Diffstat (limited to '')
-rwxr-xr-x | testsuite/scripts/gnu-debugaltlink-name.sh | 11 | ||||
-rwxr-xr-x | testsuite/scripts/hardlinks-p.sh | 16 | ||||
-rwxr-xr-x | testsuite/scripts/smaller-than.sh | 48 | ||||
-rwxr-xr-x | testsuite/scripts/verify-dwarf.sh | 5 | ||||
-rwxr-xr-x | testsuite/scripts/xunzip-dir.sh | 20 |
5 files changed, 100 insertions, 0 deletions
diff --git a/testsuite/scripts/gnu-debugaltlink-name.sh b/testsuite/scripts/gnu-debugaltlink-name.sh new file mode 100755 index 0000000..667c5fd --- /dev/null +++ b/testsuite/scripts/gnu-debugaltlink-name.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if ! readelf -S $1 | grep -q '\.gnu_debugaltlink'; then + exit +fi + +readelf \ + --string-dump=.gnu_debugaltlink \ + $1 \ + | grep -a '\[[ ]*0\]' \ + | sed 's/.*0\] //' diff --git a/testsuite/scripts/hardlinks-p.sh b/testsuite/scripts/hardlinks-p.sh new file mode 100755 index 0000000..a9a3020 --- /dev/null +++ b/testsuite/scripts/hardlinks-p.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +hardlinks=$(find -samefile "$1") + +for f in "$@"; do + found=false + for hl in $hardlinks; do + if [ "$hl" = "./$f" ]; then + found=true + break + fi + done + if ! $found; then + exit 1 + fi +done diff --git a/testsuite/scripts/smaller-than.sh b/testsuite/scripts/smaller-than.sh new file mode 100755 index 0000000..3b452dc --- /dev/null +++ b/testsuite/scripts/smaller-than.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +f1=$1 +f2=$2 + +section_size () +{ + local f="$1" + local section="$2" + + local s + s=$(readelf -S -W $f \ + | grep "\.debug_$section" \ + | sed 's/.*\.debug_//' \ + | awk '{print $5}') + + if [ "$s" = "" ]; then + echo 0 + return + fi + + # Convert hex to decimal. + s=$(printf "%d" $((16#$s))) + + echo $s +} + +size () +{ + local f="$1" + + local total=0 + local section + for section in info abbrev str macro types; do + total=$(($total + $(section_size $f $section))) + done + + echo $total +} + +s1=$(size $f1) +s2=$(size $f2) + +if [ $s1 -ge $s2 ]; then + exit 1 +fi + +exit 0 diff --git a/testsuite/scripts/verify-dwarf.sh b/testsuite/scripts/verify-dwarf.sh new file mode 100755 index 0000000..8e97c3c --- /dev/null +++ b/testsuite/scripts/verify-dwarf.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +exec="$1" + +gdb -batch "$exec" diff --git a/testsuite/scripts/xunzip-dir.sh b/testsuite/scripts/xunzip-dir.sh new file mode 100755 index 0000000..624d525 --- /dev/null +++ b/testsuite/scripts/xunzip-dir.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +src="$1" +dst="$2" + +if [ ! -d $src ]; then + exit 0 +fi + +files=$(cd $src; find -name "*.xz") + +for f in $files; do + df=$(echo $f \ + | sed 's/\.xz$//') + if [ -f $dst/$df ]; then + continue + fi + cp $src/$f $dst/$f + xz -d $dst/$f +done |