GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — New option to use the test executable's path as working directory by tschroff · Pull Request #5 · DelphiCodeCoverage/DelphiCodeCoverage

Conversation

@tschroff

@tschroff tschroff commented Apr 12, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Hello,

we have found that some of our unittests load their test-data files by using constant (hard-coded), relative paths.

This works just fine (in regards to the test executable finding its files) when running those tests from within the Delphi IDE, as the working directory is the path of the executable in this case. Also, when the tests are run directly by our Jenkins build server, the current working directory is set explixitely to be the executable's path by our build scripts. So this works fine as well.

When running our tests with Delphi Code Coverage we do not pass the executable (-e) but the project file (-dproj) and in this case we don't know the path of the test executable. So it's a little bit harder to set the required working directory when/before calling the Delphi Code Coverage executable.

Although our unittests could be changed to determine the proper absolute paths by themselves (which we partially did) and this way successfully find their test-data files, we also thought that introducing an additional option '-twd' for Delphi Code Coverage might be a good idea in addition and in general. If this switch is given, Delphi Code Coverage will call CreateProcess by passing the test executable's path as working directory. Otherwise nil will be passed, like before.

I thought that this might be a reasonable feature and wanted to provide the changes via this pull request.
Please feel free to reject it, or to accept it while fine-tuning or renaming things. I did my best to stick to the current format style and existing names and I hope that I adjusted all places (source code as well as documentation), so that it is complete.

Also, I fixed the description of '-tec' in the usage (probably was a little copy-paste accident).

Thanks and cheers,
Thorsten

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
tschroff added 2 commits April 12, 2021 18:00
@tschroff
Added new option '-twd' to use the test executable's path as working …
9ebd011
…directory
@tschroff
Corrected usage description of option '-tec'
e017657
@ekot1
ekot1 merged commit e017657 into DelphiCodeCoverage:master Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@tschroff @ekot1
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.