# HG changeset patch # User thomask # Date 1099083656 0 # Node ID 94b746f24b502d93db7a0e365291847231784396 # Parent 257449adcae3d412ead00915a0b4a8a02da332b0 added ?DSTRESS_FLAGS? support diff -r 257449adcae3 -r 94b746f24b50 extract__.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extract__.c Fri Oct 29 21:00:56 2004 +0000 @@ -0,0 +1,58 @@ +/* svn://svn.kuehne.cn/dstress/extract__.c + * + * extract compiler flags for DStress test cases + * + * Copyright (C) 2004 Thomas Kuehne + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include + +// @WARNING@ works only with ASCII / UTF-8 source files +int main(int argc, char* argv[]){ + if(argc!=2){ + printf("this stdin will be queried for the patter given as first argument\n"); + return -1; + } + + // the longest source line in the test is a bit over 1<<16 bytes long + size_t length = 1 << 17; + char* line = malloc(length); + char* buffer; + char* found; + char* pattern=argv[1]; + size_t pattern_length=strlen(pattern); + + errno=0; + while(buffer=fgets(line, length, stdin)){ + found = strstr(buffer, pattern); + + if(errno!=0){ + break; + }else if(found!=NULL){ + found+=pattern_length; + printf("%s", found); + break; + } + } + + free(line); + + return 0; +} diff -r 257449adcae3 -r 94b746f24b50 ifeq__.c --- a/ifeq__.c Fri Oct 29 05:50:46 2004 +0000 +++ b/ifeq__.c Fri Oct 29 21:00:56 2004 +0000 @@ -1,3 +1,24 @@ +/* svn://svn.kuehne.cn/dstress/ifeq__.c + * + * compare the 2 input arguments (shell & OS independent) + * + * Copyright (C) 2004 Thomas Kuehne + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include int main(int argc, char *argv[]){ diff -r 257449adcae3 -r 94b746f24b50 readme.txt --- a/readme.txt Fri Oct 29 05:50:46 2004 +0000 +++ b/readme.txt Fri Oct 29 21:00:56 2004 +0000 @@ -31,4 +31,4 @@ @uri@ message id @url@ message xRef @WARNING@ external dependencies (e.g. Phobos) - + §DSTRESS_FLAGS§ everything following in the same line will be interpreted as _additional_ compiler flags diff -r 257449adcae3 -r 94b746f24b50 return__.c --- a/return__.c Fri Oct 29 05:50:46 2004 +0000 +++ b/return__.c Fri Oct 29 21:00:56 2004 +0000 @@ -1,3 +1,24 @@ +/* svn://svn.kuehne.cn/dstress/return__.c + * + * execute the first argument and print the return code + * + * Copyright (C) 2004 Thomas Kuehne + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include #include diff -r 257449adcae3 -r 94b746f24b50 todo.txt --- a/todo.txt Fri Oct 29 05:50:46 2004 +0000 +++ b/todo.txt Fri Oct 29 21:00:56 2004 +0000 @@ -37,7 +37,7 @@ * extend tests for design by contract -* extend tests for inner functions +* extend tests for inner functions and closures * operators