summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2014-11-13 23:39:54 +0000
committerrandomdan <randomdan@localhost>2014-11-13 23:39:54 +0000
commit2f1c4aa1d9b0a0e0b4b0fd62ff9c2a408881841f (patch)
tree278fffa5a64075ede3fb3432161059a10035755f
parentFix quirk (from glibc update?) around fields in struct tm and the _BSD_SOURCE... (diff)
downloadlibjsonpp-2f1c4aa1d9b0a0e0b4b0fd62ff9c2a408881841f.tar.bz2
libjsonpp-2f1c4aa1d9b0a0e0b4b0fd62ff9c2a408881841f.tar.xz
libjsonpp-2f1c4aa1d9b0a0e0b4b0fd62ff9c2a408881841f.zip
Scattering of fixes to remove hacks around paths and fix running the build from folders other than the project root
-rw-r--r--libjsonpp/Jamfile.jam7
-rw-r--r--libjsonpp/test1.cpp7
2 files changed, 13 insertions, 1 deletions
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 : : : :
<linkflags>"`pkg-config --libs glibmm-2.4`"
;
lib boost_utf : : <name>boost_unit_test_framework ;
+lib boost_system ;
+lib boost_filesystem ;
+
+path-constant me : . ;
cpp-pch pch : pch.hpp :
<library>glibmm
@@ -23,9 +27,12 @@ unit-test test1 :
test1.cpp
pch
:
+ <define>ROOT=\"$(me)\"
<define>BOOST_TEST_DYN_LINK
<library>jsonpp
<library>boost_utf
+ <library>boost_system
+ <library>boost_filesystem
;
package.install install : <install-source-root>. : : 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 <fstream>
+#include <boost/filesystem/path.hpp>
+
+#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());