Skip to content

Commit

Permalink
Passthrough terminal args
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-byrne committed Sep 20, 2024
1 parent 5dd5716 commit a540a45
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 60 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
62 changes: 2 additions & 60 deletions test
Original file line number Diff line number Diff line change
@@ -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 "$@"

0 comments on commit a540a45

Please sign in to comment.