Skip to content
New issue

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

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

Already on GitHub? # to your account

Move functions into lib-sharness/functions.sh #90

Merged
merged 8 commits into from
May 26, 2019

Conversation

chriscool
Copy link
Collaborator

This makes it easier to maintain Sharness, as it is more
compatible with the Git test suite and less code is in
"sharness.sh".

The downside is that it is not possible anymore to install
Sharness by just copying "sharness.sh".

@chriscool
Copy link
Collaborator Author

Ok, so there is an issue with variables that appear unused.

And I think another issue is that some functions, that are not public, should not be in "functions.sh".

@chriscool
Copy link
Collaborator Author

Other issues related to the Makefile:

  • aggregate-results.sh should probably be moved into lib-sharness
  • the "install" target in the Makefile should install the whole lib-sharness directory

This makes it easier to maintain Sharness, as it is more
compatible with the Git test suite and less code is in
"sharness.sh".

The downside is that it is not possible anymore to install
Sharness by just copying "sharness.sh".
This is to make Shellcheck happy.
This is to make Shellcheck happy.
@chriscool chriscool force-pushed the lib-sharness-functions branch from 5bb7df7 to 0b5a6b7 Compare April 28, 2019 22:10
@chriscool
Copy link
Collaborator Author

I think I fixed everything.

And I think I will merge this in a few weeks as I want to add more things into the new lib-sharness directory.

@chriscool
Copy link
Collaborator Author

chriscool commented Apr 28, 2019

This might be a bit disruptive when Sharness is not installed in the same directory as the test scripts. In this case the best is perhaps to set SHARNESS_TEST_SRCDIR somewhere properly, then to export it and to source sharness.sh in the test files using something like:

. "$SHARNESS_TEST_SRCDIR/sharness.sh"

(See also how it's done in test/simple.t and in the install target of the Makefile).)

Another way would be to have symlinks to both sharness.sh and lib-sharness in the test script directory.

@hsanjuan
Copy link

Huge downside

@chriscool chriscool deleted the lib-sharness-functions branch June 27, 2019 07:56
bronson added a commit to bronson/sharness that referenced this pull request Jul 3, 2020
Installing sharness.sh hasn't worked since felipec#90
bronson added a commit to bronson/gird that referenced this pull request Jul 3, 2020
This seems to be the most recent version that has a decent per-project
install, before felipec/sharness#90
@felipec
Copy link
Owner

felipec commented Mar 13, 2023

@hsanjuan Actually I partially reverted some of those changes. Moving back test_expect_* and test_done.

Doing that lib-sharness becomes optional. Although it contains useful functions, not all projects would need to import it, and of course you can selectively copy the functions you need as well.

See 275059d.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants