diff --git a/README.md b/README.md index 713a8fd..ebc7835 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ + +## Write Tests + +Create a file anywhere in the `tests` directory. The filename should be prefixed with `test_`. Otherwise, set the glob expression using `--expresion` argument. + +```sh + ## Run Tests ```sh diff --git a/test b/test index c61fb44..d51cd7f 100755 --- a/test +++ b/test @@ -1,61 +1,3 @@ #!/bin/bash - -# -# Args: -# $1: Use SMLUnit (true/false) -# - - -python3 test.py - -# USE_SMLUNIT=${1:-false} - -# # Define the path to the tests folder -# TESTS_DIR="./tests" - -# # Find all files that start with "test_" and end with ".sml" in the tests folder -# TEST_FILES=$(find "$TESTS_DIR" -type f -name "test_*.sml") - -# # Check if we found any test files -# if [ -z "$TEST_FILES" ]; then -# echo "No test files found." -# exit 1 -# fi - -# # Initialize a variable to track if any test fails -# TEST_FAILED=0 - -# # Load each test file in the SML interpreter -# for TEST_FILE in $TEST_FILES; do -# echo "Running tests in: $TEST_FILE" - -# # If we are using SMLUnit, load the SMLUnit library before loading the test file -# if [ "$USE_SMLUNIT" = true ]; then -# echo "Using SMLUnit" -# export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH -# # smlsharp < "$TESTS_DIR/SMLUnit/smlunit-lib.smi" -# smlsharp < "$TEST_FILE" -# EXIT_CODE=$? - -# # Else, just use sml to load the test file -# else -# sml < "$TEST_FILE" -# EXIT_CODE=$? -# fi - -# # If the test failed (non-zero exit code), mark it as failed -# if [ $EXIT_CODE -ne 0 ]; then -# echo "Test failed in: $TEST_FILE" -# TEST_FAILED=1 -# fi -# done - -# # Exit with error if any tests failed -# if [ $TEST_FAILED -ne 0 ]; then -# echo "Some tests failed." -# exit 1 -# else -# echo "All tests passed." -# exit 0 -# fi - +PYTHON_PATH=$(which python3) +$PYTHON_PATH test.py "$@" \ No newline at end of file