Giter VIP home page Giter VIP logo

cs253-specs's Introduction

This document has been sourced from the cs251tk-specs at https://github.com/StoDevX/cs251-specs

cs253-specs

This document defines grading information for the CS department at Saint Olaf College. The information allows TA's to grade homework using the automated tool cs251tk specifically for the Algorithms and Data Structures course (CS 253).

This document is a work in progress.

Examples

Basic Spec

Let's start off with a basic spec:

---
assignment: hw5

compilers:
  - &cpp 'g++ --std=c++11 $@ -o [email protected]'

files:
  - [ f1.cpp, *cpp ]
  - [ story2.cpp, *cpp ]

tests:
  - [ f1.cpp, [email protected] ]
  - [ story2.cpp, [email protected] ]

At a minimum, a spec needs to declare its name.

Now, that's not very useful, so specs are also expected to declare a list of files that they expect to find. Each entry under the files key should be a list, starting with the filename.

The above file is converted to the following representation, which we will now analyze.

{
  "assignment": "hw5",
  "compilers": [
    "g++ --std=c++11 $@ -o [email protected]"
  ],
  "files": [
    { "options": {},
      "commands": ["g++ --std=c++11 $@ -o [email protected]"],
      "filename": "f1.cpp"},
    { "options": {},
      "commands": ["g++ --std=c++11 $@ -o [email protected]"],
      "filename": "story2.cpp"}
  ],
  "tests": [
    { "options": {},
      "commands": ["[email protected]"],
      "filename": "f1.cpp" },
    { "options": {},
      "commands": ["[email protected]"],
      "filename": "story2.cpp" }
  ]
}

As we can see, the files and tests lists both share the same structure. Each file is divided into three parts: filename, commands, and options. The first item in the original list is taken as the filename, any objects in the list are merged into the options argument, and any strings are placed into commands.

Files w/ Options
---
assignment: hw4

compilers:
  - &cpp 'g++ --std=c++11 $@ -o [email protected]'

files:
  - [ iotest.cpp, *cpp ]
  - [ countdown.cpp, *cpp, timeout: 0.025, truncate_output: 1000 ]
  - [ countup.cpp, *cpp, timeout: 0.025, truncate_output: 1000 ]
  - [ story.cpp, *cpp ]

tests:
  - [ iotest.cpp, echo Hawken \n 10 \n 42 | [email protected] ]
  - [ countdown.cpp, echo 0 | [email protected] ]
  - [ countup.cpp, echo 10 | [email protected] ]
  - [ story.cpp, [email protected] ]
{
  "files": [
    {
      "options": {},
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "iotest.cpp"
    },
    {
      "options": {
        "timeout": 0.025,
        "truncate_output": 1000
      },
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "countdown.cpp"
    },
    {
      "options": {
        "timeout": 0.025,
        "truncate_output": 1000
      },
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "countup.cpp"
    },
    {
      "options": {},
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "story.cpp"
    }
  ],
  "tests": [
    {
      "options": {},
      "commands": [
        "echo Hawken \\n 10 \\n 42 | [email protected]"
      ],
      "filename": "iotest.cpp"
    },
    {
      "options": {},
      "commands": [
        "echo 0 | [email protected]"
      ],
      "filename": "countdown.cpp"
    },
    {
      "options": {},
      "commands": [
        "echo 10 | [email protected]"
      ],
      "filename": "countup.cpp"
    },
    {
      "options": {},
      "commands": [
        "[email protected]"
      ],
      "filename": "story.cpp"
    }
  ],
  "compilers": [
    "g++ --std=c++11 $@ -o [email protected]"
  ],
  "assignment": "hw4"
}
Multiple Steps and Input Files
---
assignment: hw7

compilers:
  - &cpp 'g++ --std=c++11 $@ -o [email protected]'

files:
  - [ avg.cpp, *cpp ]
  - [ stddev.cpp, *cpp ]
  - [ a0.cpp, *cpp ]
  - [ a1.cpp, *cpp ]
  - [ a4.cpp, *cpp ]
  - [ a6.cpp, *cpp ]

tests:
  - [ avg.cpp, cat firefox.txt | [email protected] ]
  - - stddev.cpp
    - cat firefox.txt | [email protected]
    - cat avg-first-firefox.txt | [email protected]
  - [ a0.cpp, [email protected] ]
  - [ a1.cpp, [email protected] ]
  - [ a4.cpp, [email protected] ]
  - [ a6.cpp, [email protected] ]

inputs:
  - firefox.txt
  - avg-first-firefox.txt
{
  "files": [
    {
      "options": {},
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "avg.cpp"
    },
    {
      "options": {},
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "stddev.cpp"
    },
    {
      "options": {},
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "a0.cpp"
    },
    {
      "options": {},
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "a1.cpp"
    },
    {
      "options": {},
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "a4.cpp"
    },
    {
      "options": {},
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "a6.cpp"
    }
  ],
  "tests": [
    {
      "options": {},
      "commands": [
        "cat firefox.txt | [email protected]"
      ],
      "filename": "avg.cpp"
    },
    {
      "options": {},
      "commands": [
        "cat firefox.txt | [email protected]",
        "cat avg-first-firefox.txt | [email protected]"
      ],
      "filename": "stddev.cpp"
    },
    {
      "options": {},
      "commands": [
        "[email protected]"
      ],
      "filename": "a0.cpp"
    },
    {
      "options": {},
      "commands": [
        "[email protected]"
      ],
      "filename": "a1.cpp"
    },
    {
      "options": {},
      "commands": [
        "[email protected]"
      ],
      "filename": "a4.cpp"
    },
    {
      "options": {},
      "commands": [
        "[email protected]"
      ],
      "filename": "a6.cpp"
    }
  ],
  "compilers": [
    "g++ --std=c++11 $@ -o [email protected]"
  ],
  "inputs": [
    "firefox.txt",
    "avg-first-firefox.txt"
  ],
  "assignment": "hw7"
}
make example
---
assignment: lab11
folder: projtech

