Skip to content
Quick unit testing tool for competitive programming
Common Lisp JavaScript Makefile Shell Java C++ Other
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bookmarklet Fix the bookmarklet for AOJ not to include 'references'. Dec 24, 2019
example add haskell (stack) support Dec 21, 2019
images Update README. Dec 17, 2019
roswell Support manual installation without Roswell. Dec 18, 2019
src Allow to take a testcase directory with -t, --test option. Jan 11, 2020
.gitignore fix trivial-gray-streams build error Dec 28, 2019
CHANGELOG.md Allow to read testcases from ./test/ or ./tests/ directory. Jan 11, 2020
LICENSE Initial commit. Dec 15, 2019
Makefile
README.markdown Allow to read testcases from ./test/ or ./tests/ directory. Jan 11, 2020
bookmarklet.js Fix the bookmarklet for AOJ not to include 'references'. Dec 24, 2019
getac.asd v0.9.1 Dec 31, 2019

README.markdown

getac

Quick unit testing CLI tool for competitive programming.

Screenshot

Usage

$ getac -h
Usage: getac [options] <file>

OPTIONS:
    -t, --test=<file>
        Specify a file to read test cases. (Default: <file>.txt)
    -f, --filetype=<type>
        File type to test. The default will be detected by the file extension.
    -T, --timeout=<seconds>
        Time limit for each test cases. (Default: 2)
    --disable-colors
        Turn off colors.
    -F, --no-fail-fast
        Don't quit when a failure.
    -V, --version
        Print version.
    -h, --help
        Show help.

# Run with the default Python
$ getac main.py

# Specify test cases
$ getac -t test-cases.in main.py

# Run with PyPy3
$ getac -f pypy3 main.py

Installation

via Homebrew (for macOS/Linux)

Install Homebrew if not already installed.

$ brew tap fukamachi/getac
$ brew install getac

Manually

Install SBCL if not already installed.

$ git clone https://github.com/fukamachi/getac
$ cd getac
$ make
$ sudo make install

Getting started

  1. Write your code in a file (ex. main.py)
a = int(input())
b, c = map(int, input().split())
s = input()
print(a + b + c, s)
  1. Write your test cases in "*.txt" (ex. main.txt)
==== example1 ====
1
2 3
test
--------------
6 test
==== example2 ====
2
3 4
myonmyon
-------
9 myonmyon

See Format of test cases for getting its syntax.

  1. Run getac main.py

Screenshot of successed tests

If some test cases are failed, it shows 'WA' (wrong answer).

Screenshot of failed tests

Format of test cases

Single .txt file

Let's start with this very minimal example which contains a single test case:

Input texts are here...
------------------
Expected result is here...

The input text and its expected results are separated with ---- (more than 4 hyphens).

When you include multiple test cases in the same file, those have to be divided with ==== (more than 4 equal signs).

Input texts are here...
------------------
Expected result is here...
==================
Second test case
------------------
Expected result is here again...

The name of each test cases can be written in the middle of separators, like ==== example1 ====.

Here's the full example:

==== example1 ====
Input texts are here...
------------------
Expected result is here...
==== example2 ====
Second test case
------------------
Expected result is here again...

Separated input/output files

If the single test file couldn't find, getac tries to get from ./test/ and ./tests/ directory, which contains test cases as separated input/output files.

The directory structure is like this:

.
├── main.lisp
└── tests
    ├── sample-1.in
    ├── sample-1.out
    ├── sample-2.in
    └── sample-2.out

Supported languages

  • C
  • C++
  • Clojure
  • Common Lisp
  • Go
  • Haskell
  • Java
  • Node.js
  • Python
  • Ruby
  • Scheme

Author

Copyright

Copyright (c) 2019 Eitaro Fukamachi (e.arrows@gmail.com)

License

See LICENSE.

You can’t perform that action at this time.