This document has been sourced from the cs251tk-specs at https://github.com/StoDevX/cs251-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.
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
.
---
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"
}
---
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"
}
---
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"
}
---
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"
}