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

tab-completion for command-line operation #34

Open
propensive opened this issue Nov 28, 2020 · 0 comments
Open

tab-completion for command-line operation #34

propensive opened this issue Nov 28, 2020 · 0 comments
Assignees
Labels
enhancement An improvement to existing functionality help wanted External assistance is needed

Comments

@propensive
Copy link
Owner

propensive commented Nov 28, 2020

Probably provides the Suite type as a simple way of creating a test runner application which can be invoked from a shell. Issue #30 proposes adding several command line options to Probably's runner, plus it should be possible to specify one or more specific tests to run (rather than all of them), each specified by its hash.

It would be useful to have a simple command-line application which can run these tests automatically from the command-line.

For a test runner to work, it needs to a) invoke Java, b) on the correct Suite class, c) with the correct classpath. If the tests are run once (e.g. from inside a build tool), these details can be obtained from the successful run. For example, System.getProperty(java.home) should give the path to the Java executable, and getClass.getClassLoader.asInstanceOf[URLClassLoader].getUrls should give the classpath that was used to run the tests. These can be stored in a hidden file (e.g. .probably) in the working directory, storing these values as the first three lines of the file (to keep things as simple as possible).

A shell script—let's call it probe—which we write can then read this file, and invoke Java to run these tests directly from the command line.

A successful run of the tests could rewrite this .probably file to additionally list the hashes of all the tests with their names, for example:

ab67f3:this is the name of the test
8812cb:here is another test

which would enable tab-completions scripts for bash, zsh and/or fish to read the contents of this file and offer tab-completion (additionally with the test name on zsh and fish, which support this) on the test names.

Only assert-style (not check-style) tests should be included in the file, because they're the only ones which can turned on or off.

If #30 is implemented, then command parameters should additionally be included in the tab-completion script(s).

This is quite a complex issue, so it's worth having a chat with @propensive before starting.

@propensive propensive added enhancement An improvement to existing functionality help wanted External assistance is needed lsug labels Nov 28, 2020
@propensive propensive self-assigned this Jan 4, 2022
@propensive propensive removed the lsug label Nov 22, 2022
@propensive propensive added this to the Primevère milestone Jan 2, 2023
@propensive propensive removed this from the Primevère milestone Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement to existing functionality help wanted External assistance is needed
Projects
Status: Todo
Development

No branches or pull requests

1 participant