From 3fcfa44baea71670ccdd5fd3448fff2ff5e5c772 Mon Sep 17 00:00:00 2001 From: Erin van der Veen Date: Mon, 2 Oct 2017 13:47:40 +0200 Subject: Remove Camil's manual test 1.in; Run manual tests automatically --- test/database/1.in | 22 ---------------------- test/runtests.sh | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 22 deletions(-) delete mode 100644 test/database/1.in create mode 100644 test/runtests.sh (limited to 'test') diff --git a/test/database/1.in b/test/database/1.in deleted file mode 100644 index f8b87ed..0000000 --- a/test/database/1.in +++ /dev/null @@ -1,22 +0,0 @@ -[Event "CAN ch"] -[Site "Hamilton"] -[Date "1924.08.20"] -[Round "6"] -[White "Wilson, Stanley B"] -[Black "Ewing, John M"] -[Result "0-1"] -[ECO "B01"] -[PlyCount "118"] -[EventDate "1924.08.18"] - -1. e4 d5 2. exd5 Qxd5 3. Nc3 Qd8 4. Nf3 c6 5. b3 Nf6 6. Bb2 Bf5 7. Be2 e6 8. -O-O Bd6 9. Nh4 Bg6 10. h3 Nbd7 11. Rc1 Nd5 12. Nxd5 Qxh4 13. Ne3 O-O 14. d4 Nf6 -15. Bf3 Nd5 16. Nxd5 exd5 17. c4 dxc4 18. bxc4 Be4 19. Bxe4 Qxe4 20. Re1 Qf4 -21. g3 Qf5 22. Kg2 Rfe8 23. Qb3 b6 24. Re3 Rxe3 25. Qxe3 Qe6 26. Qf3 Rc8 27. d5 -Qd7 28. dxc6 Qxc6 29. Qd5 Qxd5+ 30. cxd5 Rxc1 31. Bxc1 f5 32. Kf3 Kf7 33. Ke2 -Ke7 34. Kd3 Bc5 35. Be3 Kd6 36. Kc4 Bxe3 37. fxe3 Ke5 38. a4 a6 39. a5 bxa5 40. -Kc5 a4 41. d6 Ke6 42. Kc6 a3 43. d7 a2 44. d8=Q a1=Q 45. Qd5+ Ke7 46. Qd7+ Kf8 -47. Qd6+ (47. Qxf5+ Qf6+ 48. Qxf6+ gxf6 49. Kb6) 47... Kf7 48. Qd7+ Kg6 49. -Qe8+ Kh6 50. Qe6+ g6 51. Kb6 Qa4 52. Qe5 a5 53. Qxa5 Qxa5+ 54. Kxa5 Kg5 55. Kb4 -h5 56. Kc3 h4 57. gxh4+ Kxh4 58. Kd3 Kxh3 59. Ke2 59... Kg2 {(Le Pion 1924)} -0-1 diff --git a/test/runtests.sh b/test/runtests.sh new file mode 100644 index 0000000..e9a54c6 --- /dev/null +++ b/test/runtests.sh @@ -0,0 +1,15 @@ +#!/bin/bash +RED='\033[0;31m' +GREEN='\033[0;32m' +RESET='\033[0;30m' + +for f in database/*.in; +do + output=$(diff "${f/in/out}" <(../src/runchess < "$f")) + if [ "$output" = "" ] + then + echo -e "${GREEN}Test $(basename $f .in) passed${RESET}" + else + echo -e "${RED}Test $(basename $f .in) failed${RESET}" + fi +done -- cgit v1.2.3