Code Monkey home page Code Monkey logo

uapsc-test's Introduction

UAPSC Kattis Testing Script

Script/utility that tests sample cases from Kattis locally, built for UAPSC. Furthermore, can submit problem solutions to Kattis problems remotely. See below for details on how to set up remote submissions.

The script supports C, C++, and Python 3.



Usage: ./uatest.sh [options] <command> [-p problem] [file-name]

Note that the file only needs to be specified only the first time either test or submit is called. If no problem id is specified, the problem id is infered from the file name. If the script has been installed as a command, the command uat can be used instead of the script. When no sub command is given, it defaults to the 'test' sub command.

Sub Commands

  • clean - Deletes test cases and problem meta data.
  • test - Tests the file given against sample input. May download test cases when needed.
  • submit - Submits the solution code remotely. This is not enabled by default, see below for details.
  • install - Installs the script as a command uat, in place of the script. The terminal may need to be restarted.
  • uninstall - Uninstalls the command.

Options

  • -h, --help, help - Prints a help message and exits.
  • -o, --output - When using the 'test' subcommand, print the output of the solution code.
  • -p <problem> - Specifies the Kattis problem id to download test cases for/submit to.
  • <file-name> - Specifies the file to test with.

Example Usage

Some examples of calling the script:
./uatest.sh clean
./uatest.sh test -p abc soln.cpp
~/<path-to-repo>/uatest.sh -o test -p abc diff_soln.py
./uatest.sh --output test (Assuming the problem and file were specified previously.)
./uatest.sh submit -p abc some_soln.c
./uatest.sh submit (Assuming the problem and file were specified previously.)

Testing

To test a given problem, run the script with the subcommand test and give the problem id and file name as arguments. If no problem id is given, it infers it from the file name. Furthermore, the problem id and file name only need to specified the first time test is run, as it remembers the last id and file used.

Submitting

Initially, remote submissions are disabled. To submit remotely, the user must have an account-specific file called .kattisrc on their system to authenticate them. To download the file, login to Kattis and go to this link:
https://open.kattis.com/help/submit.
The .kattisrc file needs to be moved to the src folder in this repo or the home directory in order for the submit subcommand to work. In reality this script uses one made by Kattis, and just simplifies the process. Furthermore their script needs Python 2/3 to work. Their script, called submit.py, is included in this repo for completeness but was not modified.

Copyright and Citations

This project is built for a non-commercial educational purpose and is open source under an MIT licence.

This project and it's contributors are not affiliated with or endorsed by Kattis in any capacity. The file submit.py was not written by this project's contributors, and is entirely the property of Kattis.
It is under an MIT licence: https://github.com/Kattis/kattis-cli.

Additionally, in the development of this script the Stack Overflow article below is referenced:
https://stackoverflow.com/questions/59895/get-the-source-directory-of-a-bash-script-from-within-the-script-itself.
Full credit to Dave Dopson for a command used to in the script. See the script uatest.sh for details.




For any issues, concerns, or questions feel free to email [email protected].

uapsc-test's People

Contributors

ngergel avatar

Stargazers

Leo Gao avatar Anshil Gandhi avatar Ian DeHaan avatar

Watchers

Ian DeHaan avatar

uapsc-test's Issues

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.