A desktop application for testing programming solutions against input/output test cases with real-time execution monitoring and detailed result analysis.
Test Case Judge is a PyQt5-based tool designed for competitive programmers and educators to efficiently validate code solutions. It supports Python, C, and C++ programs, providing compilation, execution, and detailed comparison of outputs against expected answers.
- Multi-Language Support: Test Python (
.py), C (.c), and C++ (.cpp) solutions - Automatic Compilation: Built-in compiler integration for C/C++ with optimization flags
- Batch Testing: Run individual tests or execute all test cases simultaneously
- Real-Time Monitoring: Live log display with timestamps and progress tracking
- Detailed Results: View execution time, status, stdout, stderr, and line-by-line diffs
- Dark Theme: Professional dark color scheme optimized for extended use
- Drag and Drop: Quick solution file loading via drag-and-drop
- Split View: Organized layout with test table, live logs, and detail panels
- Status Color Coding: Visual indicators for Accepted, Wrong Answer, TLE, and Runtime Errors
- Report Export: Save detailed test results to text files
- Flexible Input: Add individual test pairs or import entire folders
- Input/Answer Pairing: Automatic matching of
.inand.ansfiles - Selective Execution: Run specific tests or the complete test suite
- Result Persistence: Keep results across sessions for comparison
- Python 3.7 or higher
- PyQt5
- GCC (for C programs)
- G++ (for C++ programs)
pip install PyQt5Ensure GCC and G++ are installed and accessible from your system PATH for C/C++ support.
- Launch the application
- Select or drag-and-drop your solution file
- Add test cases using "Add .in/.ans Pair" or "Add Folder"
- Click "Compile / Prepare" for C/C++ solutions
- Run tests using "Run Selected" or "Run All"
Test cases consist of paired files:
.infiles containing input data.ansfiles containing expected output
Both files should have matching base names (e.g., test01.in and test01.ans).
- C programs: Compiled with
-O2 -std=c11 - C++ programs: Compiled with
-O2 -std=c++17 - Python scripts: Execute directly without compilation
- Accepted: Output matches expected answer exactly
- Wrong Answer: Output differs from expected answer
- TLE: Execution exceeded time limit (default: 2 seconds)
- RE: Runtime error or non-zero exit code
Double-click any test row to view comprehensive details including:
- Execution status and time
- Standard output and error streams
- Line-by-line difference comparison
- Double-click table row: View test details
- Drag files: Load solution quickly
- Right-click: Context menu (standard Qt behavior)
- Time limit is fixed at 2 seconds per test
- Requires exact output matching (whitespace-sensitive)
- Compiled binaries are stored in the current working directory
- No support for interactive problems
- Multi-threaded execution using
QThreadPool - Asynchronous task execution with signal-slot communication
- Separate worker threads prevent UI blocking during test runs
- Temporary executable files created in working directory
- Binary cleanup handled automatically
- UTF-8 text encoding for all file operations
- Compilation fails: Verify GCC/G++ installation anad PATH configuration
- Tests don't run: Ensure solution file is selected and compiled (for C/C++)
- Wrong Answer despite correct logic: Check for trailing whitespace or newline differences
- Application won't start: Confirm PyQt5 is properly installed
This project is provided as-is for educational and personal use.
Contributions are welcome. Consider adding features like:
- Configurable time limits
- Custom checker scripts
- Memory usage monitoring
- Batch solution testing
- Test case generation tools
Developed with PyQt5 for an efficient competitive programming workflow.