aboutsummaryrefslogtreecommitdiff
path: root/boca-1.5.1/doc/problemexamples/problemtemplate/tests
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2012-08-31 09:02:27 +0000
committercassiopc <cassiopc@gmail.com>2012-08-31 09:02:27 +0000
commit2948fe8d6055f6dfe6289e64bce426b5e0bb552f (patch)
tree2cff8a28f2bcf1f21116b952738b5e683e11c193 /boca-1.5.1/doc/problemexamples/problemtemplate/tests
parent37d5a8f2b6ecf585f91c2f7c804145853f0ca1e9 (diff)
downloadboca-2948fe8d6055f6dfe6289e64bce426b5e0bb552f.tar.gz
boca-2948fe8d6055f6dfe6289e64bce426b5e0bb552f.zip
inclusion of dir 1.5.1 for boca
Diffstat (limited to 'boca-1.5.1/doc/problemexamples/problemtemplate/tests')
-rwxr-xr-xboca-1.5.1/doc/problemexamples/problemtemplate/tests/c36
1 files changed, 36 insertions, 0 deletions
diff --git a/boca-1.5.1/doc/problemexamples/problemtemplate/tests/c b/boca-1.5.1/doc/problemexamples/problemtemplate/tests/c
new file mode 100755
index 0000000..de0a9c5
--- /dev/null
+++ b/boca-1.5.1/doc/problemexamples/problemtemplate/tests/c
@@ -0,0 +1,36 @@
+#!/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
+
+cat > test.c <<EOF
+#include<stdio.h>
+int main() {
+ char s[100];
+ scanf("%s", s);
+ printf("%s\n",s);
+ return 0;
+}
+EOF
+cat > test.in <<EOF
+inputdata
+EOF
+
+TL=2
+REP=10
+chmod 755 ../compile/c
+../compile/c test.c test.exe $TL
+chmod 755 ../run/c
+../run/c 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"
+exit 0