Skip to contentSkip to conversation

Importance of compile testing

KJ Domen Puncer 1 participant 1 message Jul 13, 2005 Kernel janitors

lore
Share & tools
lore
#0 lore raw

Hi.

After compile failures in patches from four different authors I think it's time to repeat that compile tests are important for patches.
Even when you do a simple fix, and you are sure nothing can go wrong. Murphy's law applies here as well. :-)

I know it's easy to forget it, I sure have a couple of times.

I'm attaching a script I use for compile tests; yes it's stupid, but it can catch warnings on other architecture even without cross toolchains.
It assumes you are in kernel directory, and have already ran "make" there. Takes only .bz2 patchsets, but that's trivial to change.

When it finishes, you just type what the last line says:
"diff -u out.clean out.kj | less -p '^\+'", look at warnings and press 'n' till you get to the end.

Domen

#!/bin/bash
if [ "$1" == "" ]; then
echo "usage $0 patchset.bz2"
exit 1
fi

# TODO test if applies cleanly, if right dir?

echo "[1/4] applying patch"
bzcat $1 | patch -sp1
echo "[2/4] compiling"
compile-test-bz-patchset $1 > out.kj
echo "[3/4] unapplying patch"
bzcat $1 | patch -sRp1
echo "[4/4] compiling"
compile-test-bz-patchset $1 > out.clean

echo "output in out.kj and out.clean"
echo "diff -u out.clean out.kj | less -p '^\+'"

#!/bin/bash
bzcat $@ | egrep '^\+\+\+' | cut -f1 | cut -f2- -d'/' | egrep '\.[chS]$' | sed 's/\.[chS]$/.o/' | xargs -n1 make 2>&1 | sed 's/:[0-9]\+:/:/g'

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors