Skip to content

Commit

Permalink
Add testing related documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sherpalabsio committed Jul 14, 2024
1 parent 597bbce commit 1db7936
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ $ sherpa diagnose

### Testing

All *_test.sh files are run recursively from the tests directory.

```shell
# Run all the tests for all the supported shells
$ make test
Expand Down
20 changes: 20 additions & 0 deletions tests/test_all
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
#!/usr/bin/env bash

# Test Suite Runner
#
# This script runs all the tests on the host for all the supported shells.
# It supports running a specific test file or all the test files.
#
# Usage:
# ./tests/test_all [test_file]
#
# Arguments:
# test_file : (Optional) Specific test file to run. If not provided, all the
# test files will be executed for all the supported shells.
#
# Example Usage:
# ./tests/test_all
# ./tests/test_all tests/example_test.sh
#
# Exit Codes:
# 0 : The test suite passed passed successfully.
# 1 : It failed.

set -e

# Check if all shell executables are available
Expand Down
20 changes: 20 additions & 0 deletions tests/test_runner
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
#!/usr/bin/env bash

# This script runs all the *_test.sh files recursively from the tests directory
# for the specified shell. It supports running a specific test file or all the
# test files.
#
# Usage:
# ./tests/test_runner [bash|zsh] [test_file]
#
# Arguments:
# bash|zsh : The target shell to run the tests for.
# test_file : (Optional) Specific test file to run. If not provided, all the
# test files will be executed for the specified shell.
#
# Example Usage:
# ./tests/test_runner bash
# ./tests/test_runner zsh tests/example_test.sh
#
# Exit Codes:
# 0 : All tests passed successfully.
# 1 : Some tests failed or other error occurred.

set -e
shopt -s globstar

Expand Down

0 comments on commit 1db7936

Please sign in to comment.