Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject absolute paths into "expected output" files #157

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

phiwuu
Copy link
Member

@phiwuu phiwuu commented Dec 13, 2024

Add feature to the system test framework to generate absolute paths in output files based on template files.

It works like this:
If a folder called expected-output-template exists, then

  1. it takes each file from that folder
  2. creates a copy in folder expected-output
  3. and replaces the string TESTS-SYSTEM with an absolute path to the tests-system folder.

This way it is possible to compare *.lobster files that contain absolute paths against their expected content. lobster-cpptest needs this feature.

@phiwuu phiwuu requested a review from a team as a code owner December 13, 2024 11:58
@phiwuu phiwuu self-assigned this Dec 13, 2024
@phiwuu phiwuu added the internal Affects the CI, tests or refactorings only, not relevant to the end-user label Dec 13, 2024
@phiwuu phiwuu force-pushed the internal/absolute-path-system-tests branch from 3f6efb2 to 41d24cc Compare December 13, 2024 12:07
@phiwuu phiwuu enabled auto-merge (squash) December 13, 2024 12:07
@phiwuu phiwuu force-pushed the internal/absolute-path-system-tests branch from 41d24cc to 0200fb7 Compare December 13, 2024 12:11
@phiwuu phiwuu force-pushed the internal/absolute-path-system-tests branch 2 times, most recently from 4cc916b to 5e5af01 Compare December 13, 2024 15:57
@phiwuu phiwuu disabled auto-merge December 13, 2024 15:57
@phiwuu phiwuu marked this pull request as draft December 13, 2024 15:58
@phiwuu phiwuu force-pushed the internal/absolute-path-system-tests branch from 5e5af01 to 016f912 Compare December 13, 2024 16:03
Add feature so that the system tests can inject absolute paths into
*.lobster files, which represent the expected outcome of a test.

It works like this:
1. If a *.lobster file in the `expected-output` folder contains the string
   `TEST_CASE_PATH`, then this string is replaced with the absolute path
   of the test case folder.
2. Afterwards the content of the actual output file is compared against this
   modified file.

This way it is possible to compare *.lobster files that contain absolute paths
against their expected content. `lobster-cpptest` needs this feature.

simplification
@phiwuu phiwuu force-pushed the internal/absolute-path-system-tests branch from 016f912 to 8d4e5c4 Compare December 13, 2024 16:08
@phiwuu phiwuu changed the title Support system tests with absolute paths Inject absolute paths into "expected output" files Dec 13, 2024
@phiwuu phiwuu marked this pull request as ready for review December 13, 2024 16:09
@phiwuu phiwuu enabled auto-merge (squash) December 13, 2024 16:11
@phiwuu phiwuu merged commit 5423c4e into main Dec 16, 2024
24 checks passed
@phiwuu phiwuu deleted the internal/absolute-path-system-tests branch December 16, 2024 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Affects the CI, tests or refactorings only, not relevant to the end-user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants