-
-
Notifications
You must be signed in to change notification settings - Fork 163
Spec Tests
andychu edited this page Dec 10, 2017
·
43 revisions
Back to Contributing.
Spec Tests are written with the sh_spec.py framework. There are some comments at the top of that file.
$ ./spec.sh install-shells
$ ./spec.sh smoke # a single file -- look at the list of functions
$ ./spec.sh all # all in parallel
The idea behind the spec tests to figure out how OSH should behave (the spec) by taking an automated survey of the behavior of other shells. You can follow a test-driven process like this:
- Write spec tests for a new feature.
- Make the spec tests pass on every shell except OSH. If shells differ in behavior, this may require annotations on the expected results.
- A given shell may not implement a feature. For example,
bash
andzsh
both implement thedirs
builtin, butmksh
anddash
don't. - Shells may implement the same feature differently. For example,
pushd
in bash prints the stack to stdout, butpushd
inzsh
doesn't.
- A given shell may not implement a feature. For example,
- Write code in OSH to make the tests pass.
- Spec tests don't run in an isolated environment, but they should (issue 42). Right now I run them on Ubuntu 16.04.