There was a hole in regression testing. If the regression tests failed with an early exit (e.g. an interpreter exit) then the regression code would certify the test as passing if the subset of tests prior to the failure worked.
Regression tests use "--S N of M" on each start line of each test so it is possible to check whether the final start line fulfills the condition that N=M, that is, the last line reads "--S 20 of 20", etc. If the test exits early, say at test 8, then the "--S 8 of 20" would not fulfill the requirement and an error will now be indicated. This check was added and some failing tests were brought up to the new standard. Failing tests are listed at the end of every system make. ==================================================================== diff --git a/books/bookvol10.3.pamphlet b/books/bookvol10.3.pamphlet index 4c6f3bf..569e470 100644 --- a/books/bookvol10.3.pamphlet +++ b/books/bookvol10.3.pamphlet @@ -51013,26 +51013,210 @@ Kernel(S:OrderedSet): Exports == Implementation where )set message test on )set message auto off )clear all + +--S 1 of 20 ey: KeyedAccessFile(Integer) := open("editor.year", "output") +--R +--R +--R (1) "editor.year" +--R Type: KeyedAccessFile Integer +--E 1 + +--S 2 of 20 ey."Char":= 1986 +--R +--R +--R (2) 1986 +--R Type: PositiveInteger +--E 2 + +--S 3 of 20 ey."Caviness" := 1985 +--R +--R +--R (3) 1985 +--R Type: PositiveInteger +--E 3 + +--S 4 of 20 ey."Fitch" := 1984 +--R +--R +--R (4) 1984 +--R Type: PositiveInteger +--E 4 + +--S 5 of 20 ey."Char" +--R +--R +--RDaly Bug +--R >> Error detected within library code: +--R File is not readable +--R "editor.year" +--R +--R Continuing to read the file... +--R +--E 5 + +--S 6 of 20 ey("Char") +--R +--R +--RDaly Bug +--R >> Error detected within library code: +--R File is not readable +--R "editor.year" +--R +--R Continuing to read the file... +--R +--E 6 + +--S 7 of 20 ey "Char" +--R +--R +--RDaly Bug +--R >> Error detected within library code: +--R File is not readable +--R "editor.year" +--R +--R Continuing to read the file... +--R +--E 7 + +--S 8 of 20 search("Char", ey) +--R +--R +--RDaly Bug +--R >> System error: +--R Cannot create the file NIL/index.kaf. +--R +--R Continuing to read the file... +--R +--E 8 + +--S 9 of 20 search("Smith", ey) +--R +--R +--RDaly Bug +--R >> System error: +--R Cannot create the file NIL/index.kaf. +--R +--R Continuing to read the file... +--R +--E 9 + +--S 10 of 20 remove!("Char", ey) +--R +--R +--RDaly Bug +--R >> System error: +--R Cannot create the file NIL/index.kaf. +--R +--R Continuing to read the file... +--R +--E 10 + +--S 11 of 20 keys ey +--R +--R +--RDaly Bug +--R >> System error: +--R Cannot create the file NIL/index.kaf. +--R +--R Continuing to read the file... +--R +--E 11 + +--S 12 of 20 #ey +--R +--R +--RDaly Bug +--R >> System error: +--R Cannot create the file NIL/index.kaf. +--R +--R Continuing to read the file... +--R +--E 12 + +--S 13 of 20 KE := Record(key: String, entry: Integer) +--R +--R +--R (5) Record(key: String,entry: Integer) +--R Type: Domain +--E 13 + +--S 14 of 20 reopen!(ey, "output") +--R +--R +--R (6) "editor.year" +--R Type: KeyedAccessFile Integer +--E 14 + +--S 15 of 20 write!(ey, ["van Hulzen", 1983]$KE) +--R +--R +--R (7) [key= "van Hulzen",entry= 1983] +--R Type: Record(key: String,entry: Integer) +--E 15 + +--S 16 of 20 write!(ey, ["Calmet", 1982]$KE) +--R +--R +--R (8) [key= "Calmet",entry= 1982] +--R Type: Record(key: String,entry: Integer) +--E 16 + +--S 17 of 20 write!(ey, ["Wang", 1981]$KE) +--R +--R +--R (9) [key= "Wang",entry= 1981] +--R Type: Record(key: String,entry: Integer) +--E 17 + +--S 18 of 20 close! ey +--R +--R +--R (10) "editor.year" +--R Type: KeyedAccessFile Integer +--E 18 + +--S 19 of 20 keys ey +--R +--R +--RDaly Bug +--R >> System error: +--R Cannot create the file NIL/index.kaf. +--R +--R Continuing to read the file... +--R +--E 19 + +--S 20 of 20 members ey +--R +--R +--RDaly Bug +--R >> System error: +--R Cannot create the file NIL/index.kaf. +--R +--R Continuing to read the file... +--R +--E 20 + )system rm -r editor.year )spool )lisp (bye) diff --git a/books/bookvol10.4.pamphlet b/books/bookvol10.4.pamphlet index fb1fa99..9884d3b 100644 --- a/books/bookvol10.4.pamphlet +++ b/books/bookvol10.4.pamphlet @@ -5122,14 +5122,14 @@ BasicOperatorFunctions1(A:SetCategory): Exports == Implementation where )set message test on )set message auto off )clear all ---S 1 +--S 1 of 6 n:=linearBezier([2.0,2.0],[4.0,4.0]) --R --I (1) theMap(BEZIER;linearBezier;2LM;1!0,707) --R Type: (Float -> List Float) --E 1 ---S 2 +--S 2 of 6 [n(t/10.0) for t in 0..10 by 1] --R --R (2) @@ -5138,14 +5138,14 @@ n:=linearBezier([2.0,2.0],[4.0,4.0]) --R Type: List List Float --E 2 ---S 3 +--S 3 of 6 n:=quadraticBezier([2.0,2.0],[4.0,4.0],[6.0,2.0]) --R --I (3) theMap(BEZIER;quadraticBezier;3LM;2!0,291) --R Type: (Float -> List Float) --E 3 ---S 4 +--S 4 of 6 [n(t/10.0) for t in 0..10 by 1] --R --R (4) @@ -5154,14 +5154,14 @@ n:=quadraticBezier([2.0,2.0],[4.0,4.0],[6.0,2.0]) --R Type: List List Float --E 4 ---S 5 +--S 5 of 6 n:=cubicBezier([2.0,2.0],[2.0,4.0],[6.0,4.0],[6.0,2.0]) --R --I (5) theMap(BEZIER;cubicBezier;4LM;3!0,915) --R Type: (Float -> List Float) --E 5 ---S 6 +--S 6 of 6 [n(t/10.0) for t in 0..10 by 1] --R --R (6) @@ -44096,117 +44096,188 @@ IntegerLinearDependence(R): Exports == Implementation where )set message test on )set message auto off )clear all + +--S 1 of 30 div144 := divisors(144) --R --R --R (1) [1,2,3,4,6,8,9,12,16,18,24,36,48,72,144] --R Type: List Integer +--E 1 + +--S 2 of 30 #(div144) --R --R --R (2) 15 --R Type: PositiveInteger +--E 2 + +--S 3 of 30 reduce(+,div144) --R --R --R (3) 403 --R Type: PositiveInteger +--E 3 + +--S 4 of 30 numberOfDivisors(144) --R --R --R (4) 15 --R Type: PositiveInteger +--E 4 + +--S 5 of 30 sumOfDivisors(144) --R --R --R (5) 403 --R Type: PositiveInteger +--E 5 + +--S 6 of 30 f1(n)==reduce(+,[moebiusMu(d)*numberOfDivisors(quo(n,d))_ for d in divisors(n)]) --R --R Type: Void +--E 6 + +--S 7 of 30 f1(200) --R --R Compiling function f1 with type PositiveInteger -> Integer --R --R (7) 1 --R Type: PositiveInteger +--E 7 + +--S 8 of 30 f1(846) --R --R --R (8) 1 --R Type: PositiveInteger +--E 8 + +--S 9 of 30 f2(n) == reduce(+,[moebiusMu(d) * sumOfDivisors(quo(n,d))_ for d in divisors(n)]) --R --R Type: Void +--E 9 + +--S 10 of 30 f2(200) --R --R Compiling function f2 with type PositiveInteger -> Integer --R --R (10) 200 --R Type: PositiveInteger +--E 10 + +--S 11 of 30 f2(846) --R --R --R (11) 846 --R Type: PositiveInteger +--E 11 + +--S 12 of 30 fibonacci(25) --R --R --R (12) 75025 --R Type: PositiveInteger +--E 12 + +--S 13 of 30 [fibonacci(n) for n in 1..15] --R --R --R (13) [1,1,2,3,5,8,13,21,34,55,89,144,233,377,610] --R Type: List Integer +--E 13 + +--S 14 of 30 fib(n) == reduce(+,[binomial(n-1-k,k) for k in 0..quo(n-1,2)]) --R --R Type: Void +--E 14 + +--S 15 of 30 fib(25) --R --R Compiling function fib with type PositiveInteger -> Integer --R --R (15) 75025 --R Type: PositiveInteger +--E 15 + +--S 16 of 30 [fib(n) for n in 1..15] --R --R --R (16) [1,1,2,3,5,8,13,21,34,55,89,144,233,377,610] --R Type: List Integer +--E 16 + +--S 17 of 30 legendre(3,5) --R --R --R (17) - 1 --R Type: Integer +--E 17 + +--S 18 of 30 legendre(23,691) --R --R --R (18) - 1 --R Type: Integer +--E 18 + +--S 19 of 30 h(d) == quo(reduce(+,[jacobi(d,k) for k in 1..quo(-d, 2)]),2-jacobi(d,2)) --R --R Type: Void +--E 19 + +--S 20 of 30 h(-163) --R --R Compiling function h with type Integer -> Integer --R --R (20) 1 --R Type: PositiveInteger +--E 20 + +--S 21 of 30 h(-499) --R --R --R (21) 3 --R Type: PositiveInteger +--E 21 + +--S 22 of 30 h(-1832) --R --R --R (22) 26 --R Type: PositiveInteger +--E 22 + +--S 23 of 30 inverse:(INT,INT)->INT --R --R Type: Void +--E 23 + +--S 24 of 30 inverse(a,b) == borg:INT:=b c1:INT := 1 @@ -44221,6 +44292,9 @@ inverse(a,b) == positiveRemainder(c1,borg) --R --R Type: Void +--E 24 + +--S 25 of 30 inverse(15,26) --R --R Compiling function inverse with type (Integer,Integer) -> Integer @@ -44233,31 +44307,48 @@ inverse(15,26) --R --R (25) 7 --R Type: PositiveInteger +--E 25 + +--S 26 of 30 x1:=4 --R --R --R (26) 4 --R Type: PositiveInteger +--E 26 + +--S 27 of 30 m1:=5 --R --R --R (27) 5 --R Type: PositiveInteger +--E 27 + +--S 28 of 30 x2:=2 --R --R --R (28) 2 --R Type: PositiveInteger +--E 28 + +--S 29 of 30 m2:=3 --R --R --R (29) 3 --R Type: PositiveInteger +--E 29 + +--S 30 of 30 result:=chineseRemainder(x1,m1,x2,m2) --R --R --R (30) 14 --R Type: PositiveInteger +--E 30 + )spool )lisp (bye) @ diff --git a/books/bookvol5.pamphlet b/books/bookvol5.pamphlet index 187e50b..ed8f089 100644 --- a/books/bookvol5.pamphlet +++ b/books/bookvol5.pamphlet @@ -1105,7 +1105,7 @@ They appear to only be used to initialize the boot dollar variables. <<defun serverReadLine>>= (defun |serverReadLine| (stream) "used in place of READ-LINE in a Axiom server system." - (let (in-stream *eof* l framename currentframe form stringbuf line) + (let (in-stream *eof* l framename currentframe form stringbuf line action) (declare (special in-stream *eof* |$SpadServer| |$EndServerSession| |$NeedToSignalSessionManager| |$SessionManager| |$EndOfOutput| |$CallInterp| |$CreateFrame| |$frameAlist| |$frameNumber| @@ -1228,7 +1228,7 @@ They appear to only be used to initialize the boot dollar variables. \defmacro{Rest} <<defmacro Rest>>= -(defmacro |Rest| (s) +(defmacro |Rest| () "used in incLude1 for parsing; s is not used." '(|incLude| eb (cdr ss) lno ufos states)) @@ -1363,40 +1363,40 @@ They appear to only be used to initialize the boot dollar variables. ((null (elt info 0)) (cond ((|Skipping?| state) - (cons (|xlSkip| eb str lno (elt ufos 0)) (|Rest| |s|))) + (cons (|xlSkip| eb str lno (elt ufos 0)) (|Rest|))) (t - (cons (|xlOK| eb str lno (elt ufos 0)) (|Rest| |s|))))) + (cons (|xlOK| eb str lno (elt ufos 0)) (|Rest|))))) ((equal (elt info 2) "other") (cond ((|Skipping?| state) - (cons (|xlSkip| eb str lno (elt ufos 0)) (|Rest| |s|))) + (cons (|xlSkip| eb str lno (elt ufos 0)) (|Rest|))) (t (cons (|xlOK1| eb str (concat ")command" str) lno (elt ufos 0)) - (|Rest| |s|))))) + (|Rest|))))) ((equal (elt info 2) "say") (cond ((|Skipping?| state) - (cons (|xlSkip| eb str lno (elt ufos 0)) (|Rest| |s|))) + (cons (|xlSkip| eb str lno (elt ufos 0)) (|Rest|))) (t (progn (setq str (|incCommandTail| str info)) (cons (|xlSay| eb str lno ufos str) - (cons (|xlOK| eb str lno (ELT ufos 0)) (|Rest| |s|))))))) + (cons (|xlOK| eb str lno (ELT ufos 0)) (|Rest|))))))) ((equal (elt info 2) "include") (cond ((|Skipping?| state) - (cons (|xlSkip| eb str lno (elt ufos 0)) (|Rest| |s|))) + (cons (|xlSkip| eb str lno (elt ufos 0)) (|Rest|))) (t (progn (setq fn1 (|inclFname| str info)) (cond ((null fn1) - (cons (|xlNoSuchFile| eb str lno ufos |fn|) (|Rest| |s|))) + (cons (|xlNoSuchFile| eb str lno ufos fn1) (|Rest|))) ((null (probe-file fn1)) - (cons (|xlCannotRead| eb str lno ufos fn1) (|Rest| |s|))) + (cons (|xlCannotRead| eb str lno ufos fn1) (|Rest|))) ((|incActive?| fn1 ufos) - (cons (|xlFileCycle| eb str lno ufos fn1) (|Rest| |s|))) + (cons (|xlFileCycle| eb str lno ufos fn1) (|Rest|))) (t (progn (setq includee @@ -1406,11 +1406,11 @@ They appear to only be used to initialize the boot dollar variables. (cons fn1 ufos) (cons |Top| states))) (cons (|xlOK| eb str lno (elt ufos 0)) - (|incAppend| includee (|Rest| |s|)))))))))) + (|incAppend| includee (|Rest|)))))))))) ((equal (elt info 2) "console") (cond ((|Skipping?| state) - (cons (|xlSkip| eb str lno (elt ufos 0)) (|Rest| |s|))) + (cons (|xlSkip| eb str lno (elt ufos 0)) (|Rest|))) (t (progn (setq head @@ -1419,7 +1419,7 @@ They appear to only be used to initialize the boot dollar variables. 0 (cons "console" ufos) (cons |Top| states))) - (setq tail (|Rest| |s|)) + (setq tail (|Rest|)) (setq n (|incNConsoles| ufos)) (cond ((< 0 n) @@ -1433,7 +1433,7 @@ They appear to only be used to initialize the boot dollar variables. ((equal (elt info 2) "fin") (cond ((|Skipping?| state) - (cons (|xlSkippingFin| eb str lno ufos) (|Rest| |s|))) + (cons (|xlSkippingFin| eb str lno ufos) (|Rest|))) ((null (|Top?| state)) (cons (|xlPrematureFin| eb str lno ufos) |StreamNil|)) (t @@ -1441,12 +1441,12 @@ They appear to only be used to initialize the boot dollar variables. ((equal (elt info 2) "assert") (cond ((|Skipping?| state) - (cons (|xlSkippingFin| eb str lno ufos) (|Rest| |s|))) + (cons (|xlSkippingFin| eb str lno ufos) (|Rest|))) (t (progn (|assertCond| str info) (cons (|xlOK| eb str lno (elt ufos 0)) - (|incAppend| includee (|Rest| |s|))))))) + (|incAppend| includee (|Rest|))))))) ((equal (elt info 2) "if") (progn (setq s1 diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 322172d..4b6e6b4 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -1088,5 +1088,7 @@ Makefile report regression failures<br/> bookvol10.4 add Bezier package<br/> <a href="patches/20090415.01.tpd.patch">20090415.01.tpd.patch</a> bookvol5 add \defunsec, section titles, docstrings<br/> +<a href="patches/20090416.01.tpd.patch">20090416.01.tpd.patch</a> +regress.lisp tighten checks on regression tests<br/> </body> </html> diff --git a/src/input/contfrac.input.pamphlet b/src/input/contfrac.input.pamphlet index 0044f79..c982a22 100644 --- a/src/input/contfrac.input.pamphlet +++ b/src/input/contfrac.input.pamphlet @@ -233,7 +233,7 @@ a / b --R Type: ContinuedFraction Complex Integer --E 20 ---E 21 +--S 21 of 40 convergents % --R --R diff --git a/src/input/overload.input.pamphlet b/src/input/overload.input.pamphlet index d5c7ada..fbe3eeb 100644 --- a/src/input/overload.input.pamphlet +++ b/src/input/overload.input.pamphlet @@ -31,7 +31,7 @@ understandable, some not(?), below. The cos function will produce float outcomes for float arguments <<*>>= ---S 1 of 28 +--S 1 of 51 cos(1.237) --R --R @@ -43,7 +43,7 @@ cos(1.237) can handle expressions that mix floats and integers <<*>>= ---S 2 of 28 +--S 2 of 51 cos(1.237/2) --R --R @@ -56,7 +56,7 @@ but will respect an integer expression, as we would want it to, by not evaluating <<*>>= ---S 3 of 28 +--S 3 of 51 cos(2/3) --R --R @@ -76,7 +76,7 @@ constand in each expression which results in a proper implicit selection of which ``/'' definitition to use. <<*>>= ---S 4 of 28 +--S 4 of 51 cos(2/3::Float) --R --R @@ -84,7 +84,7 @@ cos(2/3::Float) --R Type: Float --E 4 ---S 5 of 28 +--S 5 of 51 cos((2/3)::Float) --R --R @@ -92,7 +92,7 @@ cos((2/3)::Float) --R Type: Float --E 5 ---S 6 of 28 +--S 6 of 51 cos(2/3$Float) --R --R @@ -100,7 +100,7 @@ cos(2/3$Float) --R Type: Float --E 6 ---S 7 of 28 +--S 7 of 51 cos((2/3)$Float) --R --R @@ -108,7 +108,7 @@ cos((2/3)$Float) --R Type: Float --E 7 ---S 8 of 28 +--S 8 of 51 cos(2/3...@float) --R --R @@ -116,7 +116,7 @@ cos(2/3...@float) --R Type: Float --E 8 ---S 9 of 28 +--S 9 of 51 cos((2/3)@Float) --R --R @@ -130,7 +130,7 @@ fact. Coercion operates ``on the surface and not deeply'' as illustrated here. <<*>>= ---S 10 of 28 +--S 10 of 51 cos(2/3)::Float --R --R @@ -147,7 +147,7 @@ However, there is a real need for a deep coercion operator that operates on the innermost atomic constants. Suppose we define <<*>>= ---S 11 of 28 +--S 11 of 51 cosf(x:Expression Integer):Expression Integer == 1+cos(x/2) --R --R Function declaration cosf : Expression Integer -> Expression Integer @@ -169,7 +169,7 @@ general way because it is a tangled web we weave when we practice to decieve. <<*>>= ---S 12 of 28 +--S 12 of 51 cosf(2/3) --R --R Compiling function cosf with type Expression Integer -> Expression @@ -181,7 +181,7 @@ cosf(2/3) --R Type: Expression Integer --E 12 ---S 13 of 28 +--S 13 of 51 cosf((2/3)::Float) --R --R Conversion failed in the compiled user function cosf . @@ -205,7 +205,7 @@ Bizarrely, the draw function seems to have the power to override the type problem as shown here <<*>>= ---S 14 of 28 +--S 14 of 51 --draw(cosf(x),x=0..15) --E 14 @@ -223,7 +223,7 @@ example, in Maple ``cos(2/3)+1.2323'' remains as is, while in Axiom we get <<*>>= ---S 15 of 28 +--S 15 of 51 cos(2/3)+1.2323 --R --R @@ -238,7 +238,7 @@ force combination of itself with an Integer. It simply results in a new kind of Integer evaluation of type Pi <<*>>= ---S 16 of 28 +--S 16 of 51 3/4+%pi --R --R @@ -255,7 +255,7 @@ Now let's examine properties and problems with overloading. Define the type $Q$ of Hamiltonian biquaternions <<*>>= ---S 17 of 28 +--S 17 of 51 C:=Complex Expression Integer --R --R @@ -263,7 +263,7 @@ C:=Complex Expression Integer --R Type: Domain --E 17 ---S 18 of 28 +--S 18 of 51 Q:=Quaternion C --R --R @@ -276,7 +276,7 @@ While developing the support functions, this definition of biquat division was introduced to simplify the format of the formulae <<*>>= ---S 19 of 28 +--S 19 of 51 ((x:Q)/(y:Q)):Q == x*inv(y) --R --R Function declaration ?/? : (Quaternion Complex Expression Integer, @@ -291,7 +291,7 @@ On the face, it would appear all is normal, here's an example of integer division <<*>>= ---S 20 of 28 +--S 20 of 51 x:=15/6 --R --R Compiling function / with type (Quaternion Complex Expression @@ -310,7 +310,7 @@ notice this, and proceed, some things seem still to act normally, for example, no complaint from Axiom with <<*>>= ---S 21 of 28 +--S 21 of 51 cos(x) --R --R @@ -324,7 +324,7 @@ cos(x) Of course, we still get a correct answer with <<*>>= ---S 22 of 28 +--S 22 of 51 cos(1.237) --R --R @@ -336,7 +336,7 @@ cos(1.237) But let's try to apply this as a simple mixed float/integer function <<*>>= ---S 23 of 28 +--S 23 of 51 cos(15.457/6) --R --R Conversion failed in the compiled user function / . @@ -355,7 +355,7 @@ Well, what if we built a new cosine function that forced the form of the arguments into certain types to avoid mismatch? <<*>>= ---S 24 of 28 +--S 24 of 51 c(y:Float):Float == cos(y) --R --R Function declaration c : Float -> Float has been added to workspace. @@ -366,7 +366,7 @@ c(y:Float):Float == cos(y) At first this seems to work, we can still evaluate a float <<*>>= ---S 25 of 28 +--S 25 of 51 c(1.237) --R --R Compiling function c with type Float -> Float @@ -380,7 +380,7 @@ and we can even get a float answer when we introduce the integer coercible biquat variable value generated from the above. <<*>>= ---S 26 of 28 +--S 26 of 51 c(x) --R --R @@ -394,7 +394,7 @@ expressions because of the ``/'' operation still not being resolved correctly. <<*>>= ---S 27 of 28 +--S 27 of 51 c(1.237/2) --R --R Conversion failed in the compiled user function / . @@ -414,7 +414,7 @@ Our results are mixed. Recall that each of the following worked in the previous case, producing the correct floating result in each case. <<*>>= ---S 28 of 28 +--S 28 of 51 cos(2/3::Float) --R --R @@ -424,7 +424,7 @@ cos(2/3::Float) --R Type: Expression Integer --E 28 ---S 29 of 28 +--S 29 of 51 cos((2/3)::Float) --R --R @@ -432,7 +432,7 @@ cos((2/3)::Float) --R Type: Float --E 29 ---S 30 of 28 +--S 30 of 51 cos(2/3$Float) --R --R @@ -442,7 +442,7 @@ cos(2/3$Float) --R Type: Expression Integer --E 30 ---S 31 of 28 +--S 31 of 51 cos((2/3)$Float) --R --R @@ -450,7 +450,7 @@ cos((2/3)$Float) --R Type: Float --E 31 ---S 32 of 28 +--S 32 of 51 cos(2/3...@float) --R --R @@ -460,7 +460,7 @@ cos(2/3...@float) --R Type: Expression Integer --E 32 ---S 33 of 28 +--S 33 of 51 cos((2/3)@Float) --R --R @@ -475,7 +475,7 @@ Try these examples with our type constrained function, which has better luck now <<*>>= ---S 34 of 28 +--S 34 of 51 c(2/3::Float) --R --R @@ -483,7 +483,7 @@ c(2/3::Float) --R Type: Float --E 34 ---S 35 of 28 +--S 35 of 51 c((2/3)::Float) --R --R @@ -491,7 +491,7 @@ c((2/3)::Float) --R Type: Float --E 35 ---S 36 of 28 +--S 36 of 51 c(2/3$Float) --R --R @@ -499,7 +499,7 @@ c(2/3$Float) --R Type: Float --E 36 ---S 37 of 28 +--S 37 of 51 c((2/3)$Float) --R --R @@ -507,7 +507,7 @@ c((2/3)$Float) --R Type: Float --E 37 ---S 38 of 28 +--S 38 of 51 c(2/3...@float) --R --R @@ -515,7 +515,7 @@ c(2/3...@float) --R Type: Float --E 38 ---S 39 of 28 +--S 39 of 51 c((2/3)@Float) --R --R @@ -531,13 +531,13 @@ to the function we defined? Let's repeat the entire example with this single change for the function c2 <<*>>= ---S 40 of 28 +--S 40 of 51 c2(y) == cos(y) --R --R Type: Void --E 40 ---S 41 of 28 +--S 41 of 51 c2(1.237) --R --R Compiling function c2 with type Float -> Float @@ -546,7 +546,7 @@ c2(1.237) --R Type: Float --E 41 ---S 42 of 28 +--S 42 of 51 c2(x) --R --R There are 2 exposed and 6 unexposed library operations named cos @@ -575,7 +575,7 @@ But that was only misdirection, because this breaks down for reasonable expressions <<*>>= ---S 43 of 28 +--S 43 of 51 c2(1.237/2) --R --R Conversion failed in the compiled user function / . @@ -592,7 +592,7 @@ and various attempts at coercion also fail -- compare these results to the previous ones <<*>>= ---S 44 of 28 +--S 44 of 51 c2(2/3::Float) --R --R @@ -602,7 +602,7 @@ c2(2/3::Float) --R Type: Expression Integer --E 44 ---S 45 of 28 +--S 45 of 51 c2((2/3)::Float) --R --R @@ -610,7 +610,7 @@ c2((2/3)::Float) --R Type: Float --E 45 ---S 46 of 28 +--S 46 of 51 c2(2/3$Float) --R --R @@ -620,7 +620,7 @@ c2(2/3$Float) --R Type: Expression Integer --E 46 ---S 47 of 28 +--S 47 of 51 c2((2/3)$Float) --R --R @@ -628,7 +628,7 @@ c2((2/3)$Float) --R Type: Float --E 47 ---S 48 of 28 +--S 48 of 51 c2(2/3...@float) --R --R @@ -638,7 +638,7 @@ c2(2/3...@float) --R Type: Expression Integer --E 48 ---S 49 of 28 +--S 49 of 51 c2((2/3)@Float) --R --R @@ -655,7 +655,7 @@ internal types we saw take place with draw in the example prior to the introduction of operator overloading. <<*>>= ---S 50 of 28 +--S 50 of 51 --draw(c(x),x=0..15) --E 50 @@ -666,7 +666,7 @@ that we just saw it above still working with Integer and Float arguments applied directly. <<*>>= ---S 51 of 28 +--S 51 of 51 --draw(cos(x),x=0..15) --E 51 diff --git a/src/interp/regress.lisp.pamphlet b/src/interp/regress.lisp.pamphlet index f199edc..048fe3e 100644 --- a/src/interp/regress.lisp.pamphlet +++ b/src/interp/regress.lisp.pamphlet @@ -62,8 +62,12 @@ failures are marked. <<*>>= (in-package "BOOT") +(defvar *all-tests-ran* nil "true implies that all tests ran") + (defun regress (infile) (let (name comment test (count 0) (passed 0) (failed 0)) + (declare (special *all-tests-ran*)) + (setq *all-tests-ran* nil) (with-open-file (stream infile :direction :input) (setq name (getspoolname stream)) (when name @@ -83,7 +87,9 @@ failures are marked. (format t "regression result passed ~a of ~a stanzas ~Tfile ~a~%" passed count name) (format t "regression result FAILED ~a of ~a stanzas ~Tfile ~a~%" - failed count name)))))) + failed count name)) + (unless *all-tests-ran* + (format t "regression result FAILED early exit in file ~a?~%" name)))))) @ \subsection{defun getspoolname} @@ -217,10 +223,20 @@ This is useful for handling random results or gensym symbols. @ \subsection{defun startp} This test returns true if we have a ``start'' line. That is, a line -with a ``--S'' prefix. +with a ``--S'' prefix. + +The *all-tests-ran* variable is true if the start line is of the form +"--S N of M" and N=M, that is, it checks that all tests were performed +since this should only occur on the last start line. This will detect +``premature exit'' in processing. <<*>>= (defun startp (oneline) - (and (>= (length oneline) 3) (string= (subseq oneline 0 3) "--S"))) + (let (result) + (when + (setq result + (and (>= (length oneline) 3) (string= (subseq oneline 0 3) "--S"))) + (setq *all-tests-ran* (lastcount oneline))) + result)) @ \subsection{defun endedp} @@ -247,6 +263,39 @@ with a ``--I'' prefix. (and (>= (length oneline) 3) (string= (subseq oneline 0 3) "--I"))) @ +\subsection{defun lastcount} +If the ``--S'' line has the format ``--S n of m'' we return true if +n=m, false otherwise. +Thus, +\begin{verbatim} + "--S" => nil + "--S 1 of 4" => nil + "--S 10 of 40" => nil + "--S 4 of 4" => t + "--S 40 of 40" => t + "--S 1 of a" => nil +\end{verbatim} +This is used as a final end check to make sure that all of the +tests actually ran rather than having the regression test exit +early and quietly. This will be false on all but the last test +and will be false if the ``--S'' line does not contain the optional +count marker. It is not required but is highly recommended. +<<*>>= +(defun lastcount (oneline) + (let ((n :done) (m :done) next somemore) + (when (and (>= (length oneline) 3) (string= (subseq oneline 0 3) "--S")) + (setq somemore (string-trim " " (subseq oneline 3))) + (when somemore + (multiple-value-setq (n next) (read-from-string somemore nil :done)) + (when (integerp n) + (setq somemore (string-trim " " (subseq somemore next))) + (multiple-value-setq (isof next) (read-from-string somemore nil :done)) + (when (string= isof "OF") + (setq somemore (string-trim " " (subseq somemore next))) + (multiple-value-setq (m next) (read-from-string somemore nil :done)))))) + (and (integerp m) (integerp n) (= m n)))) + +@ \eject \begin{thebibliography}{99} \bibitem{1} nothing _______________________________________________ Axiom-developer mailing list Axiom-developer@nongnu.org http://lists.nongnu.org/mailman/listinfo/axiom-developer