Skip to content

sharziki/competitive-programing-tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Competitive Programming Tester

A simple command-line tool to test your C++ competitive programming solutions against sample test cases.

Quick Start

  1. Clone this repository:

    git clone <your-repo-url>
    cd pj-programs
  2. Install Python requirements:

    pip install -r requirements.txt
  3. Test your C++ solution:

    python3 cp_tester.py your_solution.cpp

How to Use

  1. Run the tester with your C++ file:

    python3 cp_tester.py solution.cpp
  2. Enter your test cases when prompted:

    • Input the sample input (finish with END)
    • Input the expected output (finish with END)
    • Repeat for more test cases
  3. The tester will:

    • Compile your C++ code with g++
    • Run each test case
    • Show PASS/FAIL results
    • Display diffs for failed tests

Example

$ python3 cp_tester.py sample_solution.cpp
Enter sample INPUT for test case #1:
5
1 2 3 4 5
END
Enter expected OUTPUT for test case #1:
15
END
Add another test case? [y/N]: n
Enter the path to your .cpp file: sample_solution.cpp
Test #1: PASS
Passed 1/1 test cases.

Requirements

  • Python 3.6+
  • g++ compiler
  • See requirements.txt for Python dependencies

Sample Code

Check out sample_solution.cpp for a working example you can test!

About

A stress tester for competitive programming, test your solution before submitting.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors