Consolidate path handling for test data files. Added CERES_TEST_SRCDIR_POSTFIX macro. Added TestFileAbsolutePath function. Change-Id: I223b74af027bfb775447e062edab897395b21514
diff --git a/internal/ceres/visibility_based_preconditioner_test.cc b/internal/ceres/visibility_based_preconditioner_test.cc index 5c4a6e8..bf01acb 100644 --- a/internal/ceres/visibility_based_preconditioner_test.cc +++ b/internal/ceres/visibility_based_preconditioner_test.cc
@@ -45,11 +45,10 @@ #include "ceres/schur_eliminator.h" #include "ceres/stringprintf.h" #include "ceres/types.h" +#include "ceres/test_util.h" #include "glog/logging.h" #include "gtest/gtest.h" -DECLARE_string(test_srcdir); - namespace ceres { namespace internal { @@ -65,9 +64,7 @@ protected: void SetUp() { - string input_file = - JoinPath(FLAGS_test_srcdir, - "problem-6-1384-000.lsqp"); // NOLINT + string input_file = TestFileAbsolutePath("problem-6-1384-000.lsqp"); scoped_ptr<LinearLeastSquaresProblem> problem( CHECK_NOTNULL(CreateLinearLeastSquaresProblemFromFile(input_file)));