You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error setting printer in Vcl.Printers during code coverage execution #41
When running the code coverage on the application I'm testing, an error occurs when attempting to set the printer during a print attempt. This issue only happens when the application is run with code coverage enabled.
To provide more detail, the problem occurs in the method from the Vcl.Printers library, specifically in the procedure TPrinter.BeginDoc. The issue arises when executing SetState(TPrinterState.psHandleDC);. The error message returned is: "Printer selected is not valid."
I start the code coverage using a batch file, passing the necessary parameters. I suspect that the issue may be related to the command prompt not recognizing the default printer when running the application in this instance.
I would appreciate assistance with this situation. Is there any configuration or parameter that I should set for the code coverage to resolve this problem?
Can you provide a minimal reproducible example of your code and the call to
the code coverage tool?
Op wo 24 jul 2024 14:55 schreef rogerio1105 ***@***.***>:
When running the code coverage on the application I'm testing, an error
occurs when attempting to set the printer during a print attempt. This
issue only happens when the application is run with code coverage enabled.
To provide more detail, the problem occurs in the method from the
Vcl.Printers library, specifically in the procedure TPrinter.BeginDoc. The
issue arises when executing SetState(TPrinterState.psHandleDC);. The error
message returned is: "Printer selected is not valid."
I start the code coverage using a batch file, passing the necessary
parameters. I suspect that the issue may be related to the command prompt
not recognizing the default printer when running the application in this
instance.
I would appreciate assistance with this situation. Is there any
configuration or parameter that I should set for the code coverage to
resolve this problem?
Thank you.
—
Reply to this email directly, view it on GitHub
<#41>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATDSYPXOH6HXX76ZHUNMKHTZN6P3RAVCNFSM6AAAAABLMNYQKSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQZDONJRGUYDOOI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
Here is the command line used to execute the code coverage, which is included in a batch file: "C:\CodeCoverage\CodeCoverage.exe" -m "C:\Contabil\wcont.map" -e "C:\Contabil\wcont.exe" -uf "C:\Users\rogerio.pack\temp\Wcont\Units.lst" -spf "C:\Users\rogerio.pack\temp\Wcont\Diretorios.lst" -od "C:\Users\rogerio.pack\temp\Wcont" -xml -html -xmllines -twd -v
Can you attach a ZIP with the smallest possible reproduction? So, a separate Delphi program which reproduces exactly the problem your describe (but with not any other code to exclude other issues in your code). Which compiles and generates the map file you use and with the corresponding *.lst files you use in your batch file. Not just some code snippets :-)
That way I can reproduce it after my holiday and see what might go wrong.
Good afternoon, sorry for the delay, but I have added an example in the attached zip file. In the "CodeCoverage" folder, you will find the necessary files and the batch file. If you need anything else, please let me know. exemplo.zip
Activity
Laurensvanrun commentedon Jul 24, 2024
rogerio1105 commentedon Jul 25, 2024
Of course. The call in the program is quite simple.
This is the call.
The
BeginDocmethod:The problem occurs in the
SetStatemethod.This issue arises only when running the application with code coverage enabled. It results in the error message: "Printer selected is not valid."
I'm running this on Delphi tokyo and Windows.
rogerio1105 commentedon Jul 25, 2024
Here is the command line used to execute the code coverage, which is included in a batch file:
"C:\CodeCoverage\CodeCoverage.exe" -m "C:\Contabil\wcont.map" -e "C:\Contabil\wcont.exe" -uf "C:\Users\rogerio.pack\temp\Wcont\Units.lst" -spf "C:\Users\rogerio.pack\temp\Wcont\Diretorios.lst" -od "C:\Users\rogerio.pack\temp\Wcont" -xml -html -xmllines -twd -vLaurensvanrun commentedon Jul 25, 2024
Can you attach a ZIP with the smallest possible reproduction? So, a separate Delphi program which reproduces exactly the problem your describe (but with not any other code to exclude other issues in your code). Which compiles and generates the map file you use and with the corresponding *.lst files you use in your batch file. Not just some code snippets :-)
That way I can reproduce it after my holiday and see what might go wrong.
rogerio1105 commentedon Jul 26, 2024
Good afternoon, sorry for the delay, but I have added an example in the attached zip file. In the "CodeCoverage" folder, you will find the necessary files and the batch file. If you need anything else, please let me know.
exemplo.zip