Tracing is not easy to achieve with independent modules because they are some limitations in Igor. The problem is that Igor copies each igortest-* file into the IM and removes the connection to the local file doing this. Instrumenting afterwards in ProcGlobal doesn't change the igortest-* [IM] files and instrumenting in the IM doesn't work because igortest-* [IM] are no longer standalone procedures.
But there is a trick to enable tracing in IM:
We need to do instrumentation in ProcGlobal first. As we need to know when instrumentation is finished we can do this with a simple RunTest() call that instruments our files and calls a single test case.
The test case includes our IM file with Execute/P "INSERTINCLUDE \"filename\"". It is important that this file wasn't loaded before!
The test case also calls Execute/P "SetIgorOption IndependentModuleDev=1" to enable IUTF in IM and Execute/P "COMPILEPROCEDURES " to ensure that the IM file is loaded.
The IM file contains a TEST_END_OVERRIDE which is needed in step 7.
Afterwards the test case calls Execute/P "IM#RunTest(... without tracing ...)"
The single test case finishes and Igor executes the operation queue and starts the IM#RunTest() run with instrumented igortest-* [IM] files.
The TEST_END_OVERRIDE [IM] calls IUTF_Tracing_Cobertura#PrintReport(coberturaSource, coberturaOut)
These are the minimal steps to allow tracing in IMs and generating Cobertura. If Cobertura isn't needed the user can skip step 4 and 7. The user can also introduce more steps to make the calls cleaner.
I got a proof of concept running that will be used to test the solution for #6. I need to cleanup the files and link the commit here later.
Tracing is not easy to achieve with independent modules because they are some limitations in Igor. The problem is that Igor copies each
igortest-*
file into the IM and removes the connection to the local file doing this. Instrumenting afterwards inProcGlobal
doesn't change theigortest-* [IM]
files and instrumenting in the IM doesn't work becauseigortest-* [IM]
are no longer standalone procedures.But there is a trick to enable tracing in IM:
ProcGlobal
first. As we need to know when instrumentation is finished we can do this with a simpleRunTest()
call that instruments our files and calls a single test case.Execute/P "INSERTINCLUDE \"filename\""
. It is important that this file wasn't loaded before!Execute/P "SetIgorOption IndependentModuleDev=1"
to enable IUTF in IM andExecute/P "COMPILEPROCEDURES "
to ensure that the IM file is loaded.TEST_END_OVERRIDE
which is needed in step 7.Execute/P "IM#RunTest(... without tracing ...)"
IM#RunTest()
run with instrumentedigortest-* [IM]
files.TEST_END_OVERRIDE [IM]
callsIUTF_Tracing_Cobertura#PrintReport(coberturaSource, coberturaOut)
These are the minimal steps to allow tracing in IMs and generating Cobertura. If Cobertura isn't needed the user can skip step 4 and 7. The user can also introduce more steps to make the calls cleaner.
I got a proof of concept running that will be used to test the solution for #6. I need to cleanup the files and link the commit here later.