Welcome to CATS - Competitive Algorithm Tool Set
This is a simple program, a set of tools, mostly for testing solutions to competitive programming problems.What I would do, is:
- Clone this repo into some folder like
/usr/local
on Linux orC:\Users\username\CATS
on Windows.git clone https://github.com/chupsondev/CATS.git
- Add the folder I just cloned to PATH But, install it however you want, I don't know what you wanna do.
CATS has mulitple sub-commands. All of them are discribed below.
cats test solution file [options]
This command tests a given solution file, using a set of tests predefined by the user. You must provide a solution file to be tested - you can either give just the name of that file, a name and an extension, or the full path. For now, the only supported files are those with the .cpp
extension.
--build
or-b
- build the solution file
--submit
or-s
- submit the solution to themis, if all tests passed
--verbose
or-v
- print all available information, bypassing rules meant to prevent CATS' output from being too long
--test *name of test*
or-t *name of test*
- if provided, run only the test given, instead of all of them
cats build solution file
Builds the solution file given.
cats run solution file [options]
Runs solution file.
CURRENTLY BROKEN
cats run solution file [options]
Generates tests for the given solution, using your own generator, or one of the generators built-in to CATS.
--generator
or-g
- the generator to be used
--number
or-n
- number of tests to be created
Generators for generating tests can only be written in Python (for now).
The generator should have a function called generate()
that takes no arguments and returns a list (or tuple) that has exactly two strings: the first begin the input for the test, and the second being the expected output.
You have to put tests in one of the following locations (problem_name should be replaced with the name of the file you're testing, without extension):
./tests/problem_name
./problem_name_tests
Those folders do not actually have to be in the working directory - CATS looks for them up to 4 levels down the directory tree. It is however recommended that you start CATS in the same folder where you solution file and all your tests are.