Skip to content

Commit

Permalink
Committer: Tamio Vesa Nakajima <[email protected]>
Browse files Browse the repository at this point in the history
Fixed a fatal undetected error
Added -o flag to buildtest (for only rebuilding the outputs).

Changes to be committed:
	modified:   examples/aplusb/buildtests
	modified:   examples/aplusb/incf/fixed
	deleted:    examples/aplusb/incf/makefile
	modified:   examples/aplusb/ingen/ingen.bin
	modified:   examples/aplusb/ingen/ingen.cpp
	new file:   examples/aplusb/oldtests/.zip
	new file:   examples/aplusb/oldtests/asdfjkl;.zip
	modified:   examples/aplusb/oldtests/first.zip
	new file:   examples/aplusb/oldtests/frths.zip
	new file:   examples/aplusb/oldtests/lll.zip
	new file:   examples/aplusb/oldtests/snd.zip
	new file:   examples/aplusb/oldtests/thrd.zip
	modified:   examples/aplusb/src/wa.cpp
	modified:   examples/aplusb/tests/aplusb-0.in
	modified:   examples/aplusb/tests/aplusb-0.ok
	modified:   examples/aplusb/tests/aplusb-1.in
	modified:   examples/aplusb/tests/aplusb-1.ok
	modified:   examples/aplusb/tests/aplusb-10.in
	modified:   examples/aplusb/tests/aplusb-10.ok
	modified:   examples/aplusb/tests/aplusb-11.in
	modified:   examples/aplusb/tests/aplusb-11.ok
	modified:   examples/aplusb/tests/aplusb-12.in
	modified:   examples/aplusb/tests/aplusb-12.ok
	modified:   examples/aplusb/tests/aplusb-13.in
	modified:   examples/aplusb/tests/aplusb-13.ok
	modified:   examples/aplusb/tests/aplusb-14.in
	modified:   examples/aplusb/tests/aplusb-14.ok
	modified:   examples/aplusb/tests/aplusb-15.in
	modified:   examples/aplusb/tests/aplusb-15.ok
	modified:   examples/aplusb/tests/aplusb-16.in
	modified:   examples/aplusb/tests/aplusb-16.ok
	modified:   examples/aplusb/tests/aplusb-17.in
	modified:   examples/aplusb/tests/aplusb-17.ok
	modified:   examples/aplusb/tests/aplusb-18.in
	modified:   examples/aplusb/tests/aplusb-18.ok
	modified:   examples/aplusb/tests/aplusb-2.in
	modified:   examples/aplusb/tests/aplusb-2.ok
	modified:   examples/aplusb/tests/aplusb-3.in
	modified:   examples/aplusb/tests/aplusb-3.ok
	modified:   examples/aplusb/tests/aplusb-4.in
	modified:   examples/aplusb/tests/aplusb-4.ok
	modified:   examples/aplusb/tests/aplusb-5.in
	modified:   examples/aplusb/tests/aplusb-5.ok
	modified:   examples/aplusb/tests/aplusb-6.in
	modified:   examples/aplusb/tests/aplusb-6.ok
	modified:   examples/aplusb/tests/aplusb-7.in
	modified:   examples/aplusb/tests/aplusb-7.ok
	modified:   examples/aplusb/tests/aplusb-8.in
	modified:   examples/aplusb/tests/aplusb-8.ok
	modified:   examples/aplusb/tests/aplusb-9.in
	modified:   examples/aplusb/tests/aplusb-9.ok
	deleted:    examples/aplusb/tests/tests/aplusb-0.in
	deleted:    examples/aplusb/tests/tests/aplusb-0.ok
	deleted:    examples/aplusb/tests/tests/aplusb-1.in
	deleted:    examples/aplusb/tests/tests/aplusb-1.ok
	deleted:    examples/aplusb/tests/tests/aplusb-2.in
	deleted:    examples/aplusb/tests/tests/aplusb-2.ok
	deleted:    examples/aplusb/tests/tests/aplusb-3.in
	deleted:    examples/aplusb/tests/tests/aplusb-3.ok
	modified:   src/buildtests
  • Loading branch information
