All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] Importance of compile testing
@ 2005-07-13 18:31 Domen Puncer
  0 siblings, 0 replies; only message in thread
From: Domen Puncer @ 2005-07-13 18:31 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 759 bytes --]

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

[-- Attachment #2: kj_compile_test --]
[-- Type: text/plain, Size: 438 bytes --]

#!/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 '^\+'"

[-- Attachment #3: compile-test-bz-patchset --]
[-- Type: text/plain, Size: 154 bytes --]

#!/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'

[-- Attachment #4: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-07-13 18:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-13 18:31 [KJ] Importance of compile testing Domen Puncer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.