2 ################## System.Drawing: run-samples.sh #######################
4 # This script compiles and runs samples from each directory in #
5 # System.Drawing.Samples directory. Compiled exes and output #
6 # images, if any, are saved to respective directories. #
7 # Compile time logs are saved to compile-log.txt and runtime logs are #
8 # saved to runtime-log.txt. Both log files are saved at the same #
9 # location where this script is run. #
11 # Following are the two ways to run this script, #
14 # $ run-samples.sh [option] #
16 # NOTE: Possible options are (m)ake, (c)lean, (r)un, (a)ll #
17 # --run is default option, when no option is specified. #
18 # Only one option can be specified at a time. #
19 # -m, --make - compiles all the samples #
20 # -c, --clean - deletes all the exes generated #
21 # -r, --run - compiles and runs all the samples. [Default] #
22 # -a, --all - runs all the samples and also cleans #
24 # **** This script would hang, if any sample hangs!!! #
27 # Sachin <skumar1@novell.com> #
28 # Ravindra <rkumar@novell.com> #
30 # Copyright (C) 2004, Novell, Inc. http://www.novell.com #
32 #########################################################################
34 # Prints the script usage
37 echo "Usage: run-samples [option]"
38 echo "Only one option is processed at a time."
39 echo "Possible options are: (m)ake, (c)lean, (r)un, (a)ll"
40 echo " -m, --make: Just compiles all the samples."
41 echo " -c, --clean: Just removes all the exes."
42 echo " -r, --run: makes and runs all the samples. [Default]"
43 echo " -a, --all: same as run and clean combined."
44 echo " --run option is assumed, if no option is specified."
48 # Compiles all the samples
51 echo === Compiling samples
in $dir ===
56 echo -n " $src:: " >> $CLOG
57 $MCS $COMPILE_OPS $src >> $CLOG 2>&1
61 # Deletes all the exes
64 echo === Cleaning
$dir ===
68 # Compiles and runs all the samples
72 echo === Running samples
in $dir ===
77 echo "$dir: $exe :: " >> $RLOG
79 $MONO $RUN_OPS $exe >> $RLOG 2>&1
83 # Compliles, runs and deletes all the exes
93 CLOG
=$ROOT/compile-log.txt
94 RLOG
=$ROOT/runtime-log.txt
98 COMPILE_OPS
="-g -r:$LIB"
101 # Uncomment the following line, if you are running this script on MS
104 # We don't process more than one command line arguments
105 if [ $# -gt 1 ]; then
109 # Default option is run, if no command line argument is present
116 # Creates the log files
117 echo '*** LOG FILE for compile-time messages for System.Drawing Samples ***' > $CLOG
118 echo '*** LOG FILE for run-time output messages for System.Drawing Samples ***' > $RLOG
120 # All directories are processed under Samples.
121 for dir
in `ls -d System.Drawing*`
124 echo ===== $dir ===== >> $CLOG
127 echo ===== $dir ===== >> $RLOG
129 # Change dir if it exists
130 if [ -d $ROOT/$dir ]; then
145 echo "$dir not found." >> $CLOG
146 echo "$dir not found." >> $RLOG