https://github.com/jd297/testsh
test suite for arbitrary programs
https://github.com/jd297/testsh
shell-script testsuite
Last synced: 10 months ago
JSON representation
test suite for arbitrary programs
- Host: GitHub
- URL: https://github.com/jd297/testsh
- Owner: JD297
- License: bsd-2-clause
- Created: 2024-12-08T02:03:29.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-08T14:37:47.000Z (over 1 year ago)
- Last Synced: 2025-02-06T10:53:17.308Z (over 1 year ago)
- Topics: shell-script, testsuite
- Language: Shell
- Homepage: https://github.com/JD297/jd297linux
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# testsh
test suite for arbitrary programs
## Naming
A file in tests/src should be named: test_PHILOSOPHY_TYPE_name_of_the_test.c
A program in tests/bin should just contain the name: test_PHILOSOPHY_TYPE_name_of_the_test
A expected program (copycat) should be named: expc_test_PHILOSOPHY_TYPE_name_of_the_test
## Type
The following test types are available:
### assert
Runs the test program and checks for a 0 return code. IO is not redirected, so the program logs are visible. This is intended for self-testing, e.g., with the function "assert" that is available in common programming languages.
### return
Executes the program and checks if the return code is 0; otherwise, the test fails.
### diff
Compares the stdout output of an actual and expected behavior.
## Philosophy
A philosophy is a supertype for a test. The following philosophy types are available:
### Standalone
A standalone test is based on a program. The following types are supported:
* assert
### Copycat
A copycat test is based on a source file from which two programs are created (expected behavior and actual behavior). For example, if the source file is named test_copycat_helloworld.c, the program expc_test_copycat_helloworld is used as the expected behavior, and the program test_copycat_helloworld is used as the actual behavior. As the name suggests, it is well-suited for re-implementing existing tools or libraries. The following types are supported:
* return
* diff