Giter Club home page Giter Club logo

autograder's Introduction

Autograder

A bash cli utility that runs tests from a folder on an executable and compares the program output to precomputed output files.

Autograder is designed for quick input output testing of executables.

Instalation

Download the script.

  1. We begin by making the script an executable.
    chmod +x autograder.sh
  2. We then move it into our local program directory.
    mv autograder.sh /usr/local/bin/autograder

Or we can use the installer: sudo sh install.sh.

Usage

Files specifying input and output must have matching names per input/output pair. Furthermore input files must end with .in and output files with .out.
The command can be ran with: autograder

Flags

  • -t specifies timeout value in seconds. (default 1)
  • -p specifies the name of the program. (default a.out)
  • -d specifies the directory where the tests are located. (default tests)
  • -v verbose information about failed tests. (default false)
  • -i shows the input for failed tests. (default false)
  • -e specifies the command used to run the executable. (default depends on file type)
  • -f force tests to run even if they have no defined output. (default false)
  • -a argument mode, feeds input through file name as an argument instead of stdin. (default false)
  • -s specify a specific test.

Supported files without -e are: any c binary (.out) and .py.

Example

Given the following folder structure.

.
├── myProgram
└── programTests
    ├── 10.in
    ├── 10.out
    ├── 1.in
    ├── 1.out
    ├── 2.in
    ├── 2.out
    ├── 3.in
    ├── 3.out
    ├── 4.in
    ├── 4.out
    ├── 5.in
    ├── 5.out
    ├── 6.in
    ├── 6.out
    ├── 7.in
    ├── 7.out
    ├── 8.in
    ├── 8.out
    ├── 9.in
    └── 9.out

We can run autograder with the following command autograder -p myProgram -d programTests Which will produce the following output:

INCORRECT OUTPUT : tests/10
PASSED : tests/1
PASSED : tests/2
PASSED : tests/3
PASSED : tests/4
PASSED : tests/5
PASSED : tests/6
PASSED : tests/7
TIMEOUT : tests/8
INCORRECT OUTPUT : tests/9

autograder's People

Contributors

mardog101 avatar

Watchers

 avatar

autograder'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.