torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
architecture/XdlImporterUnitTest.cpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 /// \file
17 /// \brief Unit test for the XdlImporter class.
18 
19 #include <boost/test/unit_test.hpp>
21 #include "torc/physical/Design.hpp"
23 #include <fstream>
24 
25 
26 namespace torc {
27 namespace architecture {
28 
29 BOOST_AUTO_TEST_SUITE(regression)
30 BOOST_AUTO_TEST_SUITE(architecture)
31 
32 /// \brief Unit test for the device-aware XdlImporter class.
33 
34 BOOST_AUTO_TEST_CASE(XdlImporterUnitTest) {
35  // create the appropriate file paths
37  / "torc" / "physical" / "DesignUnitTest.reference.xdl";
39  / "regression" / "DesignUnitTest.generated.xdl";
40 
41  // import the XDL design
42  std::fstream fileStream(referencePath.string().c_str());
43  BOOST_REQUIRE(fileStream.good());
44  XdlImporter importer;
45  importer(fileStream, referencePath.string());
46 
47  // look up the design (and do something with it ...)
48  torc::physical::DesignSharedPtr designPtr = importer.getDesignPtr();
49  BOOST_REQUIRE(designPtr.get() != 0);
50  BOOST_REQUIRE(false); // we haven't actually tested anything yet
51  BOOST_TEST_MESSAGE("Need to fix XdlImporter::bind(torc::physical::Pip& inPip, EPipType inPipType) and XDL design regression test files for directionality of pips.");
52 
53  // look up the device database (and do something with it ...)
54  DDB* ddbPtr = importer.releaseDDBPtr();
55  (void) ddbPtr;
56 }
57 
58 BOOST_AUTO_TEST_SUITE_END()
59 BOOST_AUTO_TEST_SUITE_END()
60 
61 } // namespace architecture
62 } // namespace torc
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
BOOST_AUTO_TEST_CASE(ArcUnitTest)
Unit test for the Arc class.
Definition: ArcUnitTest.cpp:29
DesignSharedPtr getDesignPtr(void)
Returns a shared pointer for the design.
Header for the DirectoryTree class.
Architecture aware importer from XDL format into a physical design.
Header for the Design class.
boost::filesystem::path path
boost::shared_ptr< Design > DesignSharedPtr
Shared pointer encapsulation of a Design.
Header for the XdlImporter class.
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.