00001 00006 #include <rtt/os/startstop.h> 00007 #include <ocl/DeploymentComponent.hpp> 00008 #include <rtt/Logger.hpp> 00009 #include <rtt/deployment/ComponentLoader.hpp> 00010 #include <rtt/scripting/Scripting.hpp> 00011 00012 #include <gtest/gtest.h> 00013 00014 boost::shared_ptr<OCL::DeploymentComponent> deployer; 00015 boost::shared_ptr<RTT::Scripting> scripting_service; 00016 00017 TEST(BasicTest, Import) 00018 { 00019 // Import rtt_ros plugin 00020 EXPECT_TRUE(RTT::ComponentLoader::Instance()->import("rtt_ros", "" )); 00021 EXPECT_TRUE(RTT::ComponentLoader::Instance()->import("rtt_roscomm", "" )); 00022 } 00023 00024 TEST(BasicTest, ImportTypekit) 00025 { 00026 // Import rtt_std_msgs typekit 00027 EXPECT_TRUE(RTT::ComponentLoader::Instance()->import("rtt_std_msgs", "" )); 00028 EXPECT_TRUE(scripting_service->eval("var ConnPolicy float_out = ros.topic(\"float_out\")")); 00029 } 00030 00031 int main(int argc, char** argv) { 00032 testing::InitGoogleTest(&argc, argv); 00033 00034 // Initialize Orocos 00035 __os_init(argc, argv); 00036 00037 deployer = boost::make_shared<OCL::DeploymentComponent>(); 00038 scripting_service = deployer->getProvider<RTT::Scripting>("scripting"); 00039 00040 RTT::Logger::log().setStdStream(std::cerr); 00041 RTT::Logger::log().mayLogStdOut(true); 00042 RTT::Logger::log().setLogLevel(RTT::Logger::Debug); 00043 00044 return RUN_ALL_TESTS(); 00045 } 00046