From 925e358424d36cf2213b4a3300d3c525961bf35f Mon Sep 17 00:00:00 2001 From: Charlie Hines Date: Mon, 4 Feb 2019 13:18:48 -0500 Subject: [PATCH] make a script to run all sample programs and test their outputs --- .gitignore | 2 + README.md | 8 +- compile.sh | 2 +- dotests.sh | 129 ++++++++++++++++++ tests/comp/outputs/3np1for_compile.exp | 0 tests/comp/outputs/3np1for_run.exp | 3 + tests/comp/outputs/3np1for_test.exp | 5 + tests/comp/outputs/3np1while_compile.exp | 0 tests/comp/outputs/3np1while_run.exp | 1 + tests/comp/outputs/3np1while_test.exp | 5 + tests/comp/outputs/abracadabra_compile.exp | 0 tests/comp/outputs/abracadabra_run.exp | 15 ++ tests/comp/outputs/abracadabra_test.exp | 28 ++++ tests/comp/outputs/different_compile.exp | 0 tests/comp/outputs/different_run.exp | 3 + tests/comp/outputs/different_test.exp | 5 + tests/comp/outputs/fizzbuzz_compile.exp | 0 tests/comp/outputs/fizzbuzz_run.exp | 21 +++ tests/comp/outputs/fizzbuzz_test.exp | 28 ++++ tests/comp/outputs/oddgnome_compile.exp | 0 tests/comp/outputs/oddgnome_run.exp | 3 + tests/comp/outputs/oddgnome_test.exp | 5 + tests/failing/outputs/add_compile.exp | 0 tests/failing/outputs/add_run.exp | 3 + tests/failing/outputs/add_test.exp | 43 ++++++ tests/failing/outputs/list_remove_compile.exp | 11 ++ tests/failing/outputs/list_remove_run.exp | 3 + tests/failing/outputs/list_remove_test.exp | 43 ++++++ tests/failing/outputs/z_compile.exp | 6 + tests/failing/outputs/z_run.exp | 3 + tests/failing/outputs/z_test.exp | 43 ++++++ tests/io/outputs/add_compile.exp | 1 + tests/io/outputs/add_run.exp | 3 + tests/io/outputs/add_test.exp | 28 ++++ tests/io/outputs/collections_compile.exp | 10 ++ tests/io/outputs/collections_run.exp | 3 + tests/io/outputs/collections_test.exp | 28 ++++ tests/io/outputs/for-loop_compile.exp | 1 + tests/io/outputs/for-loop_run.exp | 3 + tests/io/outputs/for-loop_test.exp | 28 ++++ tests/io/outputs/hello-world_compile.exp | 0 tests/io/outputs/hello-world_run.exp | 1 + tests/io/outputs/hello-world_test.exp | 28 ++++ tests/io/outputs/input2_compile.exp | 1 + tests/io/outputs/input2_run.exp | 3 + tests/io/outputs/input2_test.exp | 28 ++++ tests/io/outputs/input_compile.exp | 0 tests/io/outputs/input_run.exp | 5 + tests/io/outputs/input_test.exp | 28 ++++ tests/io/outputs/print_compile.exp | 23 ++++ tests/io/outputs/print_run.exp | 5 + tests/io/outputs/print_test.exp | 28 ++++ tests/io/outputs/sum_compile.exp | 1 + tests/io/outputs/sum_run.exp | 3 + tests/io/outputs/sum_test.exp | 28 ++++ tests/outputs/bracket-access_compile.exp | 0 tests/outputs/bracket-access_run.exp | 3 + tests/outputs/bracket-access_test.exp | 5 + tests/outputs/car_compile.exp | 0 tests/outputs/car_run.exp | 3 + tests/outputs/car_test.exp | 5 + tests/outputs/collections_compile.exp | 0 tests/outputs/collections_run.exp | 3 + tests/outputs/collections_test.exp | 5 + tests/outputs/counterexample_compile.exp | 11 ++ tests/outputs/counterexample_run.exp | 3 + tests/outputs/counterexample_test.exp | 5 + tests/outputs/demo_compile.exp | 0 tests/outputs/demo_run.exp | 20 +++ tests/outputs/demo_test.exp | 36 +++++ tests/outputs/dog_compile.exp | 0 tests/outputs/dog_run.exp | 3 + tests/outputs/dog_test.exp | 5 + tests/outputs/eqtests_compile.exp | 0 tests/outputs/eqtests_run.exp | 3 + tests/outputs/eqtests_test.exp | 5 + tests/outputs/fact_compile.exp | 0 tests/outputs/fact_run.exp | 3 + tests/outputs/fact_test.exp | 5 + tests/outputs/forloop_compile.exp | 0 tests/outputs/forloop_run.exp | 3 + tests/outputs/forloop_test.exp | 5 + tests/outputs/format_compile.exp | 0 tests/outputs/format_run.exp | 1 + tests/outputs/format_test.exp | 5 + tests/outputs/fp_compile.exp | 0 tests/outputs/fp_run.exp | 3 + tests/outputs/fp_test.exp | 5 + tests/outputs/global_compile.exp | 0 tests/outputs/global_run.exp | 3 + tests/outputs/global_test.exp | 28 ++++ tests/outputs/oop_compile.exp | 0 tests/outputs/oop_run.exp | 3 + tests/outputs/oop_test.exp | 5 + tests/outputs/precedence_compile.exp | 0 tests/outputs/precedence_run.exp | 1 + tests/outputs/precedence_test.exp | 5 + tests/outputs/primitive-numbers_compile.exp | 0 tests/outputs/primitive-numbers_run.exp | 3 + tests/outputs/primitive-numbers_test.exp | 79 +++++++++++ tests/outputs/quicksort_compile.exp | 0 tests/outputs/quicksort_run.exp | 3 + tests/outputs/quicksort_test.exp | 5 + tests/outputs/shadow_compile.exp | 0 tests/outputs/shadow_run.exp | 3 + tests/outputs/shadow_test.exp | 5 + tests/outputs/type-inference_compile.exp | 0 tests/outputs/type-inference_run.exp | 3 + tests/outputs/type-inference_test.exp | 5 + tests/outputs/unit-test_compile.exp | 0 tests/outputs/unit-test_run.exp | 3 + tests/outputs/unit-test_test.exp | 5 + tests/outputs/unop_compile.exp | 0 tests/outputs/unop_run.exp | 1 + tests/outputs/unop_test.exp | 28 ++++ tests/user-submitted/outputs/kyle_compile.exp | 0 tests/user-submitted/outputs/kyle_run.exp | 1 + tests/user-submitted/outputs/kyle_test.exp | 28 ++++ .../outputs/payroll_compile.exp | 0 tests/user-submitted/outputs/payroll_run.exp | 3 + tests/user-submitted/outputs/payroll_test.exp | 28 ++++ 121 files changed, 1096 insertions(+), 2 deletions(-) create mode 100755 dotests.sh create mode 100644 tests/comp/outputs/3np1for_compile.exp create mode 100644 tests/comp/outputs/3np1for_run.exp create mode 100644 tests/comp/outputs/3np1for_test.exp create mode 100644 tests/comp/outputs/3np1while_compile.exp create mode 100644 tests/comp/outputs/3np1while_run.exp create mode 100644 tests/comp/outputs/3np1while_test.exp create mode 100644 tests/comp/outputs/abracadabra_compile.exp create mode 100644 tests/comp/outputs/abracadabra_run.exp create mode 100644 tests/comp/outputs/abracadabra_test.exp create mode 100644 tests/comp/outputs/different_compile.exp create mode 100644 tests/comp/outputs/different_run.exp create mode 100644 tests/comp/outputs/different_test.exp create mode 100644 tests/comp/outputs/fizzbuzz_compile.exp create mode 100644 tests/comp/outputs/fizzbuzz_run.exp create mode 100644 tests/comp/outputs/fizzbuzz_test.exp create mode 100644 tests/comp/outputs/oddgnome_compile.exp create mode 100644 tests/comp/outputs/oddgnome_run.exp create mode 100644 tests/comp/outputs/oddgnome_test.exp create mode 100644 tests/failing/outputs/add_compile.exp create mode 100644 tests/failing/outputs/add_run.exp create mode 100644 tests/failing/outputs/add_test.exp create mode 100644 tests/failing/outputs/list_remove_compile.exp create mode 100644 tests/failing/outputs/list_remove_run.exp create mode 100644 tests/failing/outputs/list_remove_test.exp create mode 100644 tests/failing/outputs/z_compile.exp create mode 100644 tests/failing/outputs/z_run.exp create mode 100644 tests/failing/outputs/z_test.exp create mode 100644 tests/io/outputs/add_compile.exp create mode 100644 tests/io/outputs/add_run.exp create mode 100644 tests/io/outputs/add_test.exp create mode 100644 tests/io/outputs/collections_compile.exp create mode 100644 tests/io/outputs/collections_run.exp create mode 100644 tests/io/outputs/collections_test.exp create mode 100644 tests/io/outputs/for-loop_compile.exp create mode 100644 tests/io/outputs/for-loop_run.exp create mode 100644 tests/io/outputs/for-loop_test.exp create mode 100644 tests/io/outputs/hello-world_compile.exp create mode 100644 tests/io/outputs/hello-world_run.exp create mode 100644 tests/io/outputs/hello-world_test.exp create mode 100644 tests/io/outputs/input2_compile.exp create mode 100644 tests/io/outputs/input2_run.exp create mode 100644 tests/io/outputs/input2_test.exp create mode 100644 tests/io/outputs/input_compile.exp create mode 100644 tests/io/outputs/input_run.exp create mode 100644 tests/io/outputs/input_test.exp create mode 100644 tests/io/outputs/print_compile.exp create mode 100644 tests/io/outputs/print_run.exp create mode 100644 tests/io/outputs/print_test.exp create mode 100644 tests/io/outputs/sum_compile.exp create mode 100644 tests/io/outputs/sum_run.exp create mode 100644 tests/io/outputs/sum_test.exp create mode 100644 tests/outputs/bracket-access_compile.exp create mode 100644 tests/outputs/bracket-access_run.exp create mode 100644 tests/outputs/bracket-access_test.exp create mode 100644 tests/outputs/car_compile.exp create mode 100644 tests/outputs/car_run.exp create mode 100644 tests/outputs/car_test.exp create mode 100644 tests/outputs/collections_compile.exp create mode 100644 tests/outputs/collections_run.exp create mode 100644 tests/outputs/collections_test.exp create mode 100644 tests/outputs/counterexample_compile.exp create mode 100644 tests/outputs/counterexample_run.exp create mode 100644 tests/outputs/counterexample_test.exp create mode 100644 tests/outputs/demo_compile.exp create mode 100644 tests/outputs/demo_run.exp create mode 100644 tests/outputs/demo_test.exp create mode 100644 tests/outputs/dog_compile.exp create mode 100644 tests/outputs/dog_run.exp create mode 100644 tests/outputs/dog_test.exp create mode 100644 tests/outputs/eqtests_compile.exp create mode 100644 tests/outputs/eqtests_run.exp create mode 100644 tests/outputs/eqtests_test.exp create mode 100644 tests/outputs/fact_compile.exp create mode 100644 tests/outputs/fact_run.exp create mode 100644 tests/outputs/fact_test.exp create mode 100644 tests/outputs/forloop_compile.exp create mode 100644 tests/outputs/forloop_run.exp create mode 100644 tests/outputs/forloop_test.exp create mode 100644 tests/outputs/format_compile.exp create mode 100644 tests/outputs/format_run.exp create mode 100644 tests/outputs/format_test.exp create mode 100644 tests/outputs/fp_compile.exp create mode 100644 tests/outputs/fp_run.exp create mode 100644 tests/outputs/fp_test.exp create mode 100644 tests/outputs/global_compile.exp create mode 100644 tests/outputs/global_run.exp create mode 100644 tests/outputs/global_test.exp create mode 100644 tests/outputs/oop_compile.exp create mode 100644 tests/outputs/oop_run.exp create mode 100644 tests/outputs/oop_test.exp create mode 100644 tests/outputs/precedence_compile.exp create mode 100644 tests/outputs/precedence_run.exp create mode 100644 tests/outputs/precedence_test.exp create mode 100644 tests/outputs/primitive-numbers_compile.exp create mode 100644 tests/outputs/primitive-numbers_run.exp create mode 100644 tests/outputs/primitive-numbers_test.exp create mode 100644 tests/outputs/quicksort_compile.exp create mode 100644 tests/outputs/quicksort_run.exp create mode 100644 tests/outputs/quicksort_test.exp create mode 100644 tests/outputs/shadow_compile.exp create mode 100644 tests/outputs/shadow_run.exp create mode 100644 tests/outputs/shadow_test.exp create mode 100644 tests/outputs/type-inference_compile.exp create mode 100644 tests/outputs/type-inference_run.exp create mode 100644 tests/outputs/type-inference_test.exp create mode 100644 tests/outputs/unit-test_compile.exp create mode 100644 tests/outputs/unit-test_run.exp create mode 100644 tests/outputs/unit-test_test.exp create mode 100644 tests/outputs/unop_compile.exp create mode 100644 tests/outputs/unop_run.exp create mode 100644 tests/outputs/unop_test.exp create mode 100644 tests/user-submitted/outputs/kyle_compile.exp create mode 100644 tests/user-submitted/outputs/kyle_run.exp create mode 100644 tests/user-submitted/outputs/kyle_test.exp create mode 100644 tests/user-submitted/outputs/payroll_compile.exp create mode 100644 tests/user-submitted/outputs/payroll_run.exp create mode 100644 tests/user-submitted/outputs/payroll_test.exp diff --git a/.gitignore b/.gitignore index cee5f34..0444154 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ build/ .project .settings/ +tests/**/outputs/*.diff +tests/**/outputs/*.out diff --git a/README.md b/README.md index 96c8323..2039cef 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,10 @@ Get gradle aliases from my .dotfiles repo: [Gradle Aliases](https://github.com/Z 4. How to run the tests in the most recently compiled file: * `./test.sh` -5. If you would like to use Eclipse, then run `gradle eclipse` to generate project files. +5. How to run all sample files against previously-known output: + * `./dotests.sh -r tests` + +6. How to set expected output for a sample file: + * `./dotests.sh -s ` + +7. If you would like to use Eclipse, then run `gradle eclipse` to generate project files. diff --git a/compile.sh b/compile.sh index e7f0188..45ca425 100755 --- a/compile.sh +++ b/compile.sh @@ -1,4 +1,4 @@ #!/bin/bash -gradle run -Ptestfile=${1} +gradle -q run -Ptestfile=${1} diff --git a/dotests.sh b/dotests.sh new file mode 100755 index 0000000..e77291a --- /dev/null +++ b/dotests.sh @@ -0,0 +1,129 @@ +#! /bin/bash + +# Prints a help message to stdout +help() { + echo "Usage: $0 [options] file..." + echo "" + echo " Options:" + echo " -h Print this help message and exit" + echo " -r Recursively run all LJ files in the given directory" + echo " -s Set the expected output for the LJ files to their actual output." + echo " If -s option not present, LJ file output will be compared to the previous expected output" +} + +# Takes the name of a file. If the input file is a LJ file, compile and run it. +# If the -s option is used, copy the outputs to the expected outputs file. +# Otherwise, show a diff between the expected and actual output. +# If the input file is a directory and the -r option is given, call test on the +# directory's contents +test() { + local file=${1%"/"} + if [ -f $file ] && [[ $file =~ .*\.lj ]]; then + parent=$(dirname $file) + base=$(basename $file) + name=${base%.*} + outdir=$parent/outputs + base=$outdir/$name + mkdir -p $outdir + echo "Compiling $file" + ./compile.sh $file 2>&1 | grep -wvi time > $base\_compile.out + echo "Done compiling" + echo + echo "Running $file" + ./run.sh 2>&1 | tee $base\_run.out + echo "Done running" + echo + echo "Running tests for $file" + ./test.sh 2>&1 | grep -wvi time > $base\_test.out + echo "Done testing" + echo + if $set_expected; then + cp $base\_compile.out $base\_compile.exp + cp $base\_run.out $base\_run.exp + cp $base\_test.out $base\_test.exp + else + touch $base\_compile.exp + touch $base\_run.exp + touch $base\_test.exp + diff -u $base\_compile.out $base\_compile.exp > $base\_compile.diff + if [ -s $base\_compile.diff ]; then + ((changes_found += 1)) + echo "Changes detected in compile output; use -s option to set expected output" + echo + cat $base\_compile.diff + echo + fi + diff -u $base\_run.out $base\_run.exp > $base\_run.diff + if [ -s $base\_run.diff ]; then + ((changes_found += 1)) + echo "Changes detected in run output; use -s option to set expected output" + echo + cat $base\_run.diff + echo + fi + diff -u $base\_test.out $base\_test.exp > $base\_test.diff + if [ -s $base\_test.diff ]; then + ((changes_found += 1)) + echo "Changes detected in test output; use -s option to set expected output" + echo + cat $base\_test.diff + echo + fi + fi + elif [ -d $file ] && $recursive; then + for sub in $(ls $file); do + test $file/$sub + done + fi +} + +help_flag=false +recursive=false +set_expected=false + +# Parse flags +while getopts :hrs flag; do + case $flag in + h) + help_flag=true + ;; + r) + recursive=true + ;; + s) + set_expected=true + ;; + \?) + echo "Unexpected flag $OPTARG" 1>&2 + echo + help + exit + ;; + esac +done +shift $((OPTIND - 1)) + +if $help_flag; then + help + exit +fi + +# Make sure there's at least one file given +if [ $# == 0 ]; then + echo "Expecting at least one file" 1>&2 + echo + help + exit +fi + +changes_found=0 + +# For each input file f: +for f in $@; do + test $f +done + +# Show how many changes were detected +if [ $set_expected == false ]; then + echo "Detected $changes_found changed outputs" +fi diff --git a/tests/comp/outputs/3np1for_compile.exp b/tests/comp/outputs/3np1for_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/comp/outputs/3np1for_run.exp b/tests/comp/outputs/3np1for_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/comp/outputs/3np1for_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/comp/outputs/3np1for_test.exp b/tests/comp/outputs/3np1for_test.exp new file mode 100644 index 0000000..c1340a8 --- /dev/null +++ b/tests/comp/outputs/3np1for_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +.... + +OK (4 tests) + diff --git a/tests/comp/outputs/3np1while_compile.exp b/tests/comp/outputs/3np1while_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/comp/outputs/3np1while_run.exp b/tests/comp/outputs/3np1while_run.exp new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/comp/outputs/3np1while_run.exp @@ -0,0 +1 @@ +1 diff --git a/tests/comp/outputs/3np1while_test.exp b/tests/comp/outputs/3np1while_test.exp new file mode 100644 index 0000000..f2e9c1a --- /dev/null +++ b/tests/comp/outputs/3np1while_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +...... + +OK (6 tests) + diff --git a/tests/comp/outputs/abracadabra_compile.exp b/tests/comp/outputs/abracadabra_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/comp/outputs/abracadabra_run.exp b/tests/comp/outputs/abracadabra_run.exp new file mode 100644 index 0000000..9499ebc --- /dev/null +++ b/tests/comp/outputs/abracadabra_run.exp @@ -0,0 +1,15 @@ +1 Abracadabra +2 Abracadabra +3 Abracadabra +4 Abracadabra +5 Abracadabra +1 Abracadabra +2 Abracadabra +3 Abracadabra +4 Abracadabra +5 Abracadabra +6 Abracadabra +7 Abracadabra +8 Abracadabra +9 Abracadabra +10 Abracadabra diff --git a/tests/comp/outputs/abracadabra_test.exp b/tests/comp/outputs/abracadabra_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/comp/outputs/abracadabra_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 + diff --git a/tests/comp/outputs/different_compile.exp b/tests/comp/outputs/different_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/comp/outputs/different_run.exp b/tests/comp/outputs/different_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/comp/outputs/different_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/comp/outputs/different_test.exp b/tests/comp/outputs/different_test.exp new file mode 100644 index 0000000..c1340a8 --- /dev/null +++ b/tests/comp/outputs/different_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +.... + +OK (4 tests) + diff --git a/tests/comp/outputs/fizzbuzz_compile.exp b/tests/comp/outputs/fizzbuzz_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/comp/outputs/fizzbuzz_run.exp b/tests/comp/outputs/fizzbuzz_run.exp new file mode 100644 index 0000000..6562d83 --- /dev/null +++ b/tests/comp/outputs/fizzbuzz_run.exp @@ -0,0 +1,21 @@ +1 +Fizz +Buzz +Fizz +5 +FizzBuzz +7 +1 +Fizz +3 +FizzBuzz +5 +Fizz +7 +1 +2 +Fizz +4 +Buzz +Fizz +7 diff --git a/tests/comp/outputs/fizzbuzz_test.exp b/tests/comp/outputs/fizzbuzz_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/comp/outputs/fizzbuzz_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 + diff --git a/tests/comp/outputs/oddgnome_compile.exp b/tests/comp/outputs/oddgnome_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/comp/outputs/oddgnome_run.exp b/tests/comp/outputs/oddgnome_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/comp/outputs/oddgnome_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/comp/outputs/oddgnome_test.exp b/tests/comp/outputs/oddgnome_test.exp new file mode 100644 index 0000000..d7f32c8 --- /dev/null +++ b/tests/comp/outputs/oddgnome_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +. + +OK (1 test) + diff --git a/tests/failing/outputs/add_compile.exp b/tests/failing/outputs/add_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/failing/outputs/add_run.exp b/tests/failing/outputs/add_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/failing/outputs/add_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/failing/outputs/add_test.exp b/tests/failing/outputs/add_test.exp new file mode 100644 index 0000000..9f29a95 --- /dev/null +++ b/tests/failing/outputs/add_test.exp @@ -0,0 +1,43 @@ +JUnit version 4.12 +.E. +There was 1 failure: +1) test0(Main) +java.lang.AssertionError: expected:<3> but was:<3.0> + at org.junit.Assert.fail(Assert.java:88) + at org.junit.Assert.failNotEquals(Assert.java:834) + at org.junit.Assert.assertEquals(Assert.java:118) + at org.junit.Assert.assertEquals(Assert.java:144) + at Main.test0(Main.java:22) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) + at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) + at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) + at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) + at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) + at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) + at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) + at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) + at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) + at org.junit.runners.ParentRunner.run(ParentRunner.java:363) + at org.junit.runners.Suite.runChild(Suite.java:128) + at org.junit.runners.Suite.runChild(Suite.java:27) + at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) + at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) + at org.junit.runners.ParentRunner.run(ParentRunner.java:363) + at org.junit.runner.JUnitCore.run(JUnitCore.java:137) + at org.junit.runner.JUnitCore.run(JUnitCore.java:115) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 2, Failures: 1 + diff --git a/tests/failing/outputs/list_remove_compile.exp b/tests/failing/outputs/list_remove_compile.exp new file mode 100644 index 0000000..fbe6675 --- /dev/null +++ b/tests/failing/outputs/list_remove_compile.exp @@ -0,0 +1,11 @@ +generated/Main.java:12: error: cannot find symbol + public static T getb() + ^ + symbol: class T + location: class Main +generated/Main.java:14: error: cannot find symbol + T b; + ^ + symbol: class T + location: class Main +2 errors diff --git a/tests/failing/outputs/list_remove_run.exp b/tests/failing/outputs/list_remove_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/failing/outputs/list_remove_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/failing/outputs/list_remove_test.exp b/tests/failing/outputs/list_remove_test.exp new file mode 100644 index 0000000..9f29a95 --- /dev/null +++ b/tests/failing/outputs/list_remove_test.exp @@ -0,0 +1,43 @@ +JUnit version 4.12 +.E. +There was 1 failure: +1) test0(Main) +java.lang.AssertionError: expected:<3> but was:<3.0> + at org.junit.Assert.fail(Assert.java:88) + at org.junit.Assert.failNotEquals(Assert.java:834) + at org.junit.Assert.assertEquals(Assert.java:118) + at org.junit.Assert.assertEquals(Assert.java:144) + at Main.test0(Main.java:22) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) + at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) + at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) + at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) + at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) + at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) + at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) + at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) + at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) + at org.junit.runners.ParentRunner.run(ParentRunner.java:363) + at org.junit.runners.Suite.runChild(Suite.java:128) + at org.junit.runners.Suite.runChild(Suite.java:27) + at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) + at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) + at org.junit.runners.ParentRunner.run(ParentRunner.java:363) + at org.junit.runner.JUnitCore.run(JUnitCore.java:137) + at org.junit.runner.JUnitCore.run(JUnitCore.java:115) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 2, Failures: 1 + diff --git a/tests/failing/outputs/z_compile.exp b/tests/failing/outputs/z_compile.exp new file mode 100644 index 0000000..6e13d45 --- /dev/null +++ b/tests/failing/outputs/z_compile.exp @@ -0,0 +1,6 @@ +generated/Main.java:22: error: cannot find symbol + c = (c+b(i)); + ^ + symbol: method b(Integer) + location: class Main +1 error diff --git a/tests/failing/outputs/z_run.exp b/tests/failing/outputs/z_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/failing/outputs/z_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/failing/outputs/z_test.exp b/tests/failing/outputs/z_test.exp new file mode 100644 index 0000000..9f29a95 --- /dev/null +++ b/tests/failing/outputs/z_test.exp @@ -0,0 +1,43 @@ +JUnit version 4.12 +.E. +There was 1 failure: +1) test0(Main) +java.lang.AssertionError: expected:<3> but was:<3.0> + at org.junit.Assert.fail(Assert.java:88) + at org.junit.Assert.failNotEquals(Assert.java:834) + at org.junit.Assert.assertEquals(Assert.java:118) + at org.junit.Assert.assertEquals(Assert.java:144) + at Main.test0(Main.java:22) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) + at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) + at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) + at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) + at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) + at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) + at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) + at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) + at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) + at org.junit.runners.ParentRunner.run(ParentRunner.java:363) + at org.junit.runners.Suite.runChild(Suite.java:128) + at org.junit.runners.Suite.runChild(Suite.java:27) + at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) + at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) + at org.junit.runners.ParentRunner.run(ParentRunner.java:363) + at org.junit.runner.JUnitCore.run(JUnitCore.java:137) + at org.junit.runner.JUnitCore.run(JUnitCore.java:115) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 2, Failures: 1 + diff --git a/tests/io/outputs/add_compile.exp b/tests/io/outputs/add_compile.exp new file mode 100644 index 0000000..3b45996 --- /dev/null +++ b/tests/io/outputs/add_compile.exp @@ -0,0 +1 @@ +line 1:2 no viable alternative at input 'a=' diff --git a/tests/io/outputs/add_run.exp b/tests/io/outputs/add_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/io/outputs/add_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/io/outputs/add_test.exp b/tests/io/outputs/add_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/io/outputs/add_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 + diff --git a/tests/io/outputs/collections_compile.exp b/tests/io/outputs/collections_compile.exp new file mode 100644 index 0000000..176add1 --- /dev/null +++ b/tests/io/outputs/collections_compile.exp @@ -0,0 +1,10 @@ +line 1:6 extraneous input '"enter 3 space-separated words\n"' expecting ')' +line 2:0 missing '{' at 'a' +line 4:0 missing '}' at '' +generated/Main.java:16: error: method print in class Main cannot be applied to given types; + print("%s\n", a); + ^ + required: no arguments + found: String,LJList + reason: actual and formal argument lists differ in length +1 error diff --git a/tests/io/outputs/collections_run.exp b/tests/io/outputs/collections_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/io/outputs/collections_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/io/outputs/collections_test.exp b/tests/io/outputs/collections_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/io/outputs/collections_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 + diff --git a/tests/io/outputs/for-loop_compile.exp b/tests/io/outputs/for-loop_compile.exp new file mode 100644 index 0000000..3a015e5 --- /dev/null +++ b/tests/io/outputs/for-loop_compile.exp @@ -0,0 +1 @@ +line 1:0 mismatched input 'for' expecting {, 'test', 'global', ID, EOL} diff --git a/tests/io/outputs/for-loop_run.exp b/tests/io/outputs/for-loop_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/io/outputs/for-loop_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/io/outputs/for-loop_test.exp b/tests/io/outputs/for-loop_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/io/outputs/for-loop_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 + diff --git a/tests/io/outputs/hello-world_compile.exp b/tests/io/outputs/hello-world_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/io/outputs/hello-world_run.exp b/tests/io/outputs/hello-world_run.exp new file mode 100644 index 0000000..8ab686e --- /dev/null +++ b/tests/io/outputs/hello-world_run.exp @@ -0,0 +1 @@ +Hello, World! diff --git a/tests/io/outputs/hello-world_test.exp b/tests/io/outputs/hello-world_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/io/outputs/hello-world_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 + diff --git a/tests/io/outputs/input2_compile.exp b/tests/io/outputs/input2_compile.exp new file mode 100644 index 0000000..6844284 --- /dev/null +++ b/tests/io/outputs/input2_compile.exp @@ -0,0 +1 @@ +line 1:0 mismatched input 'if' expecting {, 'test', 'global', ID, EOL} diff --git a/tests/io/outputs/input2_run.exp b/tests/io/outputs/input2_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/io/outputs/input2_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/io/outputs/input2_test.exp b/tests/io/outputs/input2_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/io/outputs/input2_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 + diff --git a/tests/io/outputs/input_compile.exp b/tests/io/outputs/input_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/io/outputs/input_run.exp b/tests/io/outputs/input_run.exp new file mode 100644 index 0000000..25b2e80 --- /dev/null +++ b/tests/io/outputs/input_run.exp @@ -0,0 +1,5 @@ +Integer: 0 +Double: 0.0 +Character: 0 +Word: 0 +Line: 0 diff --git a/tests/io/outputs/input_test.exp b/tests/io/outputs/input_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/io/outputs/input_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 + diff --git a/tests/io/outputs/print_compile.exp b/tests/io/outputs/print_compile.exp new file mode 100644 index 0000000..7ecc68c --- /dev/null +++ b/tests/io/outputs/print_compile.exp @@ -0,0 +1,23 @@ +line 1:6 extraneous input '1' expecting ')' +line 2:0 missing '{' at 'print' +line 10:0 missing '}' at '' +Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 + at java.util.ArrayList.rangeCheck(ArrayList.java:657) + at java.util.ArrayList.get(ArrayList.java:433) + at com.github.lessjava.visitor.impl.LJInstantiateFunctions.instantiateFunction(LJInstantiateFunctions.java:88) + at com.github.lessjava.visitor.impl.LJInstantiateFunctions.postVisit(LJInstantiateFunctions.java:57) + at com.github.lessjava.types.ast.ASTFunctionCall.traverse(ASTFunctionCall.java:41) + at com.github.lessjava.types.ast.ASTVoidFunctionCall.traverse(ASTVoidFunctionCall.java:13) + at com.github.lessjava.types.ast.ASTBlock.traverse(ASTBlock.java:27) + at com.github.lessjava.types.ast.ASTFunction.traverse(ASTFunction.java:23) + at com.github.lessjava.types.ast.ASTProgram.traverse(ASTProgram.java:37) + at com.github.lessjava.LJCompiler.main(LJCompiler.java:101) + +FAILURE: Build failed with an exception. + +* What went wrong: +Execution failed for task ':run'. +> Process 'command '/usr/lib64/openjdk-8/bin/java'' finished with non-zero exit value 1 + +* Try: +Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. diff --git a/tests/io/outputs/print_run.exp b/tests/io/outputs/print_run.exp new file mode 100644 index 0000000..25b2e80 --- /dev/null +++ b/tests/io/outputs/print_run.exp @@ -0,0 +1,5 @@ +Integer: 0 +Double: 0.0 +Character: 0 +Word: 0 +Line: 0 diff --git a/tests/io/outputs/print_test.exp b/tests/io/outputs/print_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/io/outputs/print_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 + diff --git a/tests/io/outputs/sum_compile.exp b/tests/io/outputs/sum_compile.exp new file mode 100644 index 0000000..686b722 --- /dev/null +++ b/tests/io/outputs/sum_compile.exp @@ -0,0 +1 @@ +line 1:2 no viable alternative at input 'x=' diff --git a/tests/io/outputs/sum_run.exp b/tests/io/outputs/sum_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/io/outputs/sum_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/io/outputs/sum_test.exp b/tests/io/outputs/sum_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/io/outputs/sum_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 + diff --git a/tests/outputs/bracket-access_compile.exp b/tests/outputs/bracket-access_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/bracket-access_run.exp b/tests/outputs/bracket-access_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/bracket-access_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/bracket-access_test.exp b/tests/outputs/bracket-access_test.exp new file mode 100644 index 0000000..d7f32c8 --- /dev/null +++ b/tests/outputs/bracket-access_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +. + +OK (1 test) + diff --git a/tests/outputs/car_compile.exp b/tests/outputs/car_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/car_run.exp b/tests/outputs/car_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/car_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/car_test.exp b/tests/outputs/car_test.exp new file mode 100644 index 0000000..e651dcd --- /dev/null +++ b/tests/outputs/car_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +.. + +OK (2 tests) + diff --git a/tests/outputs/collections_compile.exp b/tests/outputs/collections_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/collections_run.exp b/tests/outputs/collections_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/collections_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/collections_test.exp b/tests/outputs/collections_test.exp new file mode 100644 index 0000000..9665afd --- /dev/null +++ b/tests/outputs/collections_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +............................. + +OK (29 tests) + diff --git a/tests/outputs/counterexample_compile.exp b/tests/outputs/counterexample_compile.exp new file mode 100644 index 0000000..cbc80d8 --- /dev/null +++ b/tests/outputs/counterexample_compile.exp @@ -0,0 +1,11 @@ +generated/Main.java:18: error: cannot find symbol + foo(x); + ^ + symbol: method foo(A) + location: class Main +generated/Main.java:19: error: cannot find symbol + foo(y); + ^ + symbol: method foo(B) + location: class Main +2 errors diff --git a/tests/outputs/counterexample_run.exp b/tests/outputs/counterexample_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/counterexample_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/counterexample_test.exp b/tests/outputs/counterexample_test.exp new file mode 100644 index 0000000..d7f32c8 --- /dev/null +++ b/tests/outputs/counterexample_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +. + +OK (1 test) + diff --git a/tests/outputs/demo_compile.exp b/tests/outputs/demo_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/demo_run.exp b/tests/outputs/demo_run.exp new file mode 100644 index 0000000..13ff925 --- /dev/null +++ b/tests/outputs/demo_run.exp @@ -0,0 +1,20 @@ +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +0 +1 +2 +3 +4 +6 +7 +8 +9 +p1 (0) is less than p2 (10) diff --git a/tests/outputs/demo_test.exp b/tests/outputs/demo_test.exp new file mode 100644 index 0000000..7f17ae5 --- /dev/null +++ b/tests/outputs/demo_test.exp @@ -0,0 +1,36 @@ +JUnit version 4.12 +.0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +0 +1 +2 +3 +4 +6 +7 +8 +9 +p1 (0) is less than p2 (10) +.0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +p2 (0) is less than p1 (10) + + +OK (2 tests) + diff --git a/tests/outputs/dog_compile.exp b/tests/outputs/dog_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/dog_run.exp b/tests/outputs/dog_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/dog_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/dog_test.exp b/tests/outputs/dog_test.exp new file mode 100644 index 0000000..e651dcd --- /dev/null +++ b/tests/outputs/dog_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +.. + +OK (2 tests) + diff --git a/tests/outputs/eqtests_compile.exp b/tests/outputs/eqtests_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/eqtests_run.exp b/tests/outputs/eqtests_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/eqtests_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/eqtests_test.exp b/tests/outputs/eqtests_test.exp new file mode 100644 index 0000000..3e4cf50 --- /dev/null +++ b/tests/outputs/eqtests_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +........ + +OK (8 tests) + diff --git a/tests/outputs/fact_compile.exp b/tests/outputs/fact_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/fact_run.exp b/tests/outputs/fact_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/fact_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/fact_test.exp b/tests/outputs/fact_test.exp new file mode 100644 index 0000000..6bb2b33 --- /dev/null +++ b/tests/outputs/fact_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +..... + +OK (5 tests) + diff --git a/tests/outputs/forloop_compile.exp b/tests/outputs/forloop_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/forloop_run.exp b/tests/outputs/forloop_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/forloop_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/forloop_test.exp b/tests/outputs/forloop_test.exp new file mode 100644 index 0000000..e651dcd --- /dev/null +++ b/tests/outputs/forloop_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +.. + +OK (2 tests) + diff --git a/tests/outputs/format_compile.exp b/tests/outputs/format_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/format_run.exp b/tests/outputs/format_run.exp new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/tests/outputs/format_run.exp @@ -0,0 +1 @@ +3 diff --git a/tests/outputs/format_test.exp b/tests/outputs/format_test.exp new file mode 100644 index 0000000..d7f32c8 --- /dev/null +++ b/tests/outputs/format_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +. + +OK (1 test) + diff --git a/tests/outputs/fp_compile.exp b/tests/outputs/fp_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/fp_run.exp b/tests/outputs/fp_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/fp_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/fp_test.exp b/tests/outputs/fp_test.exp new file mode 100644 index 0000000..e651dcd --- /dev/null +++ b/tests/outputs/fp_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +.. + +OK (2 tests) + diff --git a/tests/outputs/global_compile.exp b/tests/outputs/global_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/global_run.exp b/tests/outputs/global_run.exp new file mode 100644 index 0000000..31f1065 --- /dev/null +++ b/tests/outputs/global_run.exp @@ -0,0 +1,3 @@ +c +[a] +done diff --git a/tests/outputs/global_test.exp b/tests/outputs/global_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/outputs/global_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 + diff --git a/tests/outputs/oop_compile.exp b/tests/outputs/oop_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/oop_run.exp b/tests/outputs/oop_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/oop_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/oop_test.exp b/tests/outputs/oop_test.exp new file mode 100644 index 0000000..d7f32c8 --- /dev/null +++ b/tests/outputs/oop_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +. + +OK (1 test) + diff --git a/tests/outputs/precedence_compile.exp b/tests/outputs/precedence_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/precedence_run.exp b/tests/outputs/precedence_run.exp new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tests/outputs/precedence_run.exp @@ -0,0 +1 @@ +2 diff --git a/tests/outputs/precedence_test.exp b/tests/outputs/precedence_test.exp new file mode 100644 index 0000000..d7f32c8 --- /dev/null +++ b/tests/outputs/precedence_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +. + +OK (1 test) + diff --git a/tests/outputs/primitive-numbers_compile.exp b/tests/outputs/primitive-numbers_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/primitive-numbers_run.exp b/tests/outputs/primitive-numbers_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/primitive-numbers_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/primitive-numbers_test.exp b/tests/outputs/primitive-numbers_test.exp new file mode 100644 index 0000000..ab47cbc --- /dev/null +++ b/tests/outputs/primitive-numbers_test.exp @@ -0,0 +1,79 @@ +JUnit version 4.12 +....E..E +There were 2 failures: +1) test3(Main) +java.lang.AssertionError: expected:<0> but was:<0.0> + at org.junit.Assert.fail(Assert.java:88) + at org.junit.Assert.failNotEquals(Assert.java:834) + at org.junit.Assert.assertEquals(Assert.java:118) + at org.junit.Assert.assertEquals(Assert.java:144) + at Main.test3(Main.java:56) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) + at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) + at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) + at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) + at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) + at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) + at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) + at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) + at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) + at org.junit.runners.ParentRunner.run(ParentRunner.java:363) + at org.junit.runners.Suite.runChild(Suite.java:128) + at org.junit.runners.Suite.runChild(Suite.java:27) + at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) + at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) + at org.junit.runners.ParentRunner.run(ParentRunner.java:363) + at org.junit.runner.JUnitCore.run(JUnitCore.java:137) + at org.junit.runner.JUnitCore.run(JUnitCore.java:115) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) +2) test5(Main) +java.lang.AssertionError: expected:<1.0E-4> but was:<9.999999999998899E-5> + at org.junit.Assert.fail(Assert.java:88) + at org.junit.Assert.failNotEquals(Assert.java:834) + at org.junit.Assert.assertEquals(Assert.java:118) + at org.junit.Assert.assertEquals(Assert.java:144) + at Main.test5(Main.java:64) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) + at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) + at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) + at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) + at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) + at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) + at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) + at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) + at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) + at org.junit.runners.ParentRunner.run(ParentRunner.java:363) + at org.junit.runners.Suite.runChild(Suite.java:128) + at org.junit.runners.Suite.runChild(Suite.java:27) + at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) + at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) + at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) + at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) + at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) + at org.junit.runners.ParentRunner.run(ParentRunner.java:363) + at org.junit.runner.JUnitCore.run(JUnitCore.java:137) + at org.junit.runner.JUnitCore.run(JUnitCore.java:115) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 6, Failures: 2 + diff --git a/tests/outputs/quicksort_compile.exp b/tests/outputs/quicksort_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/quicksort_run.exp b/tests/outputs/quicksort_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/quicksort_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/quicksort_test.exp b/tests/outputs/quicksort_test.exp new file mode 100644 index 0000000..c1340a8 --- /dev/null +++ b/tests/outputs/quicksort_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +.... + +OK (4 tests) + diff --git a/tests/outputs/shadow_compile.exp b/tests/outputs/shadow_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/shadow_run.exp b/tests/outputs/shadow_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/shadow_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/shadow_test.exp b/tests/outputs/shadow_test.exp new file mode 100644 index 0000000..d7f32c8 --- /dev/null +++ b/tests/outputs/shadow_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +. + +OK (1 test) + diff --git a/tests/outputs/type-inference_compile.exp b/tests/outputs/type-inference_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/type-inference_run.exp b/tests/outputs/type-inference_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/type-inference_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/type-inference_test.exp b/tests/outputs/type-inference_test.exp new file mode 100644 index 0000000..4687166 --- /dev/null +++ b/tests/outputs/type-inference_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +..................... + +OK (21 tests) + diff --git a/tests/outputs/unit-test_compile.exp b/tests/outputs/unit-test_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/unit-test_run.exp b/tests/outputs/unit-test_run.exp new file mode 100644 index 0000000..988cd4b --- /dev/null +++ b/tests/outputs/unit-test_run.exp @@ -0,0 +1,3 @@ +Error: Main method not found in class Main, please define the main method as: + public static void main(String[] args) +or a JavaFX application class must extend javafx.application.Application diff --git a/tests/outputs/unit-test_test.exp b/tests/outputs/unit-test_test.exp new file mode 100644 index 0000000..d7f32c8 --- /dev/null +++ b/tests/outputs/unit-test_test.exp @@ -0,0 +1,5 @@ +JUnit version 4.12 +. + +OK (1 test) + diff --git a/tests/outputs/unop_compile.exp b/tests/outputs/unop_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/outputs/unop_run.exp b/tests/outputs/unop_run.exp new file mode 100644 index 0000000..3a2e3f4 --- /dev/null +++ b/tests/outputs/unop_run.exp @@ -0,0 +1 @@ +-1 diff --git a/tests/outputs/unop_test.exp b/tests/outputs/unop_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/outputs/unop_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 + diff --git a/tests/user-submitted/outputs/kyle_compile.exp b/tests/user-submitted/outputs/kyle_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/user-submitted/outputs/kyle_run.exp b/tests/user-submitted/outputs/kyle_run.exp new file mode 100644 index 0000000..e949cfe --- /dev/null +++ b/tests/user-submitted/outputs/kyle_run.exp @@ -0,0 +1 @@ +Kyle is a 21-year-old Computer Science major diff --git a/tests/user-submitted/outputs/kyle_test.exp b/tests/user-submitted/outputs/kyle_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/user-submitted/outputs/kyle_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 + diff --git a/tests/user-submitted/outputs/payroll_compile.exp b/tests/user-submitted/outputs/payroll_compile.exp new file mode 100644 index 0000000..e69de29 diff --git a/tests/user-submitted/outputs/payroll_run.exp b/tests/user-submitted/outputs/payroll_run.exp new file mode 100644 index 0000000..0c6fa58 --- /dev/null +++ b/tests/user-submitted/outputs/payroll_run.exp @@ -0,0 +1,3 @@ +What is your name? How many hours did you work this week? What is your hourly payrate? +Hello John Doe +Your gross pay is $1100.000000 diff --git a/tests/user-submitted/outputs/payroll_test.exp b/tests/user-submitted/outputs/payroll_test.exp new file mode 100644 index 0000000..3304d95 --- /dev/null +++ b/tests/user-submitted/outputs/payroll_test.exp @@ -0,0 +1,28 @@ +JUnit version 4.12 +.E +There was 1 failure: +1) initializationError(Main) +java.lang.Exception: No runnable methods + at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191) + at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128) + at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) + at org.junit.runners.ParentRunner.(ParentRunner.java:84) + at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) + at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) + at org.junit.runner.Computer.getRunner(Computer.java:40) + at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) + at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) + at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) + at org.junit.runners.Suite.(Suite.java:81) + at org.junit.runner.Computer.getSuite(Computer.java:28) + at org.junit.runner.Request.classes(Request.java:75) + at org.junit.runner.JUnitCommandLineParseResult.createRequest(JUnitCommandLineParseResult.java:118) + at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) + at org.junit.runner.JUnitCore.main(JUnitCore.java:36) + +FAILURES!!! +Tests run: 1, Failures: 1 +