wicked cool test file added: script.sh
1 parent d759f98 commit b45d141e0da5f8ae1aa179cb576a6acd49f022bd
@glproj03 glproj03 authored on 28 Dec 2005
Showing 72 changed files
View
288
script.sh
echo "
This wicked cool script will test your Zwei compiler for conformity to expected behavior.
"
 
file="tests/4/Factorial.zwei"
file="tests/four/Factorial.zwei"
 
$SEPARATOR
echo "
Testing file $file. No errors should be returned.
$SEPARATOR
echo "Class typing"
$SEPARATOR
 
file="tests/4/01.zwei"
file="tests/four/01.zwei"
 
echo "Testing file $file :
Error in file : undeclared superclass \"b\" (line 1)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/02.zwei"
file="tests/four/02.zwei"
 
echo "Testing file $file :
Error in file : class \"a\" already declared (line 3)
"
$SEPARATOR
echo "Supertypes"
$SEPARATOR
 
file="tests/4/03.zwei"
file="tests/four/03.zwei"
 
echo "Testing file $file :
Error in file : illegal call of method \"equal\" : arguments have no common supertype (line 13)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/04.zwei"
file="tests/four/04.zwei"
 
echo "Testing file $file :
No error in file : arguments have common supertype
"
$SEPARATOR
echo "Class typing, courtesy M. Ganguin & J. Ruffin"
$SEPARATOR
 
file="tests/4/class00-1.zwei"
file="tests/four/class00-1.zwei"
 
echo "Testing file $file :
Error in file : undeclared superclass \"unknown\" (line 1)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/class00-2.zwei"
file="tests/four/class00-2.zwei"
 
echo "Testing file $file :
Error in file : class \"ClassSymbolTest\" already declared (line 3)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/class00-3.zwei"
file="tests/four/class00-3.zwei"
 
echo "Testing file $file :
Error in file : type \"RANDOM\" is unknown (class hasn't been declared) (line 3)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/class00-4.zwei"
file="tests/four/class00-4.zwei"
 
echo "Testing file $file :
Error in file : undeclared identifier \"NONE\" (line 3)
"
$SEPARATOR
echo "Field typing, courtesy M. Ganguin & J. Ruffin"
$SEPARATOR
 
file="tests/4/field00-1.zwei"
file="tests/four/field00-1.zwei"
 
echo "Testing file $file :
Error in file : type \"UNKNOWN\" is unknown (line 1)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/field00-2.zwei"
file="tests/four/field00-2.zwei"
 
echo "Testing file $file :
Recursive typing in classes (no error should be returned)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/field00-3.zwei"
file="tests/four/field00-3.zwei"
 
echo "Testing file $file :
Error in file : field \"a\" already declared (line 3)
"
$SEPARATOR
echo "Method typing, courtesy M. Ganguin & J. Ruffin"
$SEPARATOR
 
file="tests/4/method00-1.zwei"
file="tests/four/method00-1.zwei"
 
echo "Testing file $file :
Error in file : return type \"UNKNOWN\" is unknown (line 4)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/method00-2.zwei"
file="tests/four/method00-2.zwei"
 
echo "Testing file $file :
Error in file : argument type \"UNKNOWN\" is unknown (line 2)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/method00-3.zwei"
file="tests/four/method00-3.zwei"
 
echo "Testing file $file :
Error in file : Overriding method \"overrideTest\" in class \"MethodTest\" has bad return type. (line 14)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/method00-4.zwei"
file="tests/four/method00-4.zwei"
 
echo "Testing file $file :
Error in file : Overriding method \"overrideTest\" in class \"MethodTest\" has bad argument type. (line 11)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/method00-5.zwei"
file="tests/four/method00-5.zwei"
 
echo "Testing file $file :
Error in file : Method \"returnExpressionTypeTest\" does not return correct type. (line 8)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/method00-6.zwei"
file="tests/four/method00-6.zwei"
 
