summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-06-30 15:08:32 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-11-15 13:14:07 +1000
commit202031e7963e8dff71ce26c2de11d9133db52a1b (patch)
treea78bd596762e301cc10f6c580eec44371bb9561c
parent57bc6e7b7efae6106dd2093e50e29d5677fe487d (diff)
tet3: if TET_RESFILE is not in the env, guess it from the program name.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/tet3/tcm/ictp.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/tet3/tcm/ictp.c b/src/tet3/tcm/ictp.c
index 1e81c169..f06b494c 100644
--- a/src/tet3/tcm/ictp.c
+++ b/src/tet3/tcm/ictp.c
@@ -123,6 +123,9 @@ MODIFICATIONS:
Andrew Dingwall, UniSoft Ltd., July 1998
Added support for shared API libraries.
+ Peter Hutterer, Red Hat, Inc., June 2010
+ Guess TET_RESFILE if it's not in the environment.
+
************************************************************************/
#include <stdio.h>
@@ -798,7 +801,13 @@ char *progname;
/* get results filename from the environment */
resfile = getenv("TET_RESFILE");
if (!resfile)
- fatal(0, "TET_RESFILE not set in the environment", NULL);
+ {
+ /* just assume progname.log. */
+ char *new_resfile = malloc(strlen(progname) + 5);
+ sprintf(new_resfile, "%s.log", progname);
+ resfile = new_resfile; /* XXX: leaking memory */
+ printf("TET_RESFILE not set in the environment, using '%s'.\n", resfile);
+ }
tmpresenv = malloc(strlen(tmpvar) + strlen(resfile) +
strlen("=.tmp") + 1);