qsharp-runtime
qsharp-runtime copied to clipboard
DumpMachine does not produce console output when running from Q# unit tests
Describe the bug
DumpMachine called from Q# unit test (defined using @Test
attribute) does not print program state.
To Reproduce
Superposition kata uses DumpMachine to print expected and actual states for each exercise. You can run dotnet test
on that project to see that there are no state dumps after "The desired state" and "The actual state" (https://github.com/microsoft/QuantumKatas/blob/main/Superposition/Tests.qs).
Expected behavior
Program state is printed in the unit tests.
System information
- OS: Windows 11
- .NET Core Version: 6.0.401
- QDK 0.25.228311 and 0.25.218240 (used to work a year ago)
Additional context When the same code is invoked from Q# Jupyter Notebook frontend, state dumps are produced successfully.