From: Date: Fri, 28 May 2010 03:56:29 +0000 (+0000) Subject: Move TEST_SRC_DIR from googletest.h to config.h. X-Git-Tag: accepted/tizen/5.0/unified/20181102.024921~151 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f8dac87fc254001a688c0dad7b294380cbc34cf;p=platform%2Fupstream%2Fglog.git Move TEST_SRC_DIR from googletest.h to config.h. Now test passes out side tree. git-svn-id: https://google-glog.googlecode.com/svn/trunk@85 eb4d4688-79bd-11dd-afb4-1d65580434c0 --- diff --git a/configure b/configure index f97f9dc..c401710 100755 --- a/configure +++ b/configure @@ -25062,6 +25062,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me: WARNING: Could not find the PC. Will not output failed addresses..." >&2;} fi + +cat >>confdefs.h <<_ACEOF +#define TEST_SRC_DIR "$srcdir" +_ACEOF + + # These are what's needed by logging.h.in and raw_logging.h.in diff --git a/configure.ac b/configure.ac index 13a2681..fd3a123 100644 --- a/configure.ac +++ b/configure.ac @@ -176,6 +176,8 @@ AC_CXX_USING_OPERATOR AC_PC_FROM_UCONTEXT(AC_MSG_WARN(Could not find the PC. Will not output failed addresses...)) +AC_DEFINE_UNQUOTED(TEST_SRC_DIR, "$srcdir", [location of source code]) + # These are what's needed by logging.h.in and raw_logging.h.in AC_SUBST(ac_google_start_namespace) AC_SUBST(ac_google_end_namespace) diff --git a/src/config.h.in b/src/config.h.in index 99bd0da..b5454ba 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -145,6 +145,9 @@ /* the namespace where STL code like vector<> is defined */ #undef STL_NAMESPACE +/* location of source code */ +#undef TEST_SRC_DIR + /* Version number of package */ #undef VERSION diff --git a/src/googletest.h b/src/googletest.h index c1df14e..c9e413e 100644 --- a/src/googletest.h +++ b/src/googletest.h @@ -85,7 +85,8 @@ static inline string GetTempDir() { // The test will run in glog/vsproject/ // (e.g., glog/vsproject/logging_unittest). static const char TEST_SRC_DIR[] = "../.."; -#else +#elif !defined(TEST_SRC_DIR) +# warning TEST_SRC_DIR should be defined in config.h static const char TEST_SRC_DIR[] = "."; #endif