Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ccd97/CP-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

21 Commits

Repository files navigation

CP-test

A tool to generate test-cases for competitive programming. With it, you can also execute your code on generated test-cases and compare it with other code automatically.

What it can do?

  • Generate random test-cases
  • Run code (supports various languages) automatically on these test-cases
  • Run two code simultaneously and compare the result on these test-cases
  • HackerRank problem-setting style test-cases zip

Why?

  • Sometimes solely for generating test-cases
  • To check if code written generates proper output and does not give a run-time error
  • To compare your code with brute-force code/any other code to check for corner cases

Usage

To generate test-cases (E.g.: 5 test-cases)

python3 testcode.py -T testcase_syntax.tcs -N 5

To generate test-cases and run your code on generated test-cases

python3 testcode.py -T testcase_syntax.tcs -I1 my_code.cpp

To generate test-cases and run two codes and compare output

python3 testcode.py -T testcase_syntax.tcs -I1 my_code.cpp -I2 my_bruteforce.py

To generate HackerRank style test-cases zip

python3 testcode.py -T testcase_syntax.tcs -I1 my_code.cpp -C configs/hackerrank.ini

The default value of `-N` is 10. To generate more/less test-cases pass it as parameter.
The default config used is `configs/default.ini`. Use `-C` flag to pass custom config.

You need to specify syntax of test-cases in a file and pass it with -T argument.
This test-case syntax is very simple and can be easily written. Refer to TCSYNTAX.md

Supported languages

Currently code files supported are:

  • C11
  • C++14
  • Python3

About

Test case generator + output comparator

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /