# # This is a template Makefile to be put in the # testing/implementation/source/java directory of a 309 project. Goto the # lines labeled "FILL IN HERE" to customize this template for your project. # # In order for this Makefile to work properly, your project directory must be # set up per the 309 SOP, Volume 1. In particular, you must have the following # directories defined: # # DIRECTORY CONTENTS # ===================================================================== # implementation/source/java root directory for the .java # source files of your project, # organized into packages # # implementation/executables/JVM root directory for the .class # executable files generated by the # Java compiler # # testing/implementation/source/java root directory for the .java # testing source files of your # project, organized into the same # packages as the implementation # source files # # testing/implementation/executables/JVM root directory for the .class # testing executable files # generated by the Java compiler # # testing/implementation/output-good directory containing output # results confirmed to be good # # testing/implementation/executables/JVM/ directory containing most # output recently run test output results # # testing/implementation/executables/JVM/ directory containing differences # diffs between good output results and # most recently run output results # # CSC 309 java lib directory LIB309 = /home/gfisher/classes/309/lib/JVM # Directory for generated executable files EXECUTABLES = ../../executables/JVM # Path to the implementation source files. IMPLE_SRC_DIR = ../../../../implementation/source/java ### FILL IN HERE: # Change the name "ClassX" below to the name of a model class in your project # to be tested. # # On the lines following "ClassX_TEST_FILES = \" below, fill in the names of # all Java source files for testing model class named "ClassX", including any # necessary testing stub files. Each line should be of the same form used in # implementation-Makefile. # # ClassX_TEST_FILES = \ ### FILL IN HERE: # Add additional rules of the preceding form for each of the other model # classes that are to be tested for your project, one for each group member. # # Compile and execute the ClassX module test. # ### FILL IN HERE: # Change the name "ClassX" to the name of your class being tested. Change the # name "classx-path" to the package path that leads to ClassX. ClassX_test: compile_ClassX run_ClassX diff_ClassX compile_ClassX @echo "Compiling tests ..." @javac -g \ -classpath $(LIB309) \ -sourcepath .:$(IMPLE_SRC_DIR) \ -d $(EXECUTABLES) \ $(ClassX_TEST_FILES) run_ClassX: @echo "Running tests ..." @csh -q -c 'cd $(EXECUTABLES); \ java classx-path.ClassXTestDriver > \ output/ClassX.out ; diff_ClassX: @csh -q -c 'cd $(EXECUTABLES); \ echo "Comparing restuls ..." ; \ echo "No further output means no differences found." ; \ diff output/ClassX.out ../../output-good/ClassX.out > \ diffs/ClassX.diff ; \ if (! -z diffs/ClassX.diff) echo "Difference found."' # # Make the most recent output the good output. # good: cp -p $(EXECUTABLES)/output/*.out ../../output-good ucaltest: javac -g -classpath $(CLASS_PATH) $(UCAL_TEST_FILES)