|
Class: InstrumentationContext
Object
|
+--InstrumentationContext
- Package:
- stx:libcomp
- Category:
- System-Compiler-Instrumentation
- Version:
- rev:
1.19
date: 2021/01/20 10:32:13
- user: cg
- file: InstrumentationContext.st directory: libcomp
- module: stx stc-classLibrary: libcomp
installed as a thread-local variable (instrumentationContext) by the
beActiveIn:aProcess method, instances of me keep some meta state while
instrumentation is ongoing.
Especially, instrumentationInfo objects are only updated in processes with a context.
This has two advantages:
- it blocks recursive calls, while inside instrumentation code
- it blocks measurements from other processes
(so code coverage is only measured when executed during a test run, not if
executed by other processes)
the main entries are run: and runForCoverage:
the code must have been recompiled with instrumentation before
(see InstrumentingCompiler - class protocol)
copyrightCOPYRIGHT (c) 2010 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
instance access
-
current
-
the current context for this running thread.
walks along the parent-process chain, up to a possible global context
Usage example(s):
InstrumentationContext current
|
-
forProcess: aProcess
-
the context for this thread.
walks along the parent-process chain, up to a possible global context
instance creation
-
new
-
return an initialized instance
queries
-
hasGlobalInstrumentationContext
-
InstrumentationContext hasGlobalInstrumentationContext
running
-
run: aBlock
-
run aBlock with instrumentation enabled
Usage example(s):
Smalltalk loadPackage:'stx/goodies:regression'.
BTree withAllPrivateClasses
do:[:cls | cls recompileUsingCompilerClass:InstrumentingCompiler].
InstrumentationContext
run:[ RegressionTests::BinaryTreeTester suite run ].
(Tools::NewSystemBrowser open)
switchToClass:BTree;
showCoverageInformation value:true
|
-
runForCoverage: aBlock
-
run aBlock with instrumentation enabled, but only for coverage (i.e. not counting)
utilities
-
flushAllPerProcessInstrumentationContexts
-
self flushAllPerProcessInstrumentationContexts
-
globalInstrumentationContext
-
-
setGlobalInstrumentationContext: aContextOrNil
-
setup for global instrumentation: instrumentation is performed for all processes
-
setInstrumentationContext: aContextOrNil in: aProcess
-
setup for process specific instrumentation:
instrumentation is aProcess
accessing
-
coverageOnly
-
if on, only keep track of coverage (not counting);
if off, we also count how often the code has been entered,
and by which sender
-
coverageOnly: aBoolean
-
if on, only keep track of coverage (not counting);
if off, we also count how often the code has been entered
-
enabled
-
-
enabled: aBoolean
-
Modified (format): / 08-08-2011 / 14:47:12 / cg
-
inInstrumentedCode
-
-
inInstrumentedCode: aBoolean
-
Modified (format): / 08-08-2011 / 19:43:19 / cg
initialization
-
initialize
-
Invoked when a new instance is created.
Usage example(s):
super initialize. -- commented since inherited method does nothing
|
installing
-
beActiveEverywhere
-
become the current instrumentaion context for all processes.
Usage example(s):
InstrumentationContext new beActiveEverywhere
|
-
beActiveIn: aProcess
-
become the current instrumentaion context for a process.
Usage example(s):
InstrumentationContext new beActiveIn:(Processor activeProcess)
|
queries
-
enabledAndNotInInstrumentedCode
-
running
-
run: aBlock
-
run aBlock with instrumentation enabled
-
runForCoverage: aBlock
-
run aBlock with instrumentation enabled;
but only for coverage (i.e. not counting)
|