Skip to content

Cannot find source files  #33

Description

@MHumm

In order to start working on the next version of my Delphi Code Coverage Wizard Plus (https://github.com/MHumm/delphi-code-coverage-wizard-plus/ I pulled your latest version in order to update the CodeCoverage.exe I'm shipping.

But it no longer works properly with my existing test project.
It cannot find the .pas files of the units to cover anymore. Did anything change regarding resolution of their paths?

Activity

  1. ekot1 commented on Nov 13, 2022

    @ekot1
    Contributor

    No nothing should have changed, could you attach your test project so I can check

  2. MHumm commented on Nov 13, 2022

    @MHumm
    Author

    Here's a link to an archive containing the generated batch file and the two lst files. Let me know if that's not sufficient for a first analysis: https://webmail.freenet.de/Cloud/?shareToken=424293153aa23ac38676388c7d411079b645447a5ff96446c904dd2b283b6c50

  3. MHumm commented on Nov 13, 2022

    @MHumm
    Author

    About the line 55 script error: that one is fixed from my side now. It happens when using a VCL control to display HTML files and that one still uses IE instead of Edge...

  4. MHumm commented on Nov 16, 2022

    @MHumm
    Author

    I've got new data. When using the current version it cannot find the source files for which it shall generate the HTML reports. It looks for them in the wrong folder. It looks in the folder where the coverage.exe itsself is and not in the folder specified as source folder. I now added -sd to the batch file Delphi Code Coverage Plus generates, but this didn't help.
    Some new files for this (including the log file, which also shows some exception in between) are here (valid for 30 days only):
    https://webmail.freenet.de/Cloud/?shareToken=4d95da631e45934ef283e82f87566fdfe78c3665a144f3f045ea13e7bd3f684f

    I also wonder where the exception comes from. Is it because one of the unit tests tests for an exception to be raised?

  5. ekot1 commented on Nov 20, 2022

    @ekot1
    Contributor

    This looks like a bug, it looks for source files in <-sd switch directory>\unitname and then in currentdirectory<directory from -spf file>\unitname.
    We can probably change it to look in <-sd directory><directory from -spf file>\unitname, but then we need to distinguish between relative/absolute paths in -spf file. Workaround is use absolute paths in -spf file or change current directory to source directory before running code coverage.

  6. changed the title [-]Cannot find source files and has a script error in line 55 of the generated HTML file[/-] [+]Cannot find source files [/+] on Nov 20, 2022
  7. added a commit that references this issue on Nov 20, 2022
  8. ekot1 commented on Nov 20, 2022

    @ekot1
    Contributor

    I've added change that should fix it, when testing make sure that -sd switch is before -spf switch in command line

  9. MHumm commented on Nov 20, 2022

    @MHumm
    Author

    I tried to test it, but it still seems to fail. Here's some demo which only generates output for one file isntead of two:
    https://webmail.freenet.de/Cloud/?shareToken=313f721e2da25b8241cae6be1980acf76ee6dd65c95fa6c26a79b8b8cf258393
    It uses absolute paths and needs to be unzipped into drive D:.
    Under Projects my Code Coverage Wizard is conmtained and that contains your CodeCoverage.exe in the binaries directory. Under \Test\Calc the generated batch file is contained, showing the command line switches in the order you requested. The .lst file with the paths uses absolute paths and the one for the files not.
    I hope you can work out what's now working as expected here?

  10. MHumm commented on Dec 8, 2022

    @MHumm
    Author

    I'm setting current directory now before running coverage in my tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions