* tests/strace-S.test: Check default sorting method and "-S time".
sortopts="$1"; shift
sedexpr="$1"; shift
- run_strace -c -w -S "$sortby" ../readv > /dev/null
+ run_strace -c -w ${sortby:+-S} $sortby ../readv > /dev/null
sed -r -n -e "$sedexpr" < "$LOG" > "$OUT"
[ -s "$OUT" ] ||
}
c='[[:space:]]+([^[:space:]]+)'
-test_c calls '-n -r' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'[[:space:]].*/\4/p'
-test_c name '' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'([[:space:]]+[0-9]+)?'"$c"'$/\6/p'
+for s in '' time; do
+ test_c "$s" '-n -r' \
+ 's/^[[:space:]]+([0-9]+)[.,]([0-9]+)[[:space:]].*/\1\t\2/p'
+done
+for s in calls; do
+ test_c "$s" '-n -r' \
+ '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'[[:space:]].*/\4/p'
+done
+for s in name; do
+ test_c "$s" '' \
+ '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'([[:space:]]+[0-9]+)?'"$c"'$/\6/p'
+done