From 2f1c4aa1d9b0a0e0b4b0fd62ff9c2a408881841f Mon Sep 17 00:00:00 2001 From: randomdan Date: Thu, 13 Nov 2014 23:39:54 +0000 Subject: Scattering of fixes to remove hacks around paths and fix running the build from folders other than the project root --- libjsonpp/Jamfile.jam | 7 +++++++ libjsonpp/test1.cpp | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/libjsonpp/Jamfile.jam b/libjsonpp/Jamfile.jam index f3cab3d..fae359c 100644 --- a/libjsonpp/Jamfile.jam +++ b/libjsonpp/Jamfile.jam @@ -6,6 +6,10 @@ alias glibmm : : : : "`pkg-config --libs glibmm-2.4`" ; lib boost_utf : : boost_unit_test_framework ; +lib boost_system ; +lib boost_filesystem ; + +path-constant me : . ; cpp-pch pch : pch.hpp : glibmm @@ -23,9 +27,12 @@ unit-test test1 : test1.cpp pch : + ROOT=\"$(me)\" BOOST_TEST_DYN_LINK jsonpp boost_utf + boost_system + boost_filesystem ; package.install install : . : : jsonpp : [ glob *.h ] ; diff --git a/libjsonpp/test1.cpp b/libjsonpp/test1.cpp index 705b18b..e0bdf8f 100644 --- a/libjsonpp/test1.cpp +++ b/libjsonpp/test1.cpp @@ -5,6 +5,11 @@ #include "jsonpp.h" #include +#include + +#define XSTR(s) STR(s) +#define STR(s) #s +const boost::filesystem::path root(XSTR(ROOT)); BOOST_AUTO_TEST_CASE( parse_bool_true ) { @@ -107,7 +112,7 @@ BOOST_AUTO_TEST_CASE( parse_string_escapedQuote ) BOOST_AUTO_TEST_CASE( parse_sample_complexFile ) { - std::ifstream inFile("initial/sample1.json"); + std::ifstream inFile((root / "initial" / "sample1.json").string()); std::stringstream buffer; buffer << inFile.rdbuf(); Glib::ustring doc(buffer.str()); -- cgit v1.2.3