summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-01-27 22:26:21 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-01-27 22:26:21 +0000
commit5dd5ee37d4c6f491cd55c0173aea18209cdc226d (patch)
treeac61b9c247e1fdc7cd4eb1ee42570f78120f6949
parentAdd support for enumerations (diff)
downloadslicer-5dd5ee37d4c6f491cd55c0173aea18209cdc226d.tar.bz2
slicer-5dd5ee37d4c6f491cd55c0173aea18209cdc226d.tar.xz
slicer-5dd5ee37d4c6f491cd55c0173aea18209cdc226d.zip
Call the compile slicer tool from the test case instead of just the library (end-to-end test improvement)
-rw-r--r--slicer/test/Jamfile.jam1
-rw-r--r--slicer/test/fileStructure.cpp2
-rw-r--r--slicer/test/preprocessor.cpp11
3 files changed, 10 insertions, 4 deletions
diff --git a/slicer/test/Jamfile.jam b/slicer/test/Jamfile.jam
index dde7362..b4e1046 100644
--- a/slicer/test/Jamfile.jam
+++ b/slicer/test/Jamfile.jam
@@ -51,6 +51,7 @@ unit-test preprocess :
<library>common
<include>..
<library>../slicer//slicer
+ <dependency>../tool//slicer
;
unit-test compilation :
diff --git a/slicer/test/fileStructure.cpp b/slicer/test/fileStructure.cpp
index 28d1229..99f7165 100644
--- a/slicer/test/fileStructure.cpp
+++ b/slicer/test/fileStructure.cpp
@@ -5,7 +5,7 @@
FileStructure::FileStructure() :
me(boost::filesystem::canonical("/proc/self/exe")),
base("types"),
- bjamout(me.parent_path()),
+ bjamout(me.parent_path().parent_path().parent_path().leaf() / me.parent_path().parent_path().leaf() / me.parent_path().leaf()),
root(me.parent_path().parent_path().parent_path().parent_path()),
slice(fs::change_extension(root / base, ".ice")),
tmp(root / "bin" / "slicer")
diff --git a/slicer/test/preprocessor.cpp b/slicer/test/preprocessor.cpp
index fa65a44..8b4876a 100644
--- a/slicer/test/preprocessor.cpp
+++ b/slicer/test/preprocessor.cpp
@@ -51,12 +51,17 @@ BOOST_AUTO_TEST_CASE( slicer_test_ice )
const fs::path cpp = fs::change_extension(tmp / base, ".cpp");
BOOST_TEST_CHECKPOINT("cpp: " << cpp);
fs::remove(cpp);
- Slicer::Slicer::Apply(slice, cpp);
+ const std::string doslice = stringbf(
+ "%s %s %s",
+ root.parent_path() / "tool" / bjamout / "slicer",
+ slice, cpp);
+ BOOST_TEST_CHECKPOINT("slicer: " << doslice);
+ system(doslice);
const fs::path obj = fs::change_extension(tmp / base, ".o");
const std::string compile = stringbf(
"g++ -Os -fPIC -c -std=c++0x -I tmp -I /usr/include/Ice -I /usr/include/IceUtil -I %s -I %s %s -o %s",
- bjamout,
+ root / bjamout,
root / "..",
cpp, obj);
BOOST_TEST_CHECKPOINT("compile: " << compile);
@@ -65,7 +70,7 @@ BOOST_AUTO_TEST_CASE( slicer_test_ice )
const fs::path so = fs::change_extension(tmp / ("libslicer" + slice.filename().string()), ".so");
const std::string link = stringbf(
"g++ -shared -lIce -lIceUtil %s/lib%s.so %s -o %s",
- bjamout, base,
+ root / bjamout, base,
obj, so);
BOOST_TEST_CHECKPOINT("link: " << link);
system(link);