LupineExerciserPrivate.mesa.
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last edited by BZM on 14-Mar-82 13:23:46.
Last edited by Bob Hagmann on February 8, 1985 5:08:33 pm PST
LupineExerciser*Impl cooperate to export LupineExerciserPrivate.
DIRECTORY
IO USING [STREAM],
LupineExerciser USING [
Counter, Handle,
StandardPasses, StandardTrialsPerPass, StandardTestsPerTrial ];
LupineExerciserPrivate: DEFINITIONS
= BEGIN OPEN LupineExerciser;
Runtime parameters.
TestParameters: TYPE = MACHINE DEPENDENT RECORD [
useDoradoClock (0): BOOLEANFALSE,
countOnlyEmulatorCycles (1): BOOLEANFALSE,
checkResults (2:0..0): BOOLEANTRUE,
testRandomly (2:1..15): BOOLEANFALSE,
passes (3): Counter ← StandardPasses,
trialsPerPass (4), maxTrialsPerPass (5): Counter ← StandardTrialsPerPass,
testsPerTrial (6), maxTestsPerTrial (7): Counter ← StandardTestsPerTrial,
spying (8:0..0): BOOLEANFALSE,
spyOnProcs (8:1..1): BOOLEANTRUE,
showSpyData (8:2..15): {afterEachTest, afterAllTests} ← afterAllTests ];
InitTestParameters: TestParameters = [];
Timers (they should be opaque, but that's even more clumsy than this).
SystemTime: TYPE = LONG CARDINAL; -- Same as System.Pulses.
SystemTimer: PUBLIC TYPE = MACHINE DEPENDENT RECORD [
start, event, elapsed: SystemTime ← 0,
lastDelayFinished: SystemTime ← 0 ];
InitSystemTimer: SystemTimer = [];
PrecisionTime: TYPE = LONG CARDINAL;
RingBufferIndex: TYPE = CARDINAL; --[0..tp.testsPerTrial);
SortBufferIndex: TYPE = CARDINAL; --[0..LAST[RingBufferIndex]+2);
RingBuffer: TYPE = LONG DESCRIPTOR FOR ARRAY RingBufferIndex OF PrecisionTime;
SortBuffer: TYPE = RECORD [SEQUENCE length: SortBufferIndex OF PrecisionTime] ;
PrecisionTimer: PUBLIC TYPE = MACHINE DEPENDENT RECORD [
start: PrecisionTime ← 0,
ringIndex: RingBufferIndex ← 0,
ringBuffer: RingBuffer ← NIL,
sortBuffer: LONG POINTER TO SortBuffer ← NIL ];
InitPrecisionTimer: PrecisionTimer = [];
Exerciser instance data.
ExerciseHandle: TYPE = POINTER TO ExerciseObject;
ExerciseObject: TYPE = RECORD [
tp: TestParameters ← InitTestParameters,
precisionTimer: PrecisionTimer ← InitPrecisionTimer,
timer: SystemTimer ← InitSystemTimer,
inLogStream: IO.STREAMNIL,
outLogStream: IO.STREAMNIL,
logPut: PROC [CHARACTER] ← NIL ];
Internal operations.
CheckAbort: PROC [self: Handle];
SpyOperation: TYPE = {
startAndWatchProcs, startAndWatchModules,
startSpying, stopSpying, displayStats,
stop, stopAndDisplayStats };
CallSpy: PROCEDURE [
self: Handle,
operation: SpyOperation ];
InitPrecisionTimings: PROCEDURE [self: Handle];
FinishPrecisionTimings: PROCEDURE [self: Handle];
END. -- LupineExerciserPrivate.