echo "Testing file $file :
Should return no errors : returning container class
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/method00-7.zwei"
file="tests/four/method00-7.zwei"
 
echo "Testing file $file :
Should return no errors : overriding and polymorphism
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/method00-8.zwei"
file="tests/four/method00-8.zwei"
 
echo "Testing file $file :
Should return no errors : testing variable scope
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/method00-9.zwei"
file="tests/four/method00-9.zwei"
 
echo "Testing file $file :
Should return no errors : checking method return types
"
$SEPARATOR
echo "Program typing, courtesy M. Ganguin & J. Ruffin"
$SEPARATOR
 
file="tests/4/program00-1.zwei"
file="tests/four/program00-1.zwei"
 
echo "Testing file $file :
Error in file : type \"RANDOM\" is unknown (line 1)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/program00-2.zwei"
file="tests/four/program00-2.zwei"
 
echo "Testing file $file :
Error in file : undeclared identifier \"k\" (line 3)
"
$SEPARATOR
echo "Statement typing, courtesy M. Ganguin & J. Ruffin"
$SEPARATOR
 
file="tests/4/statement-while.zwei"
file="tests/four/statement-while.zwei"
 
echo "Testing file $file :
Errors in file : * type mismatch (expected : Int, found : null) in condition (line 6)
* type mismatch (expected : Int, found : null) in statement (line 7)
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/statement-var.zwei"
file="tests/four/statement-var.zwei"
 
echo "Testing file $file :
Errors in file : * type \"nonexistent\" is unknown (line 8)
* undeclared class \"nonexistent\" (line 8)
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/statement-set.zwei"
file="tests/four/statement-set.zwei"
 
echo "Testing file $file :
Errors in file : * undeclared identifier \"s\" (line 10)
* type mismatch (expected : Int, found : foo) (line 11)
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/statement-do.zwei"
file="tests/four/statement-do.zwei"
 
echo "Testing file $file :
Errors in file : * type mismatch (expected : Int, found : null) (line 5)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/statement-printInt.zwei"
file="tests/four/statement-printInt.zwei"
 
echo "Testing file $file :
Errors in file : * type mismatch (expected : Int, found : foo) (line 7)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/statement-printChar.zwei"
file="tests/four/statement-printChar.zwei"
 
echo "Testing file $file :
Errors in file : * type mismatch (expected : Int, found : foo) (line 7)
"
$SEPARATOR
echo "Term typing, courtesy M. Ganguin & J. Ruffin"
$SEPARATOR
 
file="tests/4/term-ident.zwei"
file="tests/four/term-ident.zwei"
 
echo "Testing file $file :
Error in file : undeclared identifier \"y\" (line 6)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/term-select.zwei"
file="tests/four/term-select.zwei"
 
echo "Testing file $file :
Errors in file : * undeclared identifier \"k\" (line 16)
* undeclared field \"x\" in class \"foo\" (line 18)
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/term-call.zwei"
file="tests/four/term-call.zwei"
 
echo "Testing file $file :
Errors in file : * undeclared identifier \"k\" (line 20)
* undeclared method \"gneuh\" in class \"foo\" (line 21)
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/term-new.zwei"
file="tests/four/term-new.zwei"
 
echo "Testing file $file :
Errors in file : * undeclared class \"unknown\" (line 17)
* illegal use of class constructor (wrong number of arguments) (line 18)
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/term-unop.zwei"
file="tests/four/term-unop.zwei"
 
echo "Testing file $file :
Errors in file : * undeclared identifier \"y\" (line 6)
* type mismatch (unop can only be applied to Int) (line 7)
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/term-binop.zwei"
file="tests/four/term-binop.zwei"
 
echo "Testing file $file :
Errors in file : * undeclared identifier \"k\" (line 7)
* undeclared identifier \"l\" (line 8)
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/term-objComp.zwei"
file="tests/four/term-objComp.zwei"
 
echo "Testing file $file :
Errors in file : * two type mismatches (neither oprêrand is an Int) (line 18)
* undeclared identifier \"k\" (line 19)
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/term-if.zwei"
file="tests/four/term-if.zwei"
 
echo "Testing file $file :
Errors in file : * undeclared identifier \"k\" (line 21)
* condition in \"if\" is not an Int (line 22)
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/term-block.zwei"
file="tests/four/term-block.zwei"
 
echo "Testing file $file :
Errors in file : * type mismatch (expected return type : Int, found : null) (line 24)
* undeclared identifier \"y\" (outside of block scope) (line 29)
$SEPARATOR
echo "Various test files, courtesy R. Tagliani"
$SEPARATOR
 
file="tests/4/bionInt.zwei"
 
echo "Testing file $file :
No errors in file
"
 
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/blockvar.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/classes.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/classes0.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/expr_if.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/expr_readChar.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/expr_readInt.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/functions.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/new.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/null.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/printChar.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/printInt.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/select.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/unop.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/unopa.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/4/blockvar_2xerror0.zwei"
file="tests/four/bionInt.zwei"
 
echo "Testing file $file :
No errors in file
"
 
$COMMAND $file
 
$SEPARATOR
 
file="tests/four/blockvar.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/classes.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/classes0.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/expr_if.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/expr_readChar.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/expr_readInt.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/functions.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/new.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/null.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/printChar.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/printInt.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/select.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/unop.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/unopa.zwei"
 
echo "Testing file $file :
No errors in file
"
 
file="tests/four/blockvar_2xerror0.zwei"
 
echo "Testing file $file :
Errors in file : * undeclared identifier \"y\" (line 3)
* undeclared identifier \"z\" (line 4)
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/blockvar_error0.zwei"
file="tests/four/blockvar_error0.zwei"
 
echo "Testing file $file :
Errors in file : * undeclared identifier \"z\" (line 3)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/blockvar_error1.zwei"
file="tests/four/blockvar_error1.zwei"
 
echo "Testing file $file :
Errors in file : * variable \"x\" already declared (line 3)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/classes_error0.zwei"
file="tests/four/classes_error0.zwei"
 
echo "Testing file $file :
Errors in file : * class \"C1\" already declared (line 2)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/classes_error1.zwei"
file="tests/four/classes_error1.zwei"
 
echo "Testing file $file :
Errors in file : * undeclared superclass \"C1\" (line 2)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/classes_error2.zwei"
file="tests/four/classes_error2.zwei"
 
echo "Testing file $file :
Errors in file : * field \"a\" already declared (line 3)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/functions_error0.zwei"
file="tests/four/functions_error0.zwei"
 
echo "Testing file $file :
Errors in file : * method \"f1\" does not return correct type (line 2)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/functions_error1.zwei"
file="tests/four/functions_error1.zwei"
 
echo "Testing file $file :
Errors in file : * method \"f2\" does not return correct type (line 3)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/new_error0.zwei"
file="tests/four/new_error0.zwei"
 
echo "Testing file $file :
Errors in file : * illegal use of class constructor : argument types do not match (line 6)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/new_error0.zwei"
file="tests/four/new_error0.zwei"
 
echo "Testing file $file :
Errors in file : * illegal use of class constructor : wrong number of parameters (line 6)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/printChar_error0.zwei"
file="tests/four/printChar_error0.zwei"
 
echo "Testing file $file :
Errors in file : * program starts with block (line 0)
"
$COMMAND $file
 
$SEPARATOR
 
file="tests/4/unopa_error1.zwei"
file="tests/four/unopa_error1.zwei"
 
echo "Testing file $file :
Errors in file : * undeclared identifier \"b\" (line 3)
"
View
3
■■
tests/four/01.zwei 0 → 100755
class a extends b{}
 
