Say goodbye to annoying manual test runs during an intense programming contest!
Umpire is a blazingly fast command-line helper that compiles your code, executes it, and automatically validates against all test cases.
With just one short command, you can get quick, clear, and easy-to-read results at a glance. It lets you focus on solving problems rather than wasting time juggling with annoying copy-pastes and loads of commands.
Umpire turns testing into your winning edge!
Umpire is available for both Linux and MacOS.
Note
To avoid large package size, please install the compilers that you use:
gcc # C++, installed by default
python3 # Python
go # Golang
zulu # Java
rustc # RustClick here to see the installation guide
Umpire is available via Nix flakes. Please enable Nix flakes for your system (here is the doc that explains how to enable it: NixOS Wiki).
- Add the url to your
flake.nixinput:
inputs = {
umpire.url = "github:udontur/umpire";
# ...
};- Add the package in
environment.systemPackages:
environment.systemPackages = with pkgs; [
inputs.umpire.packages."${system}".default
# ...
];- Rebuild your configuration with Nix flakes enabled.
sudo nixos-rebuild switch --flake /PATH/TO/CONFIG#WORKSTATION_NAMEUse an AUR helper of your choice to get Umpire (like yay or paru):
yay -S umpireRun the following command in your terminal:
git clone https://github.com/udontur/umpire &∓& cd umpire &∓& sudo chmod +x asset/install.sh &∓& asset/install.shSee the detailed explaination.
The usage guide is also available via the following command: um --help
Organize your code directory as follows:
task-a # The folder that stores everything
ββ main.cpp # File name must be "main"
Β ββ testcase ase # Exact name
Β Β ββ ABC.in ABC.in # Same input / output name: ABC
Β Β ββ ABC.out ABC.out # Same input / output name: ABCClick here for more details
task-a is the directory that contains the code file and test case folder.
The code file should be named as main.XXX where XXX is the file extension (.cpp for C++).
The test cases should be located in the testcase folder (must be the exact name).
Each test case in the folder must be in the format of ABC.in and ABC.out where ABC is the input / output file name.
Run umpire in the current directory:
umOr specify a directory:
um task-a
Note
For Java programmers, make sure the class name is main.
Set the execution time limit in seconds (accepts integers and decimal numbers):
um -t 3.5 # 3.5 seconds time limitTip
Omit for a 1 second time limit
um # no flags
See your program's outputs and the corresponding inputs by toggling the following flag:
um --outputRun the code located in the task-a folder with a 2 second time limit:
um task-a -t 2