aboutsummaryrefslogtreecommitdiff
path: root/doc/problemexamples/problemtemplate/tests/c
diff options
context:
space:
mode:
authorBruno Ribas <brunoribas@gmail.com>2016-11-04 17:05:45 +0000
committerBruno Ribas <brunoribas@gmail.com>2016-11-04 17:05:45 +0000
commitdb4bae36d351278b3cc9326e46b76118cf0426fb (patch)
tree7756fafe0629209ca0a591a08c532f1d888bce7a /doc/problemexamples/problemtemplate/tests/c
parenta37edf8956630397abc2c20d66f465af032ec231 (diff)
downloadboca-db4bae36d351278b3cc9326e46b76118cf0426fb.tar.gz
boca-db4bae36d351278b3cc9326e46b76118cf0426fb.zip
tests/c: Create a testdir to drop files
This avoids confusion with created files Signed-off-by: Bruno Ribas <brunoribas@gmail.com>
Diffstat (limited to 'doc/problemexamples/problemtemplate/tests/c')
-rwxr-xr-xdoc/problemexamples/problemtemplate/tests/c12
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/problemexamples/problemtemplate/tests/c b/doc/problemexamples/problemtemplate/tests/c
index de0a9c5..1988cbd 100755
--- a/doc/problemexamples/problemtemplate/tests/c
+++ b/doc/problemexamples/problemtemplate/tests/c
@@ -3,6 +3,9 @@
# 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.c <<EOF
#include<stdio.h>
int main() {
@@ -18,10 +21,10 @@ 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
+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
@@ -33,4 +36,5 @@ else
exit 1
fi
echo "TEST PASSED"
+cd ..
exit 0