diff options
| author | Bruno Ribas <brunoribas@gmail.com> | 2016-11-04 17:13:59 +0000 |
|---|---|---|
| committer | Bruno Ribas <brunoribas@gmail.com> | 2016-11-04 17:13:59 +0000 |
| commit | da1ef60ac7e8ebe530b0502473c1d59c06970f15 (patch) | |
| tree | 4909994d211601e7f64b6f8990c60493cf9063b8 /doc/problemexamples/problemtemplate/tests/py2 | |
| parent | 48401f08bea422bdfbf273e904947d9abbfc4659 (diff) | |
| download | boca-da1ef60ac7e8ebe530b0502473c1d59c06970f15.tar.gz boca-da1ef60ac7e8ebe530b0502473c1d59c06970f15.zip | |
problemtemplate: Adding py2 and py3 support
Tests scripts for both py2 and py3 are working.
Signed-off-by: Bruno Ribas <brunoribas@gmail.com>
Diffstat (limited to 'doc/problemexamples/problemtemplate/tests/py2')
| -rwxr-xr-x | doc/problemexamples/problemtemplate/tests/py2 | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/problemexamples/problemtemplate/tests/py2 b/doc/problemexamples/problemtemplate/tests/py2 new file mode 100755 index 0000000..3437d4f --- /dev/null +++ b/doc/problemexamples/problemtemplate/tests/py2 @@ -0,0 +1,38 @@ +#!/bin/bash +# +# This file performs a test of the autojudge system. It can run whatever you feel important to test the autojudge +# and the script files that are included in the problem package + +mkdir -p testdir +cd testdir + +cat > test.py <<EOF +#!/caminho/errado +import sys + +for line in sys.stdin: + print line +EOF +cat > test.in <<EOF +inputdata +EOF + +TL=2 +REP=10 +chmod 755 ../../compile/py2 +../../compile/py2 test.py test.exe $TL +chmod 755 ../../run/py2 +../../run/py2 test.exe test.in $TL $REP +if [ -r stdout0 ]; then + output=`cat stdout0` + if [ "$output" != "inputdata" ]; then + echo "ERROR" + exit 1 + fi +else + echo "ERROR" + exit 1 +fi +echo "TEST PASSED" +cd .. +exit 0 |