From 0a5e742e5b7e4986f75c95f4daf7bc9881ffcbf2 Mon Sep 17 00:00:00 2001 From: jjenista Date: Mon, 24 Aug 2009 16:34:32 +0000 Subject: [PATCH] A regression test to make sure new changes don't break the system --- Robust/src/Tests/mlp/regression/makefile | 26 ++++++++++++ Robust/src/Tests/mlp/regression/runTests | 3 ++ Robust/src/Tests/mlp/regression/test.java | 52 +++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 Robust/src/Tests/mlp/regression/makefile create mode 100755 Robust/src/Tests/mlp/regression/runTests create mode 100644 Robust/src/Tests/mlp/regression/test.java diff --git a/Robust/src/Tests/mlp/regression/makefile b/Robust/src/Tests/mlp/regression/makefile new file mode 100644 index 00000000..22e19777 --- /dev/null +++ b/Robust/src/Tests/mlp/regression/makefile @@ -0,0 +1,26 @@ +PROGRAM1=testSingle +PROGRAM2=testMulti + +SOURCE_FILES=test.java + +BUILDSCRIPT=~/research/Robust/src/buildscript + +USEMLP= -mlp 8 2 -mlpdebug # use to turn mlp on and off and make sure rest of build not broken +BSFLAGS= -nooptimize -debug -garbagestats -mainclass Test -ownership -ownallocdepth 1 -enable-assertions -ownaliasfile aliases.txt + +all: $(PROGRAM1).bin $(PROGRAM2).bin + +$(PROGRAM1).bin: $(SOURCE_FILES) + $(BUILDSCRIPT) $(USEMLP) $(BSFLAGS) -o $(PROGRAM1) $(SOURCE_FILES) + +$(PROGRAM2).bin: $(SOURCE_FILES) + $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM2) $(SOURCE_FILES) + +clean: + rm -f $(PROGRAM1).bin + rm -f $(PROGRAM2).bin + rm -fr tmpbuilddirectory + rm -f *~ + rm -f *.dot + rm -f *.png + rm -f aliases.txt diff --git a/Robust/src/Tests/mlp/regression/runTests b/Robust/src/Tests/mlp/regression/runTests new file mode 100755 index 00000000..31eb888e --- /dev/null +++ b/Robust/src/Tests/mlp/regression/runTests @@ -0,0 +1,3 @@ +./testSingle.bin 1 + +./testMulti.bin 1 diff --git a/Robust/src/Tests/mlp/regression/test.java b/Robust/src/Tests/mlp/regression/test.java new file mode 100644 index 00000000..ac7d9485 --- /dev/null +++ b/Robust/src/Tests/mlp/regression/test.java @@ -0,0 +1,52 @@ +public class Foo { + int f; + public Foo() {} +} + + +public class Test { + + public static void main( String args[] ) { + + int x = Integer.parseInt( args[0] ); + + + + //int y = Integer.parseInt( args[1] ); + + for( int i = 0; i < x; ++i ) { + + sese calc { + int sum = 0; + for( int j = 0; j <= i; ++j ) { + sum = sum + j; + } + } + + sese prnt { + mightPrint( x, i, sum ); + } + + } + + + + //Foo foo = new Foo(); + //foo.f = x; + //setTo3( foo ); + } + + public static void mightPrint( int x, int i, int sum ) { + if( i == x - 1 ) { + System.out.println( "sum of integers 0-"+i+" is "+sum ); + } + } + + /* + public static void setTo3( Foo foo ) { + sese func { + foo.f = 3; + } + } + */ +} -- 2.34.1