mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 14:21:36 +00:00
Added more tests, fixed existing ones, and some more test system changes.
This commit is contained in:
parent
d0c6e0a481
commit
55491bbc23
9 changed files with 55 additions and 3 deletions
3
test.c
3
test.c
|
@ -507,15 +507,12 @@ bool task_propogate(const char *curdir) {
|
|||
void task_cleanup(const char *curdir) {
|
||||
DIR *dir;
|
||||
struct dirent *files;
|
||||
struct stat directory;
|
||||
char buffer[4096];
|
||||
|
||||
dir = opendir(curdir);
|
||||
|
||||
while ((files = readdir(dir))) {
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
stat(files->d_name, &directory);
|
||||
|
||||
if (strstr(files->d_name, "TMP")) {
|
||||
snprintf(buffer, sizeof(buffer), "%s/%s", curdir, files->d_name);
|
||||
if (remove(buffer))
|
||||
|
|
13
tests/functions-as-params.qc
Normal file
13
tests/functions-as-params.qc
Normal file
|
@ -0,0 +1,13 @@
|
|||
void(string, string) print = #1;
|
||||
|
||||
string() getter = {
|
||||
return "correct";
|
||||
};
|
||||
|
||||
void(string() f) printer = {
|
||||
print(f(), "\n");
|
||||
};
|
||||
|
||||
void() main = {
|
||||
printer(getter);
|
||||
};
|
8
tests/functions-as-params.tmpl
Normal file
8
tests/functions-as-params.tmpl
Normal file
|
@ -0,0 +1,8 @@
|
|||
I: functions-as-params.qc
|
||||
D: test functions as paramaters
|
||||
T: -execute
|
||||
C: -std=gmqcc
|
||||
E: $null
|
||||
F: functions as paramaters failed
|
||||
S: functions as paramaters passed
|
||||
M: correct
|
12
tests/ifs.qc
Normal file
12
tests/ifs.qc
Normal file
|
@ -0,0 +1,12 @@
|
|||
void(string, ...) print = #1;
|
||||
|
||||
void(float c) main = {
|
||||
if (c == 1)
|
||||
print("One\n");
|
||||
else if (c == 2)
|
||||
print("Two\n");
|
||||
else if (c == 3)
|
||||
print("Three\n");
|
||||
else
|
||||
print("Else\n");
|
||||
};
|
8
tests/ifs.tmpl
Normal file
8
tests/ifs.tmpl
Normal file
|
@ -0,0 +1,8 @@
|
|||
I: ifs.qc
|
||||
D: test if statement
|
||||
T: -execute
|
||||
C: -std=gmqcc
|
||||
E: -float 2
|
||||
F: if statement failed
|
||||
S: if statement passed
|
||||
M: Two
|
6
tests/ngraphs.qc
Normal file
6
tests/ngraphs.qc
Normal file
|
@ -0,0 +1,6 @@
|
|||
void(...) print = %:1;
|
||||
|
||||
void() main = ??<
|
||||
print("??=??'??(??)??!??<??>??-??/??/%>|");
|
||||
print("#^[]|{}~\\%>\n");
|
||||
%>;
|
8
tests/ngraphs.tmpl
Normal file
8
tests/ngraphs.tmpl
Normal file
|
@ -0,0 +1,8 @@
|
|||
I: ngraphs.qc
|
||||
D: test digraphs and trigraphs
|
||||
T: -execute
|
||||
C: -std=gmqcc
|
||||
E: $null
|
||||
F: digraphs and trigraphs failed
|
||||
S: digraphs and trigraphs passed
|
||||
M: #^[]|{}~\%>|#^[]|{}~\%>
|
Loading…
Reference in a new issue