GithubHelp home page GithubHelp logo

ci's Introduction

ci

ci is a command line interface for building and testing competitive programming tasks. Currently, it can test any executable and build C++ code.

Installation

cargo install --git https://github.com/matcegla/ci

If you do not have cargo installed, run curl https://sh.rustup.rs | sh.

Bash autocomplete

ci generate-autocomplete bash | sudo tee /usr/share/bash-completion/completions/ci

Usage

ci build

ci build kitties.cpp

Compiles kitties.cpp to ./kitties.e. The code is built by compiler clang++ with C++17(-std=c++17) and warnings enabled(-Wall -Wextra -Wconversion -Wno-sign-conversion). This is the debug build, which includes debugging info(-g) and enables C++ standard library debug configuration (-D_GLIBCXX_DEBUG) as well as UB sanitizer(-fno-sanitize-recover=undefined), which means that you can debug it and also it will crash on UB.

ci build --release kitties.cpp

Compiles kitties.c to ./kitties.e. The --release flag changes the debug build to release build, which enables optimisations(-O2).

ci build --standard 11

Compiles with C++11 instead of default(C++17), with the flag -std=c++11. Possible values are: 11(-std=c++11), 17(-std=c++17).

ci test

ci test ./kitties.e kitties.test/

Recursively finds every file with .in extension in kitties.test/ directory, runs ./kitties.e with it as input, and compares if result is same as a matching file with .out extensions(ignoring some whitespace).

ci test ./kitties.e kitties.test/ --no-print-success

As before, but doesn't print information about tests that succeded. Useful when you have a lot of tests.

ci test ./kitties.e kitties.test/ --checker ./kitties-checker.e

Instead of comparing the output more or less char-by-char, uses a supplied program to do the checking. Program will be called like ./kitties-checker.e kitties.test/1.in <(./kitties.e < ./kitties.test/1.in) kitties.test/1.out and should return 0 status code if solution is valid(this will change).

ci multitest

ci multitest ./kitties-gen.py ./kitties-brut.e ./kitties.e ./kitties-alternative.e

Instead of using already generated tests, this uses ./kitties-gen.py to generate the inputs and runs them against every executable. First executable is assumed to always produce correct output.

ci multitest ./kitties-gen.py ./kitties-brut.e ./kitties.e ./kitties-alternative.e --checker ./kitties-checker.e

Instead of comparing char-by-char minus whitespace, this uses a checker like --checker in ci test does.

ci multitest ./kitties-gen.py ./kitties-brut.e ./kitties.e ./kitties-alternative.e -n 200

Instead of breaking on first failing test, this will run 200 tests and only print one with greatest fitness. Fitness function is - (test char count) by default.

ci multitest ./kitties-gen.py ./kitties-brut.e ./kitties.e -n 200 --fitness ./kitties-fit.e

Uses a supplied fitness function instead of the default. @bytelen is a special value that is -(test char count).

ci vendor

ci vendor kitties.cpp

When running your code in testing environments, you will not have access to various helpful header-only libraries like your personal algorithm collections, mc or Boost.Graph. This command will only run the preprocessor, copy-pasting these libraries into your code so you can send it to an online judge system.

To use the command, a directory /usr/share/ci/dummy-includes must be created, with all the includes you do not want copy-pasted(like <iostream>). To do this, create a file in this directory, like sudo touch /usr/share/ci/dummy-includes/iostream.

ci init

ci init https://codeforces.com/contest/960/problem/D

To save time on entering example tests, this command will download and save them to ./tests/example directory for you. Few task formats are supported.

ci submit

ci submit code.cpp https://codeforces.com/contest/960/problem/D

To save time on submitting your code, this command will submit them for you! Few sites are suppported. The URL should be the URL to problem description(same as in ci init).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.