From 84880e876ddfb26ea41b791fd0112af22fd05d46 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 15 Feb 2016 12:29:22 -0500 Subject: [PATCH] dbUnitTest: show PWD when database load fails --- src/ioc/db/dbUnitTest.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ioc/db/dbUnitTest.c b/src/ioc/db/dbUnitTest.c index 07e12e739..d0d5906c8 100644 --- a/src/ioc/db/dbUnitTest.c +++ b/src/ioc/db/dbUnitTest.c @@ -15,6 +15,7 @@ #include "dbmf.h" #include "epicsUnitTest.h" #include "osiFileName.h" +#include "osiUnistd.h" #include "registry.h" #include "epicsEvent.h" @@ -52,9 +53,14 @@ void testdbReadDatabase(const char* file, if(!path) path = "." OSI_PATH_LIST_SEPARATOR ".." OSI_PATH_LIST_SEPARATOR "../O.Common" OSI_PATH_LIST_SEPARATOR "O.Common"; - if(dbReadDatabase(&pdbbase, file, path, substitutions)) - testAbort("Failed to load test database\ndbReadDatabase(%s,%s,%s)", - file, path, substitutions); + if(dbReadDatabase(&pdbbase, file, path, substitutions)) { + char buf[100]; + const char *cwd = getcwd(buf, sizeof(buf)); + if(!cwd) + cwd = ""; + testAbort("Failed to load test database\ndbReadDatabase(%s,%s,%s)\n from: \"%s\"", + file, path, substitutions, cwd); + } } void testIocInitOk(void)