Files
cs249r_book/tinytorch/bin/tito
Vijay Janapa Reddi e7fc890842 fix(ci): proper exit codes and error counting in test output
Critical fixes:
1. bin/tito now uses sys.exit(main()) to propagate exit codes
   - Previously the exit code was discarded, causing CI to pass even on failures

2. Collection errors are now counted and displayed
   - 'ERROR tests/...' lines (collection failures) are now tracked
   - Summary shows 'X errors, Y failed, Z passed' for clarity

Without these fixes, CI stages could show green even when tests failed.
2026-01-23 14:51:26 -05:00

28 lines
597 B
Python
Executable File

#!/usr/bin/env python3
"""
TinyTorch CLI wrapper - runs tito without requiring pip install.
Usage:
./bin/tito <command> [options]
Example:
./bin/tito dev preflight --ci
"""
import os
import sys
# Determine tinytorch root from this script's location
tinytorch_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Add to Python path so imports work
sys.path.insert(0, tinytorch_root)
# Change to tinytorch directory so Path.cwd() works correctly
os.chdir(tinytorch_root)
# Import and run main
from tito.main import main
if __name__ == "__main__":
sys.exit(main())