Commit d132f734 authored by Evan Hunt's avatar Evan Hunt

remove lib/tests as nothing uses it anymore

parent 9b753aa1
......@@ -24157,7 +24157,7 @@ ac_config_commands="$ac_config_commands chmod"
# elsewhere if there's a good reason for doing so.
#
ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/python/Makefile bin/python/isc/Makefile bin/python/isc/utils.py bin/python/isc/tests/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/python/dnssec-keymgr.py bin/python/isc/__init__.py bin/python/isc/checkds.py bin/python/isc/coverage.py bin/python/isc/dnskey.py bin/python/isc/eventlist.py bin/python/isc/keydict.py bin/python/isc/keyevent.py bin/python/isc/keymgr.py bin/python/isc/keyseries.py bin/python/isc/keyzone.py bin/python/isc/policy.py bin/python/isc/rndc.py bin/python/isc/tests/dnskey_test.py bin/python/isc/tests/policy_test.py bin/rndc/Makefile bin/tests/Makefile bin/tests/headerdep_test.sh bin/tests/optional/Makefile bin/tests/pkcs11/Makefile bin/tests/pkcs11/benchmarks/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/dlzs.conf bin/tests/system/dyndb/Makefile bin/tests/system/dyndb/driver/Makefile bin/tests/system/inline/checkdsa.sh bin/tests/system/pipelined/Makefile bin/tests/system/rndc/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/scripts/check-secure-delegation.pl contrib/scripts/zone-edit.sh doc/Makefile doc/arm/Makefile doc/arm/noteversion.xml doc/arm/pkgversion.xml doc/arm/releaseinfo.xml doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/tex/Makefile doc/tex/armstyle.sty doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-manpage.xsl doc/xsl/isc-notes-html.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/irs/tests/Makefile lib/isc/$arch/Makefile lib/isc/$arch/include/Makefile lib/isc/$arch/include/isc/Makefile lib/isc/$thread_dir/Makefile lib/isc/$thread_dir/include/Makefile lib/isc/$thread_dir/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/include/pk11/Makefile lib/isc/include/pkcs11/Makefile lib/isc/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/isccfg/tests/Makefile lib/ns/Makefile lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile lib/tests/Makefile lib/tests/include/Makefile lib/tests/include/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall unit/Makefile unit/unittest.sh"
ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/python/Makefile bin/python/isc/Makefile bin/python/isc/utils.py bin/python/isc/tests/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/python/dnssec-keymgr.py bin/python/isc/__init__.py bin/python/isc/checkds.py bin/python/isc/coverage.py bin/python/isc/dnskey.py bin/python/isc/eventlist.py bin/python/isc/keydict.py bin/python/isc/keyevent.py bin/python/isc/keymgr.py bin/python/isc/keyseries.py bin/python/isc/keyzone.py bin/python/isc/policy.py bin/python/isc/rndc.py bin/python/isc/tests/dnskey_test.py bin/python/isc/tests/policy_test.py bin/rndc/Makefile bin/tests/Makefile bin/tests/headerdep_test.sh bin/tests/optional/Makefile bin/tests/pkcs11/Makefile bin/tests/pkcs11/benchmarks/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/dlzs.conf bin/tests/system/dyndb/Makefile bin/tests/system/dyndb/driver/Makefile bin/tests/system/inline/checkdsa.sh bin/tests/system/pipelined/Makefile bin/tests/system/rndc/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/scripts/check-secure-delegation.pl contrib/scripts/zone-edit.sh doc/Makefile doc/arm/Makefile doc/arm/noteversion.xml doc/arm/pkgversion.xml doc/arm/releaseinfo.xml doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/tex/Makefile doc/tex/armstyle.sty doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-manpage.xsl doc/xsl/isc-notes-html.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/irs/tests/Makefile lib/isc/$arch/Makefile lib/isc/$arch/include/Makefile lib/isc/$arch/include/isc/Makefile lib/isc/$thread_dir/Makefile lib/isc/$thread_dir/include/Makefile lib/isc/$thread_dir/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/include/pk11/Makefile lib/isc/include/pkcs11/Makefile lib/isc/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/isccfg/tests/Makefile lib/ns/Makefile lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall unit/Makefile unit/unittest.sh"
#
......@@ -25279,9 +25279,6 @@ do
"lib/ns/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/ns/include/Makefile" ;;
"lib/ns/include/ns/Makefile") CONFIG_FILES="$CONFIG_FILES lib/ns/include/ns/Makefile" ;;
"lib/ns/tests/Makefile") CONFIG_FILES="$CONFIG_FILES lib/ns/tests/Makefile" ;;
"lib/tests/Makefile") CONFIG_FILES="$CONFIG_FILES lib/tests/Makefile" ;;
"lib/tests/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/tests/include/Makefile" ;;
"lib/tests/include/tests/Makefile") CONFIG_FILES="$CONFIG_FILES lib/tests/include/tests/Makefile" ;;
"lib/samples/Makefile") CONFIG_FILES="$CONFIG_FILES lib/samples/Makefile" ;;
"lib/samples/Makefile-postinstall") CONFIG_FILES="$CONFIG_FILES lib/samples/Makefile-postinstall" ;;
"unit/Makefile") CONFIG_FILES="$CONFIG_FILES unit/Makefile" ;;
......
......@@ -5396,9 +5396,6 @@ AC_CONFIG_FILES([
lib/ns/include/Makefile
lib/ns/include/ns/Makefile
lib/ns/tests/Makefile
lib/tests/Makefile
lib/tests/include/Makefile
lib/tests/include/tests/Makefile
lib/samples/Makefile
lib/samples/Makefile-postinstall
unit/Makefile
......
......@@ -15,7 +15,7 @@ top_srcdir = @top_srcdir@
# Attempt to disable parallel processing.
.NOTPARALLEL:
.NO_PARALLEL:
SUBDIRS = isc isccc dns ns isccfg bind9 irs tests samples
SUBDIRS = isc isccc dns ns isccfg bind9 irs samples
TARGETS =
@BIND9_MAKE_RULES@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} ${TEST_INCLUDES}
CDEFINES =
CWARNINGS =
ISCLIBS = ../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@
ISCCCLIBS = ../../lib/isccc/libisccc.@A@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
ISCCCDEPLIBS = libisccc.@A@
OBJS = t_api.@O@
SRCS = t_api.c
SUBDIRS = include
TARGETS = timestamp
@BIND9_MAKE_RULES@
libt_api.@SA@: ${OBJS}
${AR} ${ARFLAGS} $@ ${OBJS}
${RANLIB} $@
libt_api.la: ${OBJS}
${LIBTOOL_MODE_LINK} \
${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libt_api.la -rpath ${libdir} \
${OBJS} ${ISCLIBS} ${LIBS} @LIBTOOL_ALLOW_UNDEFINED@ @LIBTOOL_IN_MAIN@
timestamp: libt_api.@A@
touch timestamp
clean distclean::
rm -f t_api.@O@ libt_api.@A@ timestamp
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# $Id: Makefile.in,v 1.11 2007/06/19 23:47:24 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
SUBDIRS = tests
TARGETS =
@BIND9_MAKE_RULES@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# $Id: Makefile.in,v 1.9 2007/06/19 23:47:24 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
VERSION=@BIND9_VERSION@
SUBDIRS =
TARGETS =
@BIND9_MAKE_RULES@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/* $Id: t_api.h,v 1.24 2010/06/08 23:50:24 tbox Exp $ */
#ifndef TESTS_T_API_H
#define TESTS_T_API_H 1
/*! \file tests/t_api.h */
#include <stdio.h>
#include <isc/lang.h>
#include <isc/platform.h>
#include <isc/result.h>
#include <isc/formatcheck.h>
/*
*
* Result codes.
*
*/
#define T_PASS 0x1
#define T_FAIL 0x2
#define T_UNRESOLVED 0x3
#define T_SKIPPED 0x4
#define T_UNTESTED 0x5
#define T_THREADONLY 0x6
#define T_PKCS11ONLY 0x7
/*
*
* Assertion class codes.
*
*/
#define T_OPTIONAL 0x0
#define T_REQUIRED 0x1
/*
* Misc
*/
#define T_MAXTOKS 16
#define T_ARG(n) (*(av + (n)))
typedef void (*PFV)(void);
typedef struct {
PFV pfv;
const char *func_name;
} testspec_t;
LIBTESTS_EXTERNAL_DATA extern int T_debug;
#ifndef WIN32
extern testspec_t T_testlist[];
#endif
ISC_LANG_BEGINDECLS
#ifdef WIN32
void
t_settests(const testspec_t list[]);
int
t_main(int argc, char **argv);
#endif
void
t_assert(const char *component, int anum, int tclass, const char *what, ...)
ISC_FORMAT_PRINTF(4, 5);
void
t_info(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
void
t_result(int result);
char *
t_getenv(const char *name);
char *
t_fgetbs(FILE *fp);
isc_result_t
t_dns_result_fromtext(char *result);
unsigned int
t_dc_method_fromtext(char *dc_method);
int
t_bustline(char *line, char **toks);
int
t_eval(const char *filename, int (*func)(char **), int nargs);
ISC_LANG_ENDDECLS
#endif /* TESTS_T_API_H */
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/* $Id: t_api.c,v 1.68 2010/12/21 04:20:23 marka Exp $ */
/*! \file */
#include <config.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#ifndef WIN32
#include <sys/wait.h>
#else
#include <direct.h>
#endif
#include <isc/boolean.h>
#include <isc/commandline.h>
#include <isc/platform.h>
#include <isc/print.h>
#include <isc/string.h>
#include <isc/mem.h>
#include <dns/compress.h>
#include <dns/result.h>
#include "include/tests/t_api.h"
static const char *Usage =
"\t-a : run all tests\n"
"\t-b <dir> : chdir to dir before running tests"
"\t-c <config_file> : use specified config file\n"
"\t-d <debug_level> : set debug level to debug_level\n"
"\t-h : print test info\n"
"\t-u : print usage info\n"
"\t-n <test_name> : run specified test name\n"
"\t-t <test_number> : run specified test number\n"
"\t-x : don't execute tests in a subproc\n"
"\t-q <timeout> : use 'timeout' as the timeout value\n";
/*!<
* -a --> run all tests
* -b dir --> chdir to dir before running tests
* -c config --> use config file 'config'
* -d --> turn on api debugging
* -h --> print out available test names
* -u --> print usage info
* -n name --> run test named name
* -tn --> run test n
* -x --> don't execute testcases in a subproc
* -q timeout --> use 'timeout' as the timeout value
*/
#define T_MAXTESTS 256 /*% must be 0 mod 8 */
#define T_MAXENV 256
#define T_DEFAULT_CONFIG "t_config"
#define T_BUFSIZ 256
#define T_BIGBUF 4096
#define T_TCTOUT 60
int T_debug;
int T_timeout;
pid_t T_pid;
static const char * T_config;
static char T_tvec[T_MAXTESTS / 8];
static char * T_env[T_MAXENV + 1];
static char T_buf[T_BIGBUF];
static char * T_dir;
#ifdef WIN32
static testspec_t T_testlist[T_MAXTESTS];
#endif
static int
t_initconf(const char *path);
static int
t_dumpconf(const char *path);
static int
t_putinfo(const char *key, const char *info);
static char *
t_getdate(char *buf, size_t buflen);
static void
printhelp(void);
static void
printusage(void);
static int T_int;
static void
t_sighandler(int sig) {
T_int = sig;
}
int
#ifndef WIN32
main(int argc, char **argv)
#else
t_main(int argc, char **argv)
#endif
{
int c;
int tnum;
#ifndef WIN32
int subprocs;
pid_t deadpid;
int status;
#endif
int len;
isc_boolean_t first;
testspec_t *pts;
#ifndef WIN32
struct sigaction sa;
#endif
isc_mem_debugging = ISC_MEM_DEBUGRECORD;
first = ISC_TRUE;
#ifndef WIN32
subprocs = 1;
#endif
T_timeout = T_TCTOUT;
/*
* -a option is now default.
*/
memset(T_tvec, 0xff, sizeof(T_tvec));
/*
* Parse args.
*/
while ((c = isc_commandline_parse(argc, argv, ":at:c:d:n:huxq:b:"))
!= -1) {
if (c == 'a') {
/*
* Flag all tests to be run.
*/
memset(T_tvec, 0xff, sizeof(T_tvec));
}
else if (c == 'b') {
T_dir = isc_commandline_argument;
}
else if (c == 't') {
tnum = atoi(isc_commandline_argument);
if ((tnum > 0) && (tnum < T_MAXTESTS)) {
if (first) {
/*
* Turn off effect of -a default
* and allow multiple -t and -n
* options.
*/
memset(T_tvec, 0, sizeof(T_tvec));
first = ISC_FALSE;
}
/*
* Flag test tnum to be run.
*/
tnum -= 1;
T_tvec[tnum / 8] |= (0x01 << (tnum % 8));
}
}
else if (c == 'c') {
T_config = isc_commandline_argument;
}
else if (c == 'd') {
T_debug = atoi(isc_commandline_argument);
}
else if (c == 'n') {
pts = &T_testlist[0];
tnum = 0;
while (pts->pfv != NULL) {
if (! strcmp(pts->func_name,
isc_commandline_argument)) {
if (first) {
memset(T_tvec, 0,
sizeof(T_tvec));
first = ISC_FALSE;
}
T_tvec[tnum/8] |= (0x01 << (tnum%8));
break;
}
++pts;
++tnum;
}
if (pts->pfv == NULL) {
fprintf(stderr, "no such test %s\n",
isc_commandline_argument);
exit(1);
}
}
else if (c == 'h') {
printhelp();
exit(0);
}
else if (c == 'u') {
printusage();
exit(0);
}
else if (c == 'x') {
#ifndef WIN32
subprocs = 0;
#endif
}
else if (c == 'q') {
T_timeout = atoi(isc_commandline_argument);
}
else if (c == ':') {
fprintf(stderr, "Option -%c requires an argument\n",
isc_commandline_option);
exit(1);
}
else if (c == '?') {
fprintf(stderr, "Unrecognized option -%c\n",
isc_commandline_option);
exit(1);
}
}
/*
* Set cwd.
*/
if (T_dir != NULL && chdir(T_dir) != 0) {
fprintf(stderr, "chdir %s failed\n", T_dir);
exit(1);
}
/*
* We don't want buffered output.
*/
(void)setbuf(stdout, NULL);
(void)setbuf(stderr, NULL);
/*
* Setup signals.
*/
#ifndef WIN32
sa.sa_flags = 0;
sigfillset(&sa.sa_mask);
sa.sa_handler = t_sighandler;
(void)sigaction(SIGINT, &sa, NULL);
(void)sigaction(SIGALRM, &sa, NULL);
#endif
/*
* Output start stanza to journal.
*/
snprintf(T_buf, sizeof(T_buf), "%s:", argv[0]);
len = strlen(T_buf);
(void) t_getdate(T_buf + len, T_BIGBUF - len);
t_putinfo("S", T_buf);
/*
* Setup the test environment using the config file.
*/
if (T_config == NULL)
T_config = T_DEFAULT_CONFIG;
t_initconf(T_config);
if (T_debug)
t_dumpconf(T_config);
/*
* Now invoke all the test cases.
*/
tnum = 0;
pts = &T_testlist[0];
while (pts->pfv != NULL) {
if (T_tvec[tnum / 8] & (0x01 << (tnum % 8))) {
#ifndef WIN32
if (subprocs) {
T_pid = fork();
if (T_pid == 0) {
(*pts->pfv)();
exit(0);
} else if (T_pid > 0) {
T_int = 0;
sa.sa_handler = t_sighandler;
(void)sigaction(SIGALRM, &sa, NULL);
alarm(T_timeout);
deadpid = (pid_t) -1;
while (deadpid != T_pid) {
deadpid =
waitpid(T_pid, &status, 0);
if (deadpid == T_pid) {
if (WIFSIGNALED(status)) {
if (WTERMSIG(status) ==
SIGTERM)
t_info(
"the test case timed out\n");
else
t_info(
"the test case caused exception %d\n",
WTERMSIG(status));
t_result(T_UNRESOLVED);
}
} else if ((deadpid == -1) &&
(errno == EINTR) &&
T_int) {
kill(T_pid, SIGTERM);
T_int = 0;
}
else if ((deadpid == -1) &&
((errno == ECHILD) ||
(errno == ESRCH)))
break;
}
alarm(0);
sa.sa_handler = SIG_IGN;
(void)sigaction(SIGALRM, &sa, NULL);
} else {
t_info("fork failed, errno == %d\n",
errno);
t_result(T_UNRESOLVED);
}
}
else {
(*pts->pfv)();
}
#else
(*pts->pfv)();
#endif
}
++pts;
++tnum;
}
snprintf(T_buf, sizeof(T_buf), "%s:", argv[0]);
len = strlen(T_buf);
(void) t_getdate(T_buf + len, T_BIGBUF - len);
t_putinfo("E", T_buf);
return(0);
}
void
t_assert(const char *component, int anum, int tclass, const char *what, ...) {
va_list args;
char buf[T_BIGBUF];
(void)printf("T:%s:%d:%s\n", component, anum, tclass == T_REQUIRED ?
"A" : "C");
/*
* Format text to a buffer.
*/
va_start(args, what);
(void)vsnprintf(buf, sizeof(buf), what, args);
va_end(args);
(void)t_putinfo("A", buf);
(void)printf("\n");
}
void
t_info(const char *format, ...) {
va_list args;
char buf[T_BIGBUF];
va_start(args, format);
(void) vsnprintf(buf, sizeof(buf), format, args);
va_end(args);
(void) t_putinfo("I", buf);
}
void
t_result(int result) {
const char *p;
switch (result) {
case T_PASS:
p = "PASS";
break;
case T_FAIL:
p = "FAIL";
break;
case T_UNRESOLVED:
p = "UNRESOLVED";
break;
case T_SKIPPED:
p = "SKIPPED";
break;
case T_UNTESTED:
p = "UNTESTED";
break;
case T_THREADONLY:
p = "THREADONLY";
break;
case T_PKCS11ONLY:
p = "PKCS11ONLY";
break;
default:
p = "UNKNOWN";
break;
}
printf("R:%s\n", p);
}
char *
t_getenv(const char *name) {
char *n;
char **p;
size_t len;
n = NULL;
if (name && *name) {
p = &T_env[0];
len = strlen(name);
while (*p != NULL) {
if (strncmp(*p, name, len) == 0) {
if ( *(*p + len) == '=') {
n = *p + len + 1;
break;
}
}
++p;
}
}
return(n);
}
/*
*
* Read in the config file at path, initializing T_env.
*
* note: no format checking for now ...
*