-- File [Ivy]Lupine>LupineExerciserPrivate.mesa. -- Last edited by BZM on 14-Mar-82 13:23:46. -- LupineExerciser*Impl cooperate to export LupineExerciserPrivate. DIRECTORY LupineExerciser USING [ Counter, Handle, StandardPasses, StandardTrialsPerPass, StandardTestsPerTrial ], TTY USING [Handle]; LupineExerciserPrivate: DEFINITIONS = BEGIN OPEN LupineExerciser; -- Runtime parameters. TestParameters: TYPE = MACHINE DEPENDENT RECORD [ useDoradoClock (0): BOOLEAN _ FALSE, countOnlyEmulatorCycles (1): BOOLEAN _ FALSE, checkResults (2:0..0): BOOLEAN _ TRUE, testRandomly (2:1..15): BOOLEAN _ FALSE, passes (3): Counter _ StandardPasses, trialsPerPass (4), maxTrialsPerPass (5): Counter _ StandardTrialsPerPass, testsPerTrial (6), maxTestsPerTrial (7): Counter _ StandardTestsPerTrial, spying (8:0..0): BOOLEAN _ FALSE, spyOnProcs (8:1..1): BOOLEAN _ TRUE, 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, logStream: TTY.Handle _ , 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.