From db4bae36d351278b3cc9326e46b76118cf0426fb Mon Sep 17 00:00:00 2001 From: Bruno Ribas Date: Fri, 4 Nov 2016 15:05:45 -0200 Subject: tests/c: Create a testdir to drop files This avoids confusion with created files Signed-off-by: Bruno Ribas --- doc/problemexamples/problemtemplate/tests/c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'doc/problemexamples/problemtemplate/tests') 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 < 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 -- cgit v1.2.3