From 9e29fdf7702c193e3fd7059a098a43863a083aa4 Mon Sep 17 00:00:00 2001 From: Sanjar Ahmadov Date: Tue, 23 Mar 2021 20:37:05 -0400 Subject: [PATCH] Added test scripts --- full_test.sh | 3 ++- test.sh | 12 ------------ test_py_file.sh | 16 ++++++++++++++++ test_sample.sh | 5 +++++ test_student_contributed.sh | 4 ++++ 5 files changed, 27 insertions(+), 13 deletions(-) delete mode 100755 test.sh create mode 100755 test_py_file.sh create mode 100755 test_sample.sh create mode 100755 test_student_contributed.sh diff --git a/full_test.sh b/full_test.sh index 19504c9..bed0028 100755 --- a/full_test.sh +++ b/full_test.sh @@ -1,3 +1,4 @@ #!/bin/bash ./build.sh -./test.sh +./test_sample.sh +./test_student_contributed.sh diff --git a/test.sh b/test.sh deleted file mode 100755 index 7060f44..0000000 --- a/test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -FILENAME=$1 - -if [ -z "$1" ] ; then - echo "Running all test cases. Usage for individual test cases: test.sh FILENAME (inside src/test/data/pa1/sample/ folder)" - java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy --pass=s --test --dir src/test/data/pa1/sample/ - exit 1 -fi - -java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy \ - --pass=s --test src/test/data/pa1/sample/${FILENAME} diff --git a/test_py_file.sh b/test_py_file.sh new file mode 100755 index 0000000..4e47b37 --- /dev/null +++ b/test_py_file.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +FILENAME=$1 + +if [ -z "$1" ] ; then + echo "Usage for individual test cases: test.sh FILEPATH, where FILEPATH is the location of the python file" + exit 1 +fi + +echo "Testing file ${FILENAME}" + +java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy --pass=sr \ + ${FILENAME} --out=${FILENAME}.ast.typed + +java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy \ + --pass=ss --test ${FILENAME} diff --git a/test_sample.sh b/test_sample.sh new file mode 100755 index 0000000..45a1a40 --- /dev/null +++ b/test_sample.sh @@ -0,0 +1,5 @@ +#!/bin/bash + + +echo "Running all test cases inside src/test/data/pa2/sample/ folder)" +java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy --pass=ss --test --dir src/test/data/pa2/sample/ diff --git a/test_student_contributed.sh b/test_student_contributed.sh new file mode 100755 index 0000000..34a9693 --- /dev/null +++ b/test_student_contributed.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "Running all test cases inside src/test/data/pa2/sample/ folder)" +java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy --pass=ss --test --dir src/test/data/pa2/student_contributed/