From f021ba00a2f06a08ac767a94f6fdebb01d3f74b4 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Thu, 4 Feb 2010 21:10:04 +0200 Subject: [PATCH] C++: Fix test_cpp.cpp to work with VPATH builds It reads an input file, and the file location is different with VPATH builds. Read top_srcdir from environment and use it to find the file. --- test/suites/api/test_cpp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/suites/api/test_cpp.cpp b/test/suites/api/test_cpp.cpp index b8626ea..1215e4e 100644 --- a/test/suites/api/test_cpp.cpp +++ b/test/suites/api/test_cpp.cpp @@ -22,7 +22,8 @@ #define ASSERT_FALSE(p, m) ASSERT_OP(p, true, !=, m) int main() { - json::Value e1(json::load_file("suites/api/test_cpp.json")); + std::string top_srcdir = getenv("top_srcdir"); + json::Value e1(json::load_file(top_srcdir + "/test/suites/api/test_cpp.json")); json::Value e2(e1); json::Value e3; json::Value e4(json::loads("{\"foo\": true, \"bar\": \"test\"}")); -- 2.1.4