Added more tests, fixed existing ones, and some more test system changes.

This commit is contained in:
Dale Weiler 2012-11-17 09:51:55 +00:00
parent d0c6e0a481
commit 55491bbc23
9 changed files with 55 additions and 3 deletions

3
test.c
View file

@ -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))

View 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);
};

View 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
View 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
View 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
View file

@ -0,0 +1,6 @@
void(...) print = %:1;
void() main = ??<
print("??=??'??(??)??!??<??>??-??/??/%>|");
print("#^[]|{}~\\%>\n");
%>;

8
tests/ngraphs.tmpl Normal file
View 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: #^[]|{}~\%>|#^[]|{}~\%>