Skip to content

Commit

Permalink
Committer: Tamio Vesa Nakajima <[email protected]>
Browse files Browse the repository at this point in the history
Made better tests
 Changes to be committed:
	new file:   test/aplusb/src/almost_ok.cpp
	modified:   test/aplusb/testmanifest
	deleted:    test/correct_output
	new file:   test/test.sh
	deleted:    test/test_everything.sh
  • Loading branch information
Tamio Vesa Nakajima authored and Tamio Vesa Nakajima committed May 21, 2018
1 parent bde5b21 commit f5a720a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 50 deletions.
11 changes: 11 additions & 0 deletions test/aplusb/src/almost_ok.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <fstream>
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; }
2 changes: 1 addition & 1 deletion test/aplusb/testmanifest
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
1 fixed 10
3 random 90
1 random 90
25 changes: 0 additions & 25 deletions test/correct_output

This file was deleted.

23 changes: 23 additions & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
@@ -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"
24 changes: 0 additions & 24 deletions test/test_everything.sh

This file was deleted.

0 comments on commit f5a720a

Please sign in to comment.