aboutsummaryrefslogtreecommitdiff
path: root/boca-1.5.0/doc/problemexamples/problemtemplate/tests
diff options
context:
space:
mode:
Diffstat (limited to 'boca-1.5.0/doc/problemexamples/problemtemplate/tests')
-rwxr-xr-xboca-1.5.0/doc/problemexamples/problemtemplate/tests/c27
1 files changed, 27 insertions, 0 deletions
diff --git a/boca-1.5.0/doc/problemexamples/problemtemplate/tests/c b/boca-1.5.0/doc/problemexamples/problemtemplate/tests/c
new file mode 100755
index 0000000..d7d0411
--- /dev/null
+++ b/boca-1.5.0/doc/problemexamples/problemtemplate/tests/c
@@ -0,0 +1,27 @@
+#!/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
+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
+../compile/c test.c test.exe TL
+../run/c test.exe test.in TL REP
+output=`cat stdout0`
+if [ "$output" != "inputdata" ]; then
+ echo "ERROR"
+ exit 1
+fi
+exit 0