--- ray/makeall 2012/06/29 16:18:02 1.28 +++ ray/makeall 2024/12/03 01:11:43 1.32 @@ -1,5 +1,5 @@ #!/bin/csh -f -# RCSid $Id: makeall,v 1.28 2012/06/29 16:18:02 greg Exp $ +# RCSid $Id: makeall,v 1.32 2024/12/03 01:11:43 greg Exp $ # # Make all the Radiance programs # @@ -7,6 +7,7 @@ if ( $#argv < 1 ) then echo "Usage: makeall install [clean] [make options]" echo " or: makeall clean" echo " or: makeall library" + echo " or: makeall test" exit 1 endif if ( "$1" == library ) then @@ -22,6 +23,23 @@ if ( "$1" == library ) then echo "" exit 0 endif +if ( "$1" == test ) then + cd test + set fails=() + foreach d (cv cal gen util px renders) + cd $d + make -k clean all && make clean + if ($status) set fails=($fails $d) + cd .. + end + if ($#fails) then + echo "Unit tests failed in $#fails directories" + echo "Run 'make' manually in test/ subfolders: $fails" + exit 1 + endif + echo "All tests passed successfully." + exit 0 +endif set srcdirs=( common rt meta cv gen ot px hd util cal ) if ( "$1" == install ) then cat << _EOF_ @@ -92,56 +110,49 @@ cat << _EOF_ Please select your system type from the following list: - 1) Sun Solaris - 2) Linux - 3) MacOS X - 4) FreeBSD - 5) Cygwin - 6) Other + 1) Linux + 2) MacOS X + 3) FreeBSD + 4) Cygwin + 5) Other _EOF_ echo -n "Choice? " set arch="$<" switch ("$arch") -case 1: # SPARC Station - set arch=sun - set mach="-I/usr/openwin/include -L/usr/openwin/lib -DNOSTEREO" - set opt="-O" - set compat="strcmp.o timegm.o" - breaksw -case 2: # Linux +case 1: # Linux set mach="-Dlinux -D_FILE_OFFSET_BITS=64 -L/usr/X11R6/lib -I/usr/include/X11 -DNOSTEREO" set opt="-O2" set arch=IBMPC - set compat="erf.o" + set compat="strnstr.o strlcpy.o" set extras=CC=gcc breaksw -case 3: # MacOS X +case 2: # MacOS X set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib" set opt="-O2" set arch=Intel set extras="CC=cc CONFIGURE_ARCH=i386" set special="ogl" breaksw -case 4: # FreeBSD +case 3: # FreeBSD set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib" set opt="-O" set compat="erf.o" set extras='CC=cc MLIB="-lcompat -lm"' set arch=IBMPC breaksw -case 5: # Cygwin +case 4: # Cygwin set mach="-Dfreebsd -L/usr/lib -L/usr/X11R6/lib -I/usr/include/X11 -I/usr/X11R6/include -DNOSTEREO" set opt="-O2" set arch=IBMPC - set compat="erf.o" + set compat="erf.o strnstr.o strlcpy.o" set extras="CC=gcc" set special="ogl" set esuffix=".exe" breaksw -case 6: # Other +case 5: # Other set opt="-O" - set compat="erf.o strcmp.o" + set compat="erf.o strcmp.o strnstr.o strlcpy.o" echo -n "Are you using the GNU C compiler [n]? " if ( "$<" =~ [yY]* ) then set extras="CC=gcc"