diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/result/train.out | 192 | ||||
-rw-r--r-- | tests/source/train.scade | 12 | ||||
-rwxr-xr-x | tests/testanalyze.sh | 14 |
3 files changed, 115 insertions, 103 deletions
diff --git a/tests/result/train.out b/tests/result/train.out index 4af78b5..061ff7a 100644 --- a/tests/result/train.out +++ b/tests/result/train.out @@ -1,101 +1,101 @@ -0. 0 0 0 +0. -1 0 0 1. 0 0 0 2. 0 0 0 3. 0 0 0 4. 0 0 0 -5. 0 0 0 +5. 1 0 0 6. 0 0 0 -7. 0 0 0 -8. 0 0 0 -9. 0 0 0 -10. 0 0 0 -11. 0 0 0 -12. 0 0 0 -13. 0 0 0 -14. 0 0 0 -15. 0 0 0 -16. 0 0 0 -17. 0 0 0 -18. 0 0 0 -19. 0 0 0 -20. 0 0 0 -21. 0 0 0 -22. 0 0 0 -23. 0 0 0 -24. 0 0 0 -25. 0 0 0 -26. 0 0 0 -27. 0 0 0 -28. 0 0 0 -29. 0 0 0 -30. 0 0 0 -31. 0 0 0 -32. 0 0 0 -33. 0 0 0 -34. 0 0 0 -35. 0 0 0 -36. 0 0 0 -37. 0 0 0 -38. 0 0 0 -39. 0 0 0 -40. 0 0 0 -41. 0 0 0 -42. 0 0 0 -43. 0 0 0 -44. 0 0 0 -45. 0 0 0 -46. 0 0 0 -47. 0 0 0 -48. 0 0 0 -49. 0 0 0 -50. 0 0 0 -51. 0 0 0 -52. 0 0 0 -53. 0 0 0 -54. 0 0 0 -55. 0 0 0 -56. 0 0 0 -57. 0 0 0 -58. 0 0 0 -59. 0 0 0 -60. 1 0 0 -61. 1 0 0 -62. 1 0 0 -63. 1 0 0 -64. 1 0 0 -65. 1 0 0 -66. 1 0 0 -67. 1 0 0 -68. 1 0 0 -69. 1 0 0 -70. 1 0 0 -71. 1 0 0 -72. 1 0 0 -73. 1 0 0 -74. 1 0 0 -75. 1 0 0 -76. 1 0 0 -77. 1 0 0 -78. 1 0 0 -79. 1 0 0 -80. 1 0 0 -81. 1 0 0 -82. 1 0 0 -83. 1 0 0 -84. 1 0 0 -85. 1 0 0 -86. 1 0 0 -87. 1 0 0 -88. 1 0 0 -89. 1 0 0 -90. 1 0 0 -91. 1 0 0 -92. 1 0 0 -93. 1 0 0 -94. 1 0 0 -95. 1 0 0 -96. 1 0 0 -97. 1 0 0 -98. 1 0 0 -99. 1 0 0 -100. 1 0 0 +7. 1 0 0 +8. 1 0 0 +9. 1 0 0 +10. 1 0 0 +11. 2 0 0 +12. 1 0 0 +13. 2 0 0 +14. 2 0 0 +15. 2 0 0 +16. 2 0 0 +17. 3 0 0 +18. 2 0 0 +19. 3 0 0 +20. 3 0 0 +21. 3 0 0 +22. 3 0 0 +23. 4 0 0 +24. 3 0 0 +25. 4 0 0 +26. 4 0 0 +27. 4 0 0 +28. 4 0 0 +29. 5 0 0 +30. 4 0 0 +31. 5 0 0 +32. 5 0 0 +33. 5 0 0 +34. 5 0 0 +35. 6 0 0 +36. 5 0 0 +37. 6 0 0 +38. 6 0 0 +39. 6 0 0 +40. 6 0 0 +41. 7 0 0 +42. 6 0 0 +43. 7 0 0 +44. 7 0 0 +45. 7 0 0 +46. 7 0 0 +47. 8 0 0 +48. 7 0 0 +49. 8 0 0 +50. 8 0 0 +51. 8 0 0 +52. 8 0 0 +53. 9 0 0 +54. 8 0 0 +55. 9 0 0 +56. 9 0 0 +57. 9 0 0 +58. 9 0 0 +59. 10 0 0 +60. 9 1 0 +61. 10 1 0 +62. 10 1 0 +63. 10 1 0 +64. 10 1 0 +65. 11 1 0 +66. 10 1 0 +67. 11 1 0 +68. 11 1 0 +69. 11 1 0 +70. 11 1 0 +71. 12 1 0 +72. 11 1 0 +73. 12 1 0 +74. 12 1 0 +75. 12 1 0 +76. 12 1 0 +77. 13 1 0 +78. 12 1 0 +79. 13 1 0 +80. 13 1 0 +81. 13 1 0 +82. 13 1 0 +83. 14 1 0 +84. 13 1 0 +85. 14 1 0 +86. 14 1 0 +87. 14 1 0 +88. 14 1 0 +89. 15 1 0 +90. 14 1 0 +91. 15 1 0 +92. 15 1 0 +93. 15 1 0 +94. 15 1 0 +95. 16 1 0 +96. 15 1 0 +97. 16 1 0 +98. 16 1 0 +99. 16 1 0 +100. 16 1 0 diff --git a/tests/source/train.scade b/tests/source/train.scade index c51971e..0b93b2f 100644 --- a/tests/source/train.scade +++ b/tests/source/train.scade @@ -9,8 +9,7 @@ let else 0); tel -node train(beacon, second: bool) returns (early, late: bool) -var probe advance: int; +node train(beacon, second: bool) returns (early, late: bool; probe advance: int) let advance = diff(beacon, second); @@ -50,9 +49,9 @@ let returns alarm; tel -node train_check(beacon, second: bool) returns (early, late, alarm: bool) +node train_check(beacon, second: bool) returns (early, late, alarm: bool; adv: int) let - early, late = train(beacon, second); + early, late, adv = train(beacon, second); alarm = observer(early, late); guarantee ok : not alarm; tel @@ -61,9 +60,8 @@ node test(i: int) returns(a, b, c: int; exit: bool) var early, late, alarm: bool; let exit = i >= 100; - early, late, alarm = train_check((i+1) mod 2 = 0, i mod 3 = 0); + early, late, alarm, a = train_check((i+1) mod 2 = 0, i mod 3 = 0); c = if alarm then 1 else 0; - a = if early then 1 else 0; - b = if late then 1 else 0; + b = if early then 1 else if late then 2 else 0; tel diff --git a/tests/testanalyze.sh b/tests/testanalyze.sh new file mode 100755 index 0000000..8b1add2 --- /dev/null +++ b/tests/testanalyze.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +for a in source/*.scade; do + if ../analyze --test $a > /tmp/analyze_out.txt; + then + if diff -B /tmp/analyze_out.txt result/`basename $a .scade`.out >/dev/null; then + echo "OK $a" + else + echo "FAIL $a" + fi + else + echo "TODO $a" + fi +done |