-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8602dbe
commit 541de46
Showing
46 changed files
with
229 additions
and
48 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
tests/GradeTestConfig.json → tests/multi_exe_tests/GradeConfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
[ | ||
{ | ||
"results": [ | ||
{ | ||
"attacker": "team1", | ||
"defender": "team1", | ||
"passCount": 3, | ||
"testCount": 3, | ||
"timings": [] | ||
}, | ||
{ | ||
"attacker": "team2", | ||
"defender": "team1", | ||
"passCount": 2, | ||
"testCount": 2, | ||
"timings": [] | ||
}, | ||
{ | ||
"attacker": "team3", | ||
"defender": "team1", | ||
"passCount": 1, | ||
"testCount": 1, | ||
"timings": [] | ||
}, | ||
{ | ||
"attacker": "team1", | ||
"defender": "team2", | ||
"passCount": 3, | ||
"testCount": 3, | ||
"timings": [] | ||
}, | ||
{ | ||
"attacker": "team2", | ||
"defender": "team2", | ||
"passCount": 2, | ||
"testCount": 2, | ||
"timings": [] | ||
}, | ||
{ | ||
"attacker": "team3", | ||
"defender": "team2", | ||
"passCount": 1, | ||
"testCount": 1, | ||
"timings": [] | ||
}, | ||
{ | ||
"attacker": "team1", | ||
"defender": "team3", | ||
"passCount": 3, | ||
"testCount": 3, | ||
"timings": [] | ||
}, | ||
{ | ||
"attacker": "team2", | ||
"defender": "team3", | ||
"passCount": 2, | ||
"testCount": 2, | ||
"timings": [] | ||
}, | ||
{ | ||
"attacker": "team3", | ||
"defender": "team3", | ||
"passCount": 1, | ||
"testCount": 1, | ||
"timings": [] | ||
} | ||
], | ||
"toolchain": "LLVM" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
tests/UserTestConfig.json → tests/single_exe_tests/BasicConfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"testDir": "user_tests/", | ||
"testDir": "tests", | ||
"testedExecutablePaths": { | ||
"clang": "/usr/bin/clang" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"testDir": "tests", | ||
"testedExecutablePaths": { | ||
"clang": "/usr/bin/clang" | ||
}, | ||
"toolchains": { | ||
"LLVM": [ | ||
{ | ||
"stepName": "compile", | ||
"executablePath": "$EXE", | ||
"arguments": [ | ||
"$INPUT", | ||
"-Wno-everything", | ||
"-fno-show-column", | ||
"-fno-show-source-location", | ||
"-o", "$OUTPUT" | ||
], | ||
"output": "test", | ||
"allowError": true | ||
}, | ||
{ | ||
"stepName": "run", | ||
"executablePath": "$INPUT", | ||
"arguments": [], | ||
"output": "-", | ||
"usesInStr": true, | ||
"allowError": true | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"testDir": "tests", | ||
"testedExecutablePaths": { | ||
"clang": "/usr/bin/clang" | ||
}, | ||
"toolchains": { | ||
"LLVM": [ | ||
{ | ||
"stepName": "compile", | ||
"executablePath": "$EXE", | ||
"arguments": [ | ||
"$INPUT", | ||
"-Wno-everything", | ||
"-fno-show-column", | ||
"-fno-show-source-location", | ||
"-o", "$OUTPUT" | ||
], | ||
"output": "test", | ||
"allowError": true | ||
}, | ||
{ | ||
"stepName": "run", | ||
"executablePath": "$INPUT", | ||
"arguments": [], | ||
"output": "-", | ||
"usesInStr": true, | ||
"allowError": true | ||
} | ||
] | ||
}, | ||
"GNU": [ | ||
{ | ||
"stepName": "compile", | ||
"executablePath": "$EXE", | ||
"arguments": [ | ||
"$INPUT", | ||
"-o", "$OUTPUT" | ||
], | ||
"output": "test", | ||
"allowError": true | ||
}, | ||
{ | ||
"stepName": "run", | ||
"executablePath": "$INPUT", | ||
"arguments": [], | ||
"output": "-", | ||
"usesInStr": true, | ||
"allowError": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
tests/single_exe_tests/tests/error_tests/001_compile_time_types.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#define TYPE_ERROR 0 | ||
|
||
typedef struct Apple{ | ||
char a[5]; | ||
} Apple; | ||
|
||
typedef struct Banana { | ||
char b[6]; | ||
} Banana ; | ||
|
||
int main() { | ||
|
||
Apple a = { "apple" }; | ||
Banana b = { "banana" }; | ||
|
||
#if TYPE_ERROR | ||
a = b; | ||
#else | ||
// We will emulate the type error to match the Error Test Specification | ||
printf("TypeError on line 17: Assigning Banana to Apple."); | ||
exit(1); | ||
#endif | ||
|
||
return 0; | ||
} | ||
|
||
// CHECK:TypeError on line 17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tests/single_exe_tests/tests/error_tests/003_runtime_index.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#define OUT_OF_BOUNDS_ERROR 0 | ||
|
||
|
||
// INPUT:9 | ||
int main() { | ||
|
||
char c; | ||
scanf("%c", &c); | ||
|
||
int x = (unsigned int)(c) - '0'; | ||
int a[5] = {1, 2, 3, 4, 5}; | ||
|
||
if (x < 5 && x >= 0) { | ||
printf("%d", a[x]); | ||
} else { | ||
// We will emulate the IndexError to match "Error Test Spec" since | ||
// C will just let us poke around. | ||
printf("IndexError: Don't do that! (The text past the first\ | ||
colon is implementation specific so is not picked up by the tester)"); | ||
|
||
exit(1); | ||
} | ||
|
||
|
||
return 0; | ||
} | ||
|
||
// CHECK:IndexError |
2 changes: 1 addition & 1 deletion
2
tests/user_tests/invalid/001_input_exceed.c → ...ts/tests/invalid_tests/001_input_exceed.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//INPUT_FILE:input_exceed.ins | ||
//INPUT_FILE:./in-stream/input_exceed.ins | ||
|
||
#include <stdio.h> | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
tests/user_tests/invalid/002_output_exceed.c → ...s/tests/invalid_tests/002_output_exceed.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//CHECK_FILE:output_exceed.out | ||
//CHECK_FILE:./out-stream/output_exceed.out | ||
|
||
#include <stdio.h> | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
tests/user_tests/io/003_input_file.c → ..._tests/tests/valid_tests/003_input_file.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// INPUT_FILE:./003_input_file.ins | ||
// INPUT_FILE:./in-stream/003_input_file.ins | ||
|
||
#include <stdio.h> | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ int main() { | |
return 0; | ||
} | ||
|
||
// CHECK_FILE:009_tab_newline.out | ||
// CHECK_FILE:./out-stream/009_tab_newline.out |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Binary file not shown.