Tamio Vesa Nakajima authored and Tamio Vesa Nakajima committed May 20, 2018
1 parent 4f115c5 commit 021ac93
Show file tree
Hide file tree
Showing 60 changed files with 93 additions and 56 deletions.
36 changes: 23 additions & 13 deletions examples/aplusb/buildtests
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ source problemconfig
# ARGUMENT PARSING
#############################

rebuild_inputs=true

while getopts "r:h" opt; do
while getopts "r:ho" opt; do
case $opt in
h)
echo "Usage: ./run -r(estore) [revision to restore]"
Expand All @@ -25,6 +26,9 @@ while getopts "r:h" opt; do
unzip oldtests/$OPTARG.zip
exit 0
;;
o)
rebuild_inputs=false
;;
esac
done

Expand All @@ -48,25 +52,27 @@ cat testmanifest | while read instr; do
# Build input:
#################

# Build input generator
try "cd ingen && make -s && cd .." "input generator build fail"
if [ $rebuild_inputs = true ] ; then
# Build input generator
cd ingen && make -s && cd ..

# Copy ingen/ingen.bin and incf/$1 into stage
cp ingen/ingen.bin stage/$problemname.bin
try "cp incf/$incf stage/$problemname.cf" "incf/$incf doesn't exist"
# Copy ingen/ingen.bin and incf/$1 into stage
cp ingen/ingen.bin stage/$problemname.bin
cp incf/$incf stage/$problemname.cf

# Build input
try "cd stage && ./$problemname.bin > ../tests/$problemname-$nr.in && cd .." "input generation fail"
# Build input
cd stage && ./$problemname.bin && cp $problemname.in ../tests/$problemname-$nr.in && cd ..

