byte-physics / igortest

Igor Pro Universal Testing Framework
https://docs.byte-physics.de/igor-unit-testing-framework/
BSD 3-Clause "New" or "Revised" License
7 stars 2 forks source link

Tracing should not instrument ifdef-ed out code #421

Open t-b opened 1 year ago

t-b commented 1 year ago

In MIES we have ASYNC_ThreadReadOut() which looks instrumented like:

#ifdef THREADING_DISABLED
Z_(67, 178)
        WAVE/DF serialExecutionBuffer = GetSerialExecutionBuffer(getAsyncHomeDF())
Z_(67, 179)
        index = GetNumberFromWaveNote(serialExecutionBuffer, NOTE_INDEX)
        if(Z_(67, 180, c=(index > 0)))
Z_(67, 181)
            DFREF dfr = serialExecutionBuffer[--index]
Z_(67, 182)
            SetNumberInWaveNote(serialExecutionBuffer, NOTE_INDEX, index)
        else
Z_(67, 183)
Z_(67, 184)
            DFREF dfr = $""
        endif
Z_(67, 185)
#else
Z_(67, 186)
Z_(67, 187)
        DFREF dfr = ThreadGroupGetDFR(tgID, 0)
#endif

but THREADING_DISABLED is not defined. Might be hard to solve in general. The fallout is that the part inside #ifdef THREADING_DISABLED is treated as instrumented and not covered.

t-b commented 1 year ago

Defined symbols can be queried with SetIgorOption.

This would also need to be solved for #if. For that the idea would be to execute everything after #if via Execute, store the result in a global variable and read that back.

t-b commented 1 year ago

A first solution could also only concenerate on #ifdef as that is much more widely used. And easier to solve.