diff --git a/test/aplusb/src/almost_ok.cpp b/test/aplusb/src/almost_ok.cpp new file mode 100644 index 0000000..475adf6 --- /dev/null +++ b/test/aplusb/src/almost_ok.cpp @@ -0,0 +1,11 @@ +#include +using namespace std; + +int main(){ + ifstream f("aplusb.in"); + ofstream g("aplusb.out"); + long long x, y; + f >> x >> y; + if((x+y)%10 == 0) g << -1 << endl; + else g << x+y << endl; + return 0; } diff --git a/test/aplusb/testmanifest b/test/aplusb/testmanifest index df50874..c871c54 100644 --- a/test/aplusb/testmanifest +++ b/test/aplusb/testmanifest @@ -1,2 +1,2 @@ 1 fixed 10 -3 random 90 +1 random 90 diff --git a/test/correct_output b/test/correct_output deleted file mode 100644 index 566b3e6..0000000 --- a/test/correct_output +++ /dev/null @@ -1,25 +0,0 @@ -0 -1 -2 -3 -ok.cpp -Test Message Time Points -aplusb-0.in OK 0.030 10 -aplusb-1.in OK 0.011 30 -aplusb-2.in OK 0.013 30 -aplusb-3.in OK 0.014 30 -SCORE: 100 -tle.cpp -Test Message Time Points -aplusb-0.in TLE 1.013 0 -aplusb-1.in TLE 1.013 0 -aplusb-2.in TLE 1.013 0 -aplusb-3.in TLE 1.015 0 -SCORE: 0 -wa.cpp -Test Message Time Points -aplusb-0.in WA 0.012 0 -aplusb-1.in WA 0.014 0 -aplusb-2.in WA 0.020 0 -aplusb-3.in WA 0.009 0 -SCORE: 0 diff --git a/test/test.sh b/test/test.sh new file mode 100755 index 0000000..2da466c --- /dev/null +++ b/test/test.sh @@ -0,0 +1,23 @@ +project_directory=$(mktemp -d) + +echo Building project +printf "aplusb\\n0.1" | ./makeproject "$project_directory" + +echo Copying files into project +cp test/aplusb/incf/* "$project_directory/aplusb/incf" +cp test/aplusb/ingen/* "$project_directory/aplusb/ingen" +cp test/aplusb/okgen/* "$project_directory/aplusb/okgen" +cp test/aplusb/eval/* "$project_directory/aplusb/eval" +cp test/aplusb/src/* "$project_directory/aplusb/src" +cp test/aplusb/testmanifest "$project_directory/aplusb/testmanifest" + +cd "$project_directory/aplusb" || exit 1 + +echo Running sources +echo | ./buildtests +./run +./compare -s ok.cpp -s almost_ok.cpp -c random + +echo Cleanup + +rm -r "$project_directory" diff --git a/test/test_everything.sh b/test/test_everything.sh deleted file mode 100755 index 957e83b..0000000 --- a/test/test_everything.sh +++ /dev/null @@ -1,24 +0,0 @@ -project_directory=`mktemp -d` - -echo Building project -echo $'aplusb\n0.1' | ./makeproject $project_directory - -echo Copying files into project -cp test/aplusb/incf/* $project_directory/aplusb/incf -cp test/aplusb/ingen/* $project_directory/aplusb/ingen -cp test/aplusb/okgen/* $project_directory/aplusb/okgen -cp test/aplusb/eval/* $project_directory/aplusb/eval -cp test/aplusb/src/* $project_directory/aplusb/src -cp test/aplusb/testmanifest $project_directory/aplusb/testmanifest - -cd $project_directory/aplusb - -output_file=`mktemp` - -echo Running sources -echo | ./buildtests -./run - -echo Cleanup - -rm -r $project_directory