# Clean stage
rm stage/*
# Clean stage
rm stage/*
fi

###################
# Build ok
###################

# Build ok generator
try "cd okgen && make -s && cd .." "ok generator build fil"
cd okgen && make -s && cd ..

# Copy ok generator and input into stage
cp okgen/okgen.bin stage/$problemname.bin
Expand All @@ -76,7 +82,7 @@ cat testmanifest | while read instr; do
echo $points > stage/$problemname.points

# Build ok
try "cd stage && ./$problemname.bin && cd .." "ok generation fail"
cd stage && ./$problemname.bin && cd ..

# Copy ok from stage into tests
cp stage/$problemname.ok tests/$problemname-$nr.ok
Expand All @@ -89,4 +95,8 @@ cat testmanifest | while read instr; do
currtest=$(($currtest + $numberoftests))
done

zip -r oldtests/$testrevision.zip tests/*
if [[ $testrevision = "" ]] ; then
:
else
zip -r oldtests/$testrevision.zip tests/*
fi
2 changes: 1 addition & 1 deletion examples/aplusb/incf/fixed
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1 0 1
1 0 2
Empty file removed examples/aplusb/incf/makefile
Empty file.
Binary file modified examples/aplusb/ingen/ingen.bin
Binary file not shown.
5 changes: 4 additions & 1 deletion examples/aplusb/ingen/ingen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ int main(){
bool fixed;
int x, y;
f >> fixed >> x >> y;
cout << fixed << ' ' << x << ' ' << y << endl;

if(fixed) g << x << ' ' << y << endl;
if(fixed){
g << x << ' ' << y << endl;
}
else{
srand(time(nullptr));
g << rand() << ' ' << rand() << endl; }
Expand Down
Binary file added examples/aplusb/oldtests/.zip
Binary file not shown.
Binary file added examples/aplusb/oldtests/asdfjkl;.zip
Binary file not shown.
Binary file modified examples/aplusb/oldtests/first.zip
Binary file not shown.
Binary file added examples/aplusb/oldtests/frths.zip
Binary file not shown.
Binary file added examples/aplusb/oldtests/lll.zip
Binary file not shown.
Binary file added examples/aplusb/oldtests/snd.zip
Binary file not shown.
Binary file added examples/aplusb/oldtests/thrd.zip
Binary file not shown.
5 changes: 4 additions & 1 deletion examples/aplusb/src/wa.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include <iostream>
#include <fstream>
using namespace std;

int main(){}
int main(){
ofstream g("aplusb.out");
g << -1 << endl; }
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-0.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0 2
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-0.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
10
0
2
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-1.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394068970 1070590020
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-1.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2464658990
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-10.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394085777 1353065269
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-10.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2747151046
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-11.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394085777 1353065269
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-11.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2747151046
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-12.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394085777 1353065269
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-12.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2747151046
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-13.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394085777 1353065269
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-13.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2747151046
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-14.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394085777 1353065269
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-14.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2747151046
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-15.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394085777 1353065269
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-15.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2747151046
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-16.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394085777 1353065269
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-16.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2747151046
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-17.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394085777 1353065269
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-17.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2747151046
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-18.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394085777 1353065269
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-18.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2747151046
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-2.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394068970 1070590020
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-2.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2464658990
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-3.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394068970 1070590020
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-3.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2464658990
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-4.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394068970 1070590020
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-4.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2464658990
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-5.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394068970 1070590020
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-5.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2464658990
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-6.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394068970 1070590020
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-6.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2464658990
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-7.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394068970 1070590020
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-7.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2464658990
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-8.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394068970 1070590020
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-8.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2464658990
1 change: 1 addition & 0 deletions examples/aplusb/tests/aplusb-9.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1394085777 1353065269
2 changes: 1 addition & 1 deletion examples/aplusb/tests/aplusb-9.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
0
2747151046
Empty file.
2 changes: 0 additions & 2 deletions examples/aplusb/tests/tests/aplusb-0.ok

This file was deleted.

Empty file.
2 changes: 0 additions & 2 deletions examples/aplusb/tests/tests/aplusb-1.ok

This file was deleted.

Empty file.
2 changes: 0 additions & 2 deletions examples/aplusb/tests/tests/aplusb-2.ok

This file was deleted.

Empty file.
2 changes: 0 additions & 2 deletions examples/aplusb/tests/tests/aplusb-3.ok

This file was deleted.

36 changes: 23 additions & 13 deletions src/buildtests
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ source problemconfig
# ARGUMENT PARSING
#############################

rebuild_inputs=true

while getopts "r:h" opt; do
while getopts "r:ho" opt; do
case $opt in
h)
echo "Usage: ./run -r(estore) [revision to restore]"
Expand All @@ -25,6 +26,9 @@ while getopts "r:h" opt; do
unzip oldtests/$OPTARG.zip
exit 0
;;
o)
rebuild_inputs=false
;;
esac
done

Expand All @@ -48,25 +52,27 @@ cat testmanifest | while read instr; do
# Build input:
#################

# Build input generator
try "cd ingen && make -s && cd .." "input generator build fail"
if [ $rebuild_inputs = true ] ; then
# Build input generator
cd ingen && make -s && cd ..

# Copy ingen/ingen.bin and incf/$1 into stage
cp ingen/ingen.bin stage/$problemname.bin
try "cp incf/$incf stage/$problemname.cf" "incf/$incf doesn't exist"
# Copy ingen/ingen.bin and incf/$1 into stage
cp ingen/ingen.bin stage/$problemname.bin
cp incf/$incf stage/$problemname.cf

# Build input
try "cd stage && ./$problemname.bin > ../tests/$problemname-$nr.in && cd .." "input generation fail"
# Build input
cd stage && ./$problemname.bin && cp $problemname.in ../tests/$problemname-$nr.in && cd ..

# Clean stage
rm stage/*
# Clean stage
rm stage/*
fi

###################
# Build ok
###################

# Build ok generator
try "cd okgen && make -s && cd .." "ok generator build fil"
cd okgen && make -s && cd ..

# Copy ok generator and input into stage
cp okgen/okgen.bin stage/$problemname.bin
Expand All @@ -76,7 +82,7 @@ cat testmanifest | while read instr; do
echo $points > stage/$problemname.points

# Build ok
try "cd stage && ./$problemname.bin && cd .." "ok generation fail"
cd stage && ./$problemname.bin && cd ..

# Copy ok from stage into tests
cp stage/$problemname.ok tests/$problemname-$nr.ok
Expand All @@ -89,4 +95,8 @@ cat testmanifest | while read instr; do
currtest=$(($currtest + $numberoftests))
done

zip -r oldtests/$testrevision.zip tests/*
if [[ $testrevision = "" ]] ; then
:
else
zip -r oldtests/$testrevision.zip tests/*
fi

0 comments on commit 021ac93

Please sign in to comment.