00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <boost/test/unit_test.hpp>
00020 #include "torc/physical/XdlImporter.hpp"
00021 #include "torc/physical/XdlExporter.hpp"
00022 #include "torc/common/DirectoryTree.hpp"
00023 #include "torc/physical/Factory.hpp"
00024 #include "torc/physical/Design.hpp"
00025 #include <fstream>
00026
00027 namespace torc {
00028 namespace physical {
00029
00030 BOOST_AUTO_TEST_SUITE(physical)
00031
00032
00033 BOOST_AUTO_TEST_CASE(SampleCodeUnitTest) {
00034
00035
00036 boost::filesystem::path regressionPath =
00037 torc::common::DirectoryTree::getExecutablePath() / "regression";
00038 boost::filesystem::path generatedPath = regressionPath / "DesignUnitTest.generated.xdl";
00039 boost::filesystem::path referencePath = regressionPath / "DesignUnitTest.reference.xdl";
00040
00041
00042 std::fstream fileStream(referencePath.string().c_str());
00043 BOOST_REQUIRE(fileStream.good());
00044 XdlImporter importer;
00045 importer(fileStream, referencePath.string());
00046
00047
00048 DesignSharedPtr designPtr = importer.getDesignPtr();
00049 BOOST_REQUIRE(designPtr.get() != 0);
00050
00051
00052 std::fstream xdlExport(generatedPath.string().c_str(), std::ios_base::out);
00053 XdlExporter fileExporter(xdlExport);
00054 fileExporter(designPtr);
00055
00056 }
00057
00058 BOOST_AUTO_TEST_SUITE_END()
00059
00060 }
00061 }