mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-28 05:51:19 +00:00
Shitty testsuite support for windows the hacky way because there exists no sane simple way of redirecting pipes without a heafty chunk of code.
This commit is contained in:
parent
1e9d3e43cb
commit
a0f6b00a15
2 changed files with 27 additions and 10 deletions
35
test.c
35
test.c
|
@ -157,22 +157,39 @@ int task_pclose(FILE **handles) {
|
||||||
* other hacks.
|
* other hacks.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int __dummy;
|
char name_err[L_tmpnam];
|
||||||
/* TODO: implement */
|
char name_out[L_tmpnam];
|
||||||
} popen_t;
|
} popen_t;
|
||||||
|
|
||||||
FILE **task_popen(const char *command, const char *mode) {
|
FILE **task_popen(const char *command, const char *mode) {
|
||||||
(void)command;
|
FILE **handles = NULL;
|
||||||
(void)mode;
|
char *cmd = NULL;
|
||||||
|
popen_t *open = (popen_t*)mem_a(sizeof(popen_t) * 3);
|
||||||
|
|
||||||
/* TODO: implement */
|
tmpnam(open->name_err);
|
||||||
return NULL;
|
tmpnam(open->name_out);
|
||||||
|
|
||||||
|
(void)mode; /* excluded */
|
||||||
|
|
||||||
|
util_asprintf(&cmd, "%s -redirout=%s -redirerr=%s", command, open->name_out, open->name_err);
|
||||||
|
|
||||||
|
system(cmd); /* HACK */
|
||||||
|
handles = (FILE**)(open + 1);
|
||||||
|
handles[0] = NULL;
|
||||||
|
handles[1] = fs_file_open(open->name_out, "r");
|
||||||
|
handles[2] = fs_file_open(open->name_err, "r");
|
||||||
|
|
||||||
|
return handles;
|
||||||
}
|
}
|
||||||
|
|
||||||
void task_pclose(FILE **files) {
|
void task_pclose(FILE **files) {
|
||||||
/* TODO: implement */
|
popen_t *open = ((popen_t*)files) - 1;
|
||||||
(void)files;
|
fs_file_close(files[1]);
|
||||||
return;
|
fs_file_close(files[2]);
|
||||||
|
remove(open->name_err);
|
||||||
|
remove(open->name_out);
|
||||||
|
|
||||||
|
mem_d(open);
|
||||||
}
|
}
|
||||||
#endif /*! _WIN32 */
|
#endif /*! _WIN32 */
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ I: vec_ops.qc
|
||||||
D: some additional vector operations
|
D: some additional vector operations
|
||||||
T: -execute
|
T: -execute
|
||||||
C: -std=fteqcc
|
C: -std=fteqcc
|
||||||
E: -vector '8 16 32'
|
E: -vector "8 16 32"
|
||||||
M: '8 16 32'
|
M: '8 16 32'
|
||||||
M: '4 8 16'
|
M: '4 8 16'
|
||||||
M: '2 4 8'
|
M: '2 4 8'
|
||||||
|
|
Loading…
Reference in a new issue