summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar mikebarnett <unknown>2010-04-19 02:56:42 +0000
committerGravatar mikebarnett <unknown>2010-04-19 02:56:42 +0000
commit908cc752853aa7abffc7b97ba751d050c7839172 (patch)
tree6fd752a09d4ed1e979f6794e7585d29523e5c787
parentd522d8078db3adfdf41f201bb38f105a7c0bbab1 (diff)
New, simpler way of running regressions.
-rw-r--r--BCT/Test/runtest.bat4
-rw-r--r--BCT/Test/test0/Answer99
-rw-r--r--BCT/Test/test0/runtest.bat19
-rw-r--r--BCT/Test/test0/stmts.cs57
4 files changed, 177 insertions, 2 deletions
diff --git a/BCT/Test/runtest.bat b/BCT/Test/runtest.bat
index e502c917..21a71139 100644
--- a/BCT/Test/runtest.bat
+++ b/BCT/Test/runtest.bat
@@ -1,11 +1,11 @@
-@echo off
+rem @echo off
rem Usage: runtest.bat <dir>
if "%1" == "" goto noDirSpecified
if not exist %1\nul goto noDirExists
echo ----- Running regression test %1
pushd %1
if not exist runtest.bat goto noRunTest
-call runtest.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 > Output.txt
+call runtest.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
fc /W Answer Output.txt > nul
:: if not errorlevel 1 goto passTest
:: echo FAILED
diff --git a/BCT/Test/test0/Answer b/BCT/Test/test0/Answer
new file mode 100644
index 00000000..14fd2430
--- /dev/null
+++ b/BCT/Test/test0/Answer
@@ -0,0 +1,99 @@
+const unique BCTStmtTest.Program.i: int;
+
+procedure BCTStmtTest.Program.BCTAssignments$System.Void($inst: int, j$in: int);
+
+
+
+implementation BCTStmtTest.Program.BCTAssignments$System.Void($inst: int, j$in: int)
+{
+ var local_0: int;
+ var j: int;
+
+ j := j$in;
+ $heap[$this, BCTStmtTest.Program.i] := 7;
+ $heap[$this, BCTStmtTest.Program.i] := local_0 / j;
+ return;
+}
+
+
+
+procedure BCTStmtTest.Program.BCTConditional$System.Int32($inst: int, k$in: int) returns ($result: int);
+
+
+
+implementation BCTStmtTest.Program.BCTConditional$System.Int32($inst: int, k$in: int) returns ($result: int)
+{
+ var local_1: int;
+ var local_0: int;
+ var k: int;
+
+ k := k$in;
+ if (k > 5)
+ {
+ local_1 := 7;
+ goto IL_0055;
+ }
+ else
+ {
+ }
+
+ local_0 := k / 2;
+ if (local_0 < k)
+ {
+ local_0 := 2;
+ }
+ else
+ {
+ }
+
+ if (k > 5)
+ {
+ local_1 := 7;
+ goto IL_0055;
+ }
+ else
+ {
+ }
+
+ if (k < 5)
+ {
+ local_0 := k / 2;
+ }
+ else
+ {
+ local_1 := 100;
+ goto IL_0055;
+ }
+
+ IL_0055:
+ $result := local_1;
+ return;
+}
+
+
+
+procedure BCTStmtTest.Program.Main$System.Void($inst: int, args$in: int);
+
+
+
+implementation BCTStmtTest.Program.Main$System.Void($inst: int, args$in: int)
+{
+ var args: int;
+
+ args := args$in;
+ return;
+}
+
+
+
+procedure BCTStmtTest.Program..ctor$System.Void($inst: int);
+
+
+
+implementation BCTStmtTest.Program..ctor$System.Void($inst: int)
+{
+ return;
+}
+
+
+;ENDE
diff --git a/BCT/Test/test0/runtest.bat b/BCT/Test/test0/runtest.bat
new file mode 100644
index 00000000..b0f8950e
--- /dev/null
+++ b/BCT/Test/test0/runtest.bat
@@ -0,0 +1,19 @@
+REM @echo off
+setlocal
+
+set BCTDIR=..\..\Binaries
+set BEXE=%BCTDIR%\BytecodeTranslator.exe
+
+if not exist Output.txt goto justRunTest
+del Output.txt
+
+:justRunTest
+for %%f in (*.cs) do (
+ echo -------------------- %%f --------------------
+ csc /t:library /debug %%~nf.cs
+ %BEXE% %%~nf.dll
+ type %%~nf.bpl >> Output.txt
+)
+
+
+
diff --git a/BCT/Test/test0/stmts.cs b/BCT/Test/test0/stmts.cs
new file mode 100644
index 00000000..a4c5e223
--- /dev/null
+++ b/BCT/Test/test0/stmts.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace BCTStmtTest
+{
+ class Program
+ {
+ private int i;
+
+ void BCTAssignments(int j)
+ {
+ i = 7;
+ int k;
+ k = i + 20;
+ i = k / j;
+ }
+
+ int BCTConditional(int k)
+ {
+ int i=0;
+ if (k > 5) // ite
+ {
+ return 7;
+ }
+ else
+ {
+ i = k / 2;
+ }
+
+ if (i < k) //if without else
+ {
+ i = 2;
+ }
+
+ if (k > 5) // else if
+ {
+ return 7;
+ }
+ else if (k < 5)
+ {
+ i = k / 2;
+ }
+ else
+ {
+ return 100;
+ }
+ return 0;
+ }
+
+ static void Main(string[] args)
+ {
+
+ }
+ }
+}