Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] (PR#8617) two tests for "make check"
Home

[Freeciv-Dev] (PR#8617) two tests for "make check"

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8617) two tests for "make check"
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 29 Apr 2004 00:08:59 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8617 >

This patch takes 2 of Raimar's test scripts, edits them a bit, and puts 
them into the tests/ directory.  They are run when "make check" is 
called (see 
http://www.gnu.org/software/automake/manual/html_mono/automake.html) and 
put their output in tests/check-output.

We use some command-line programs without checking for them in 
configure.  If they're not present, make check won't run.

Attached also is the current results of check-output.

jason

? tests/header_guard.sh
? tests/va_list.sh
Index: tests/.cvsignore
===================================================================
RCS file: /home/freeciv/CVS/freeciv/tests/.cvsignore,v
retrieving revision 1.1
diff -u -r1.1 .cvsignore
--- tests/.cvsignore    27 Apr 2004 04:10:23 -0000      1.1
+++ tests/.cvsignore    29 Apr 2004 07:04:47 -0000
@@ -1,3 +1,4 @@
 Makefile
 Makefile.in
 .deps
+check-output
Index: tests/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/tests/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- tests/Makefile.am   27 Apr 2004 04:10:23 -0000      1.1
+++ tests/Makefile.am   29 Apr 2004 07:04:47 -0000
@@ -1,3 +1,12 @@
 ## Process this file with automake to produce Makefile.in
 
 SUBDIRS = .
+
+# Currently the "check" directive creates a check-output file containing the
+# results of the checks.  It might be better to actually fail the make run
+# if the check fails.
+check:
+       rm -f check-output
+       ./header_guard.sh $(top_srcdir) >> check-output
+       ./va_list.sh $(top_srcdir) >> check-output
+       cat check-output | sed "s\\$(top_srcdir)/\\\\" > check-output
#!/bin/sh

files=`find $1 -name "*.h" \
       | sort \
       | grep -v intl \
       | grep -v common/spec \
       | grep -v "Freeciv.h" \
       | grep -v ./common/packets_gen.h \
       | grep -v config.h`

echo "# Header files without any include guard:"
for file in $files; do
    grep "^#ifndef FC_.*_H$" $file >/dev/null \
     || grep ifndef $file >/dev/null \
     || echo $file
done
echo

echo "# Header files with a misnamed guard (doesn't match 'FC_.*_H'):"
for file in $files; do
    grep "^#ifndef FC_.*_H$" $file >/dev/null \
     || (grep ifndef $file >/dev/null \
         && grep ifndef $file /dev/null | head -n1)
done
echo
#!/bin/sh

echo "# C files which use va_list but don't include stdarg.h:"
find $1 -name "*.c" \
 | sort \
 | grep -v intl \
 | while read line; do 
    (!(grep '^#include.*<stdarg.h>' $line >/dev/null \
     && ! grep 'va_list' $line >/dev/null)) \
    || echo "$line";
done
echo
# Header files without any include guard:
client/gui-gtk-2.0/happiness.h
client/gui-sdl/happiness.h
client/gui-win32/happiness.h
common/fciconv.h

# Header files with a misnamed guard (doesn't match 'FC_.*_H'):
amiga/declgate.h:#ifndef __DECLGATE_H__
amiga/myregargs.h:#ifndef __MYREGARGS_H__
amiga/SDI_compiler.h:#ifndef SDI_COMPILER_H
client/gui-gtk-2.0/gtkpixcomm.h:#ifndef __GTK_PIXCOMM_H__
client/gui-gtk/gtkpixcomm.h:#ifndef __GTK_PIXCOMM_H__
client/gui-mui/muistuff.h:#ifndef MUISTUFF_H
client/gui-sdl/gui_string.h:#ifndef __STRING_H
client/gui-sdl/gui_zoom.h:#ifndef _GUI_ZOOM_H
client/gui-sdl/mmx.h:#ifndef _MMX_H
client/gui-sdl/SDL_ttf.h:#ifndef _SDLttf_h
client/gui-sdl/unistring.h:#ifndef __UNISTRING_H
client/gui-xaw/canvas.h:#ifndef _Canvas_h
client/gui-xaw/canvasp.h:#ifndef _CanvasP_h
client/gui-xaw/pixcomm.h:#ifndef _Pixcomm_h
client/gui-xaw/pixcommp.h:#ifndef _PixcommP_h

# C files which use va_list but don't include stdarg.h:
client/mapctrl_common.c


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8617) two tests for "make check", Jason Short <=