-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
40 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
PHONY: test | ||
|
||
|
||
test: | ||
mojo --version | ||
|
||
# check test collection (this count needs to be updated manually when tests are updated) | ||
pytest | grep "collected 18 items" | ||
|
||
# Tests that do not fail | ||
pytest example/tests/mod_b | ||
|
||
# Tests that should fail | ||
if pytest example/tests/mod_a ; then | ||
echo "expected pytest non-zero exit code" | ||
exit 1 | ||
fi | ||
|
||
# Test should fail because I am passing options for checking warnings | ||
rm -rf ~/.modular/.mojo_cache | ||
if pytest -W error example/tests/test_warning.mojo ; then | ||
echo "expected pytest non-zero exit code" | ||
exit 1 | ||
fi | ||
|
||
# Test should not fail because I am not checking for warning | ||
rm -rf ~/.modular/.mojo_cache | ||
pytest example/tests/test_warning.mojo | ||
|
||
# Test should fail because --mojo-assertions is enabled | ||
rm -rf ~/.modular/.mojo_cache | ||
if pytest --mojo-assertions example/tests/test_debug_assert.mojo; then | ||
echo "expected pytest non-zero exit code" | ||
exit 1 | ||
fi | ||
|
||
# Test should not fail because I am not checking for debug assertions | ||
rm -rf ~/.modular/.mojo_cache | ||
pytest example/tests/test_debug_assert.mojo |