#!/bin/bash ################################################################################ # Copyright 2007 Sun Microsystems, Inc., # 4150 Network Circle, Santa Clara, California 95054, U.S.A. # All rights reserved. # # U.S. Government Rights - Commercial software. # Government users are subject to the Sun Microsystems, Inc. standard # license agreement and applicable provisions of the FAR and its supplements. # # Use is subject to license terms. # # This distribution may include materials developed by third parties. # # Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered # trademarks of Sun Microsystems, Inc. in the U.S. and other countries. ################################################################################ # This script reads a "bunch" of tests (currently, all who name begins # with the letter "a"), writes their ASTs to disk, then runs a program that # reads ASTs and writes them to disk, and then compares that the twice-written # AST does not differ from the once-written AST. Notice that AST writing itself # might omit information, so what this is really testing is AST reading. if (uname | egrep -q CYGWIN) ; then CP="build;third_party/junit/junit.jar;third_party/xtc/xtc.jar;third_party/jsr166y/jsr166y.jar;third_party/plt/plt.jar" else CP="build:third_party/junit/junit.jar:third_party/xtc/xtc.jar:third_party/jsr166y/jsr166y.jar:third_party/plt/plt.jar" fi A=testSerializationScratch rm -rf $A mkdir $A for i in tests/a*.fss ; do TFSNAME=`basename $i .fss`.tfs java -cp "$CP" -Xmx320m -Xms192m \ com.sun.fortress.interpreter.drivers.fs -parseOnly -ast $i mv $TFSNAME $A done # Tup is an old testing driver that reads ASTs, in bunches, and writes them # back to disk, in bunches. java -cp "$CP" com.sun.fortress.interpreter.drivers.Tup -fileout=tfs $A/*.tfs for i in $A/*.tfs; do diff $i ${i}2 done