--- ray/makeall 2011/10/25 22:53:14 1.26 +++ ray/makeall 2020/09/11 20:38:46 1.30 @@ -1,5 +1,5 @@ #!/bin/csh -f -# RCSid $Id: makeall,v 1.26 2011/10/25 22:53:14 greg Exp $ +# RCSid $Id: makeall,v 1.30 2020/09/11 20:38:46 greg Exp $ # # Make all the Radiance programs # @@ -7,11 +7,12 @@ 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 source installib - cp -f src/*/*.{cal,tab,hex} $ldir + cp -f src/*/*.{cal,tab,hex,dat} $ldir echo "" echo "Set the environment variable RAYPATH=.:$ldir" echo 'For C-shell users, put the following into ~/.cshrc' @@ -22,6 +23,23 @@ if ( "$1" == library ) then echo "" exit 0 endif +if ( "$1" == test ) then + cd test + set fails=() + foreach d (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_ @@ -65,13 +83,6 @@ if ( ! -d $idir ) then goto again1 endif endif -if ( ! -d $idir/dev ) then - mkdir $idir/dev - if ( $status ) then - echo "Cannot create subdirectory, please reenter" - goto again1 - endif -endif set inpath=0 foreach i ( $path ) if ( "$i" == "$idir" ) then @@ -120,7 +131,7 @@ case 2: # 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="strlcpy.o" set extras=CC=gcc breaksw case 3: # MacOS X @@ -141,14 +152,14 @@ case 5: # 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 strlcpy.o" set extras="CC=gcc" set special="ogl" set esuffix=".exe" breaksw case 6: # Other set opt="-O" - set compat="erf.o strcmp.o" + set compat="erf.o strcmp.o strlcpy.o" echo -n "Are you using the GNU C compiler [n]? " if ( "$<" =~ [yY]* ) then set extras="CC=gcc"