Skip to content

Commit

Permalink
doc/build-helpers/testers.chapter.md: expand testVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonTorres committed Nov 1, 2024
1 parent a64e971 commit 49377ae
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions doc/build-helpers/testers.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,21 @@ The build will fail if `shellcheck` finds any issues.
Checks that the output from running a command contains the specified version string in it as a whole word.
NOTE: In most cases, [`versionCheckHook`](#versioncheckhook) should be preferred, but this function is provided and documented here anyway. The motivation for adding either tests would be:
Although being very simple and naive, this test is useful:
- Catch dynamic linking errors and such and missing environment variables that should be added by wrapping.
- Probable protection against accidentally building the wrong version, for example when using an "old" hash in a fixed-output derivation.
- It assures the main program can run.
- It catches dynamic linking errors, missing or malformed environment variables and other runtime errors.
- It provides a minor protection against fixed-output hash errors that usually happen when forgetting to update hashes.
By default, the command to be run will be inferred from the given `package` attribute: it will check `meta.mainProgram` first, falling back to `pname` or `name`.
By default, the command to be run will be inferred from the given `package` attribute:
it will check `meta.mainProgram` first, and fall back to `pname` or `name`.
The default argument to the command is `--version`, and the version to be checked will be inferred from the given `package` attribute as well.
Note: see also:
- [`versionCheckHook`](#versioncheckhook), an independent hook with similar functionality.
- [A comparison between both](#versioncheckhook-comparison-testversion)
:::{.example #ex-testversion-hello}
# Check a program version using all the default values
Expand Down

0 comments on commit 49377ae

Please sign in to comment.