2
View
tests/four/02.zwei 0 → 100755
View
tests/four/03.zwei 0 → 100755
View
tests/four/04.zwei 0 → 100755
View
tests/four/Factorial.zwei 0 → 100755
View
tests/four/binopInt.zwei 0 → 100755
View
tests/four/blockvar.zwei 0 → 100755
View
tests/four/blockvar_2xerror0.zwei 0 → 100755
View
tests/four/blockvar_error0.zwei 0 → 100755
View
tests/four/blockvar_error1.zwei 0 → 100755
View
tests/four/class00-1.zwei 0 → 100755
View
tests/four/class00-2.zwei 0 → 100755
View
tests/four/class00-3.zwei 0 → 100755
View
tests/four/class00-4.zwei 0 → 100755
View
tests/four/class00.zwei 0 → 100755
View
tests/four/classes.zwei 0 → 100755
View
tests/four/classes0.zwei 0 → 100755
View
tests/four/classes_error0.zwei 0 → 100755
View
tests/four/classes_error1.zwei 0 → 100755
View
tests/four/classes_error2.zwei 0 → 100755
View
tests/four/expr_if.zwei 0 → 100755
View
tests/four/expr_readChar.zwei 0 → 100755
View
tests/four/expr_readInt.zwei 0 → 100755
View
tests/four/field00-1.zwei 0 → 100755
View
tests/four/field00-2.zwei 0 → 100755
View
tests/four/field00-3.zwei 0 → 100755
View
tests/four/field00.zwei 0 → 100755
View
tests/four/functions_error0.zwei 0 → 100755
View
tests/four/functions_error1.zwei 0 → 100755
View
tests/four/method00-1.zwei 0 → 100755
View
tests/four/method00-2.zwei 0 → 100755
View
tests/four/method00-3.zwei 0 → 100755
View
tests/four/method00-4.zwei 0 → 100755
View
tests/four/method00-5.zwei 0 → 100755
View
tests/four/method00-6.zwei 0 → 100755
View
tests/four/method00-7.zwei 0 → 100755
View
tests/four/method00-8.zwei 0 → 100755
View
tests/four/method00-9.zwei 0 → 100755
View
tests/four/method00.zwei 0 → 100755
View
tests/four/new.zwei 0 → 100755
View
tests/four/new_error0.zwei 0 → 100755
View
tests/four/new_error1.zwei 0 → 100755
View
tests/four/null.zwei 0 → 100755
View
tests/four/printChar.zwei 0 → 100755
View
tests/four/printChar_error0.zwei 0 → 100755
View
tests/four/printInt.zwei 0 → 100755
View
tests/four/program00-1.zwei 0 → 100755
View
tests/four/program00-2.zwei 0 → 100755
View
tests/four/program00.zwei 0 → 100755
View
tests/four/select.zwei 0 → 100755
View
tests/four/statement-do.zwei 0 → 100755
View
tests/four/statement-printChar.zwei 0 → 100755
View
tests/four/statement-printInt.zwei 0 → 100755
View
tests/four/statement-set.zwei 0 → 100755
View
tests/four/statement-var.zwei 0 → 100755
View
tests/four/statement-while.zwei 0 → 100755
View
tests/four/statement00.zwei 0 → 100755
View
tests/four/term-binop.zwei 0 → 100755
View
tests/four/term-block.zwei 0 → 100755
View
tests/four/term-call.zwei 0 → 100755
View
tests/four/term-ident.zwei 0 → 100755
View
tests/four/term-if.zwei 0 → 100755
View
tests/four/term-new.zwei 0 → 100755
View
tests/four/term-objComp.zwei 0 → 100755
View
tests/four/term-select.zwei 0 → 100755
View
tests/four/term-unop.zwei 0 → 100755
View
tests/four/term00.zwei 0 → 100755
View
tests/four/unop.zwei 0 → 100755
View
tests/four/unopa.zwei 0 → 100755
View
tests/four/unopa_error1.zwei 0 → 100755
View
tests/four/varScope_error0.zwei 0 → 100755