summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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());