aboutsummaryrefslogtreecommitdiff
path: root/doc/problemexamples/problemtemplate/tests/py3
diff options
context:
space:
mode:
Diffstat (limited to 'doc/problemexamples/problemtemplate/tests/py3')
-rwxr-xr-xdoc/problemexamples/problemtemplate/tests/py338
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/problemexamples/problemtemplate/tests/py3 b/doc/problemexamples/problemtemplate/tests/py3
new file mode 100755
index 0000000..6aaaca6
--- /dev/null
+++ b/doc/problemexamples/problemtemplate/tests/py3
@@ -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/py3
+../../compile/py3 test.py test.exe $TL
+chmod 755 ../../run/py3
+../../run/py3 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