-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Committer: Tamio Vesa Nakajima <[email protected]>
Made a testing module (+ minor changes to src) Changes to be committed: modified: src/lib.sh modified: src/run.sh new file: test/aplusb/eval/eval.cpp new file: test/aplusb/eval/makefile new file: test/aplusb/incf/fixed new file: test/aplusb/incf/random new file: test/aplusb/ingen/ingen.cpp new file: test/aplusb/ingen/makefile new file: test/aplusb/okgen/makefile new file: test/aplusb/okgen/okgen.cpp new file: test/aplusb/src/ok.cpp new file: test/aplusb/src/tle.cpp new file: test/aplusb/src/wa.cpp new file: test/aplusb/testmanifest new file: test/correct_output new file: test/test_everything.sh
- Loading branch information
Tamio Vesa Nakajima
authored and
Tamio Vesa Nakajima
committed
May 20, 2018
1 parent
eba9d34
commit 4c43c4c
Showing
21 changed files
with
139 additions
and
2 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
TODO: | ||
|
||
- make an evaluator (should read from $problemname.out and $problemname.ok, write the evaluation message to stderr and the # of points to cout | ||
- make an input generator (should read configuration from $problemname.cf and write the input to $problemname.in) | ||
- make an ok generator (should read the # of points from $problemname.points, the input from $problemname.in, and write to ok to $problemname.ok) | ||
- make a testmanifest (each line should contain a group of tests, described by the # of tests, the configuration file, and the # of points for that group) | ||
- call ./buildtests.sh | ||
- add source files to src | ||
- call ./run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <iostream> | ||
#include <fstream> | ||
#include <cassert> | ||
using namespace std; | ||
|
||
int main(){ | ||
ifstream fout("aplusb.out"); | ||
ifstream fok("aplusb.ok"); | ||
|
||
int points = 0; | ||
fok >> points; | ||
|
||
string s1, s2; | ||
while(fok >> s1){ | ||
if(!bool(fout >> s2) || s1 != s2){ | ||
cerr << "WA" << endl; | ||
cout << 0 << endl; | ||
return 0; } } | ||
|
||
cerr << "OK" << endl; | ||
cout << points << endl; | ||
return 0; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
../eval/eval.bin: | ||
g++ eval.cpp -std=c++11 -o ../eval/eval.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 0 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <iostream> | ||
#include <fstream> | ||
using namespace std; | ||
|
||
int main(){ | ||
ifstream f("aplusb.cf"); | ||
ofstream g("aplusb.in"); | ||
bool fixed; | ||
int x, y; | ||
f >> fixed >> x >> y; | ||
|
||
if(fixed) g << x << ' ' << y << endl; | ||
else{ | ||
srand(time(nullptr)); | ||
g << rand() << ' ' << rand() << endl; } | ||
return 0; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
../ingen/ingen.bin: | ||
g++ ingen.cpp -std=c++11 -o ../ingen/ingen.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
../okgen/okgen.bin: | ||
g++ okgen.cpp -std=c++11 -o ../okgen/okgen.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <fstream> | ||
using namespace std; | ||
|
||
int main(){ | ||
ifstream points("aplusb.points"); | ||
ifstream f("aplusb.in"); | ||
ofstream g("aplusb.ok"); | ||
|
||
long long p, x, y; | ||
f >> x >> y; | ||
points >> p; | ||
g << p << endl; | ||
g << x+y << endl; | ||
return 0; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <fstream> | ||
using namespace std; | ||
|
||
int main(){ | ||
ifstream f("aplusb.in"); | ||
ofstream g("aplusb.out"); | ||
long long x, y; | ||
f >> x >> y; | ||
g << x+y << endl; | ||
return 0; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
int main(){ | ||
while(true){} } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(){} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
1 fixed 10 | ||
3 random 90 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
project_directory=`mktemp -d` | ||
|
||
echo Building project | ||
echo $'aplusb\n0.1' | ./makeproject.sh $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 | ||
./buildtests.sh | ||
./run.sh | ||
|
||
echo Cleanup | ||
|
||
rm -r $project_directory |