|
@ -1,7 +1,7 @@ |
|
|
#!/usr/bin/expect |
|
|
#!/usr/bin/expect |
|
|
|
|
|
|
|
|
set SUGAR_EXECUTABLE $::env(SUGAR_EXECUTABLE) |
|
|
set SUGAR_EXECUTABLE $::env(SUGAR_EXECUTABLE) |
|
|
set BUILD_NAME 005. |
|
|
|
|
|
|
|
|
set BUILD_NAME 006. |
|
|
|
|
|
|
|
|
proc abort {reason} { |
|
|
proc abort {reason} { |
|
|
puts "test failed $reason" |
|
|
puts "test failed $reason" |
|
@ -20,6 +20,8 @@ if {$value == 0} { |
|
|
abort "compiler didn't crash" |
|
|
abort "compiler didn't crash" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
spawn -noecho $SUGAR_EXECUTABLE "fake_01.006.not_a_file" lex |
|
|
spawn -noecho $SUGAR_EXECUTABLE "fake_01.006.not_a_file" lex |
|
|
expect { |
|
|
expect { |
|
|
error { abort "failed to parse" } |
|
|
error { abort "failed to parse" } |
|
@ -32,6 +34,8 @@ if {$value == 0} { |
|
|
abort "compiler didn't crash" |
|
|
abort "compiler didn't crash" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
spawn -noecho $SUGAR_EXECUTABLE "fake_01.006.not_a_file" lex-all |
|
|
spawn -noecho $SUGAR_EXECUTABLE "fake_01.006.not_a_file" lex-all |
|
|
expect { |
|
|
expect { |
|
|
error { abort "failed to parse" } |
|
|
error { abort "failed to parse" } |
|
@ -44,6 +48,8 @@ if {$value == 0} { |
|
|
abort "compiler didn't crash" |
|
|
abort "compiler didn't crash" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
spawn -noecho $SUGAR_EXECUTABLE "tests/005/library.mol" lex merge |
|
|
spawn -noecho $SUGAR_EXECUTABLE "tests/005/library.mol" lex merge |
|
|
expect { |
|
|
expect { |
|
|
error { abort "failed to parse" } |
|
|
error { abort "failed to parse" } |
|
@ -56,6 +62,8 @@ if {$value == 0} { |
|
|
abort "compiler didn't crash" |
|
|
abort "compiler didn't crash" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
spawn -noecho $SUGAR_EXECUTABLE merge |
|
|
spawn -noecho $SUGAR_EXECUTABLE merge |
|
|
expect { |
|
|
expect { |
|
|
error { abort "failed to parse" } |
|
|
error { abort "failed to parse" } |
|
@ -68,6 +76,8 @@ if {$value == 0} { |
|
|
abort "compiler didn't crash" |
|
|
abort "compiler didn't crash" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
spawn -noecho $SUGAR_EXECUTABLE parse |
|
|
spawn -noecho $SUGAR_EXECUTABLE parse |
|
|
expect { |
|
|
expect { |
|
|
error { abort "failed to parse" } |
|
|
error { abort "failed to parse" } |
|
@ -109,6 +119,8 @@ if {[file exists "/tmp/006.fake_target"]} { |
|
|
file delete "/tmp/006.fake_target" |
|
|
file delete "/tmp/006.fake_target" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
spawn -noecho $SUGAR_EXECUTABLE merge-all |
|
|
spawn -noecho $SUGAR_EXECUTABLE merge-all |
|
|
expect { |
|
|
expect { |
|
|
error { abort "failed to parse" } |
|
|
error { abort "failed to parse" } |
|
@ -133,6 +145,8 @@ if {$value == 0} { |
|
|
abort "compiler didn't crash" |
|
|
abort "compiler didn't crash" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
spawn -noecho $SUGAR_EXECUTABLE help |
|
|
spawn -noecho $SUGAR_EXECUTABLE help |
|
|
expect { |
|
|
expect { |
|
|
error { abort "failed to parse" } |
|
|
error { abort "failed to parse" } |
|
@ -145,6 +159,8 @@ if {$value != 0} { |
|
|
abort "compiler crashed displaying help" |
|
|
abort "compiler crashed displaying help" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
spawn -noecho $SUGAR_EXECUTABLE --help |
|
|
spawn -noecho $SUGAR_EXECUTABLE --help |
|
|
expect { |
|
|
expect { |
|
|
error { abort "failed to parse" } |
|
|
error { abort "failed to parse" } |
|
|