diff options
author | Bruce Montrose <montrose@itd.nrl.navy.mil> | 2002-07-09 19:57:38 +0000 |
---|---|---|
committer | Bruce Montrose <montrose@itd.nrl.navy.mil> | 2002-07-09 19:57:38 +0000 |
commit | 934ca320ff6826f541e3f0b5b10abb55b7976cfd (patch) | |
tree | c2299f48868ec50f9601edd9607086bd8c48d107 /src/or | |
parent | 62ead018a16d6a1a1e12f9c6183fbd2e4a11ec3d (diff) | |
download | tor-934ca320ff6826f541e3f0b5b10abb55b7976cfd.tar tor-934ca320ff6826f541e3f0b5b10abb55b7976cfd.tar.gz |
added file to codebase
svn:r32
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/test_config.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/or/test_config.c b/src/or/test_config.c new file mode 100644 index 000000000..171adb659 --- /dev/null +++ b/src/or/test_config.c @@ -0,0 +1,32 @@ +#include "or.h" + +int loglevel; + +int main(int ac, char **av) +{ + or_options_t options; + int argc, rtn_val, failures, total; + char fname[512]; + FILE *pipe; + char *argv[] = { "or", "-v", "-f", fname, NULL }; + argc = 4; + failures = total = 0; + printf("Config file test suite...\n\n"); + pipe = popen("ls -1 ../config/*orrc","r"); + while ( fgets(fname,sizeof(fname),pipe) ) + { + fname[strlen(fname)-1] = '\0'; + printf("%s\n--------------------\n", fname); + rtn_val = getoptions(argc,argv,&options); + ++total; + if ( rtn_val) + { + ++failures; + printf("Test failed!\n\n"); + } + else + printf("Test succeeded\n\n"); + } + printf("%6.2f percent. %d failures.\n",(total - failures)*100/(float)total,failures); + return failures; +} |