compilers:
  - &cpp 'g++ --std=c++11 $@ -o [email protected]'

files:
  - - proto-chat.cpp
    - rm -f *.o proto-chat
    - make proto-chat
  - - proto-multiplayer.cpp
    - rm -f *.o proto-multiplayer
    - make proto-multiplayer
{
  "files": [
    {
      "options": {},
      "commands": [
        "rm -f *.o proto-chat",
        "make proto-chat"
      ],
      "filename": "proto-chat.cpp"
    },
    {
      "options": {},
      "commands": [
        "rm -f *.o proto-multiplayer",
        "make proto-multiplayer"
      ],
      "filename": "proto-multiplayer.cpp"
    }
  ],
  "folder": "projtech",
  "compilers": [
    "g++ --std=c++11 $@ -o [email protected]"
  ],
  "assignment": "lab11"
}
Really Long make Example
---
assignment: lab8
folder: graphics

compilers:
  - &cpp 'g++ --std=c++11 $@ -o [email protected]'

files:
  - [ ColorPoint2.h, null ]
  - [ ColorPoint2.cpp, *cpp, optional: true ]

  - [ Shape.h, null ]
  - [ Shape.cpp, *cpp ]
  - - ShapeDriver.cpp
    - rm -f ShapeDriver *.o
    - make ShapeDriver

  - [ Rectangle.h, null ]
  - [ Rectangle.cpp, *cpp ]
  - - RectangleDriver.cpp
    - rm -f RectangleDriver *.o
    - make RectangleDriver

  - [ Circle.h, null ]
  - [ Circle.cpp, *cpp ]
  - - CircleDriver.cpp
    - rm -f CircleDriver *.o
    - make CircleDriver

  - [ shapes.txt, null ]
  - - ShapeDriver1.cpp
    - rm -f ShapeDriver1 *.o
    - make ShapeDriver1
  - - ShapeDriver2.cpp
    - rm -f ShapeDriver2 *.o
    - make ShapeDriver2

  - - proto-draw.cpp
    - rm -f proto-draw *.o
    - make proto-draw


tests:
  - [ ShapeDriver.cpp, ./ShapeDriver ]
  - [ RectangleDriver.cpp, ./RectangleDriver ]
  - [ CircleDriver.cpp, ./CircleDriver ]
  - [ ShapeDriver1.cpp, ./ShapeDriver1 ]
  - [ ShapeDriver2.cpp, ./ShapeDriver2 ]
{
  "files": [
    {
      "options": {},
      "commands": [],
      "filename": "ColorPoint2.h"
    },
    {
      "options": {
        "optional": true
      },
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "ColorPoint2.cpp"
    },
    {
      "options": {},
      "commands": [],
      "filename": "Shape.h"
    },
    {
      "options": {},
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "Shape.cpp"
    },
    {
      "options": {},
      "commands": [
        "rm -f ShapeDriver *.o",
        "make ShapeDriver"
      ],
      "filename": "ShapeDriver.cpp"
    },
    {
      "options": {},
      "commands": [],
      "filename": "Rectangle.h"
    },
    {
      "options": {},
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "Rectangle.cpp"
    },
    {
      "options": {},
      "commands": [
        "rm -f RectangleDriver *.o",
        "make RectangleDriver"
      ],
      "filename": "RectangleDriver.cpp"
    },
    {
      "options": {},
      "commands": [],
      "filename": "Circle.h"
    },
    {
      "options": {},
      "commands": [
        "g++ --std=c++11 $@ -o [email protected]"
      ],
      "filename": "Circle.cpp"
    },
    {
      "options": {},
      "commands": [
        "rm -f CircleDriver *.o",
        "make CircleDriver"
      ],
      "filename": "CircleDriver.cpp"
    },
    {
      "options": {},
      "commands": [],
      "filename": "shapes.txt"
    },
    {
      "options": {},
      "commands": [
        "rm -f ShapeDriver1 *.o",
        "make ShapeDriver1"
      ],
      "filename": "ShapeDriver1.cpp"
    },
    {
      "options": {},
      "commands": [
        "rm -f ShapeDriver2 *.o",
        "make ShapeDriver2"
      ],
      "filename": "ShapeDriver2.cpp"
    },
    {
      "options": {},
      "commands": [
        "rm -f proto-draw *.o",
        "make proto-draw"
      ],
      "filename": "proto-draw.cpp"
    }
  ],
  "folder": "graphics",
  "compilers": [
    "g++ --std=c++11 $@ -o [email protected]"
  ],
  "tests": [
    {
      "options": {},
      "commands": [
        "./ShapeDriver"
      ],
      "filename": "ShapeDriver.cpp"
    },
    {
      "options": {},
      "commands": [
        "./RectangleDriver"
      ],
      "filename": "RectangleDriver.cpp"
    },
    {
      "options": {},
      "commands": [
        "./CircleDriver"
      ],
      "filename": "CircleDriver.cpp"
    },
    {
      "options": {},
      "commands": [
        "./ShapeDriver1"
      ],
      "filename": "ShapeDriver1.cpp"
    },
    {
      "options": {},
      "commands": [
        "./ShapeDriver2"
      ],
      "filename": "ShapeDriver2.cpp"
    }
  ],
  "assignment": "lab8"
}

cs253-specs's People

Contributors

maxnz avatar

cs253-specs's Issues

Add ADS to toolkit

If you would like, I can add support for ADS to the toolkit so the git repositories are downloaded automatically.

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.