https://bugs.kde.org/show_bug.cgi?id=502679
--- Comment #7 from Mark Wielaard <m...@klomp.org> --- +mapfile -t files < <(find testcases/kernel/syscalls -executable -and -type f | sort) +c=${#files[@]}; i=0 Interesting, slightly above my bash knowledge, but I think I understand what it does. +for test in "${files[@]}"; do + dir=$(dirname $test) + exe=$(basename $test) + tmp=$(mktemp -d) Why do we need these tmp dirs? They just hold the log files? Shouldn't we just keep those? That seems useful for local debugging what went wrong instead of having everything in one big output log file. + i=$((++i)) + pushd $dir >/dev/null + echo "[$i/$c] Testing $exe ..." | tee -a $OUTPUT_LOG + PATH="$ORIG_PATH:$PWD" + ./$exe >$tmp/log1std 2>$tmp/log1err ||: + $VALGRIND -q --tool=none --log-file=$tmp/log2 ./$exe >$tmp/log2std 2>$tmp/log2err ||: + $VALGRIND -q --tool=memcheck --log-file=$tmp/log3 ./$exe >$tmp/log3std 2>$tmp/log3err ||: OK, running once normally, once with the none tool and once with memcheck. Keeping stdout and stderr, plus the valgrind none and memcheck logs. Nice. + # We want to make sure that LTP syscall tests give identical + # results with and without valgrind. The test logs go to the + # stderr. They aren't identical across individual runs. The + # differences include port numbers, temporary files, test + # output ordering changes and more, so that they aren't trivially + # comparable. So we resort to comparing at least the final + # summaty of individual test results + tail -10 $tmp/log1err | grep -E "^(passed|failed|broken|skipped|warnings):" > $tmp/log1summary ||: + tail -10 $tmp/log2err | grep -E "^(passed|failed|broken|skipped|warnings):" > $tmp/log2summary ||: + tail -10 $tmp/log3err | grep -E "^(passed|failed|broken|skipped|warnings):" > $tmp/log3summary ||: Nice. + # Check logs, report errors + pushd $tmp >/dev/null hmmm. + if test $(wc -l log2 | cut -d' ' -f1) -gt 0; then + myLog "${exe}: unempty log2:\n$(cat log2)" + fi I think you can use test -s log2 here -s FILE FILE exists and has a size greater than zero + if grep -f $SELF_DIR/ltp-error-patterns.txt * > error-patterns-found.txt; then + myLog "${exe}: error string found:\n$(cat error-patterns-found.txt)" + fi Note that ltp-error-patterns.txt seems to be missing from the patch. So * is why you wat to do it in a separate tmp dir? Couldn't you explicitly list the log files? Do you need to check anything except the valgrind error logs? log2 and log3? + if ! ${DIFFCMD} log1summary log2summary >/dev/null; then + myLog "${exe}: ${DIFFCMD} log1summary log2summary:\n$(${DIFFCMD} log1summary log2summary)" + fi + + if ! ${DIFFCMD} log2summary log3summary >/dev/null; then + myLog "${exe}: ${DIFFCMD} log2summary log3summary:\n$(${DIFFCMD} log2summary log3summary)" + fi Yeah, makes sense. + popd >/dev/null + popd >/dev/null + rm -rf $tmp +done Still somewhat surprised the tmp dir with the logs is removed. Sorry for the many nitpicks and questions. I do really like this. Would like to hook it up to the buildbots. -- You are receiving this mail because: You are watching all bug changes.