summaryrefslogtreecommitdiff
path: root/test/bin
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2004-03-24 10:02:15 +0000
committerpaltherr <paltherr@epfl.ch>2004-03-24 10:02:15 +0000
commit1a380153a02d4a745b95b6083b6318c059e4a89d (patch)
tree36cedeb9664591e32fddc76cbaf7472833f3f5a4 /test/bin
parent302643672d49a475f5b3117eccd161b40c76b172 (diff)
downloadscala-1a380153a02d4a745b95b6083b6318c059e4a89d.tar.gz
scala-1a380153a02d4a745b95b6083b6318c059e4a89d.tar.bz2
scala-1a380153a02d4a745b95b6083b6318c059e4a89d.zip
- Added target --dis
Diffstat (limited to 'test/bin')
-rwxr-xr-xtest/bin/scala-test34
1 files changed, 33 insertions, 1 deletions
diff --git a/test/bin/scala-test b/test/bin/scala-test
index 624a635c0a..d95956f8e3 100755
--- a/test/bin/scala-test
+++ b/test/bin/scala-test
@@ -161,6 +161,28 @@ test_xml() {
rm -rf "$output";
}
+test_disassembler() {
+ scalapargs="`expr "$source" : "\(.*\)\\.scala"`.args";
+ if [ -f "$scalapargs" ]; then
+ SCALAP_ARGS=`cat "$scalapargs"`;
+ else
+ SCALAP_ARGS="";
+ fi;
+ output="$OBJDIR"/`expr "$source" : "\(.*\)\\.scala"`-$KIND.obj;
+ classpath="$output";
+ if $CYGWIN; then
+ classpath=`cygpath -w -p "$classpath"`;
+ os_output=`cygpath -w "$output"`;
+ else
+ os_output="$output";
+ fi;
+ rm -rf "$output";
+ mkdir -p "$output" &&
+ $SOCOS -d "$os_output" $TEST_FLAGS $FLAGS "$source" &&
+ $SCALAP -classpath "$classpath" $SCALAP_ARGS &&
+ rm -rf "$output";
+}
+
test_compilation_success() {
output="$OBJDIR"/`expr "$source" : "\(.*\)\\.scala"`-$KIND.obj;
if $CYGWIN; then
@@ -305,6 +327,8 @@ test_all() {
test_shell "shl" $FILES_SHL;
test_one "Testing dtd2scala tool" \
test_xml "xml" $FILES_XML;
+ test_one "Testing disassembler" \
+ test_disassembler "dis" $FILES_DIS;
test_one "Testing compiler (on files whose compilation should succeed)" \
test_compilation_success "pos" $FILES_POS;
test_one "Testing compiler (on files whose compilation should fail)" \
@@ -329,6 +353,7 @@ print_help() {
echo "--int next files test the interpreter";
echo "--shl next files test the interpreter shell";
echo "--xml next files test the dtd2scala tool";
+ echo "--dis next files test the disassembler";
echo "--pos next files test a compilation success";
echo "--neg next files test a compilation failure";
echo "--msil next files test the .NET backend (requires Cygwin)"
@@ -432,6 +457,7 @@ add_file() {
int ) FILES_INT="$FILES_INT $1"; return;;
shl ) FILES_SHL="$FILES_SHL $1"; return;;
xml ) FILES_XML="$FILES_XML $1"; return;;
+ dis ) FILES_DIS="$FILES_DIS $1"; return;;
pos ) FILES_POS="$FILES_POS $1"; return;;
neg ) FILES_NEG="$FILES_NEG $1"; return;;
msil ) FILES_MSIL="$FILES_MSIL $1"; return;;
@@ -443,6 +469,7 @@ add_file() {
int | */int | */int/* | int/* ) FILES_INT="$FILES_INT $1";;
shl | */shl | */shl/* | shl/* ) FILES_SHL="$FILES_SHL $1";;
xml | */xml | */xml/* | xml/* ) FILES_XML="$FILES_XML $1";;
+ dis | */dis | */dis/* | dis/* ) FILES_DIS="$FILES_DIS $1";;
pos | */pos | */pos/* | pos/* ) FILES_POS="$FILES_POS $1";;
neg | */neg | */neg/* | neg/* ) FILES_NEG="$FILES_NEG $1";;
msil | */msil | */msil/* | msil/* ) FILES_MSIL="$FILES_MSIL $1";;
@@ -469,6 +496,7 @@ main() {
FILES_INT="";
FILES_SHL="";
FILES_XML="";
+ FILES_DIS="";
FILES_POS="";
FILES_NEG="";
FILES_MSIL="";
@@ -486,11 +514,11 @@ main() {
case "$1" in
--auto ) TEST_TYPE="auto"; shift 1;;
--run ) TEST_TYPE="run"; shift 1;;
- --shl ) TEST_TYPE="shl"; shift 1;;
--jvm ) TEST_TYPE="jvm"; shift 1;;
--int ) TEST_TYPE="int"; shift 1;;
--shl ) TEST_TYPE="shl"; shift 1;;
--xml ) TEST_TYPE="xml"; shift 1;;
+ --dis ) TEST_TYPE="dis"; shift 1;;
--pos ) TEST_TYPE="pos"; shift 1;;
--neg ) TEST_TYPE="neg"; shift 1;;
--msil ) TEST_TYPE="msil"; shift 1;;
@@ -532,6 +560,7 @@ main() {
find_program SURUS scalarun;
find_program SCALA scala;
find_program DTD2SCALA dtd2scala;
+ find_program SCALAP scalap;
find_program SCALA_INFO scala-info;
if [ "$BOOT" = true ]; then
@@ -555,6 +584,9 @@ main() {
auto | xml ) FILES_XML="$FILES_XML $SRCDIR/xml";;
esac;
case "$TEST_TYPE" in
+ auto | dis ) FILES_DIS="$FILES_DIS $SRCDIR/dis";;
+ esac;
+ case "$TEST_TYPE" in
auto | pos ) FILES_POS="$FILES_POS $SRCDIR/pos";;
esac;
case "$TEST_TYPE" in