Permalink
Browse files

Random example test

  • Loading branch information...
1 parent 2a717b6 commit 1550b473694a938dce7203f9b4b20092a1d9d7bd I Heart Robotics committed Mar 18, 2012
@@ -0,0 +1,2 @@
+bin
+build
@@ -0,0 +1,32 @@
+cmake_minimum_required(VERSION 2.4.6)
+include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
+
+# Set the build type. Options are:
+# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
+# Debug : w/ debug symbols, w/o optimization
+# Release : w/o debug symbols, w/ optimization
+# RelWithDebInfo : w/ debug symbols, w/ optimization
+# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
+#set(ROS_BUILD_TYPE RelWithDebInfo)
+
+rosbuild_init()
+
+#set the default path for built executables to the "bin" directory
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
+#set the default path for built libraries to the "lib" directory
+set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
+
+#uncomment if you have defined messages
+#rosbuild_genmsg()
+#uncomment if you have defined services
+#rosbuild_gensrv()
+
+#common commands for building c++ executables and libraries
+#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
+#target_link_libraries(${PROJECT_NAME} another_library)
+#rosbuild_add_boost_directories()
+#rosbuild_link_boost(${PROJECT_NAME} thread)
+#rosbuild_add_executable(example examples/example.cpp)
+#target_link_libraries(example ${PROJECT_NAME})
+
+rosbuild_add_library(testbench src/random_testbench_plugin.cpp)
@@ -0,0 +1 @@
+include $(shell rospack find mk)/cmake.mk
@@ -0,0 +1,26 @@
+#ifndef RANDOM_TESTBENCH_RANDOM_TESTBENCH_PLUGIN_H_
+#define RANDOM_TESTBENCH_RANDOM_TESTBENCH_PLUGIN_H_
+#include <testbench/test_base.h>
+#include <cmath>
+#include <stdlib.h>
+
+namespace test_plugins
+{
+ class Random : public test_base::Test
+ {
+ public:
+ Random(){}
+
+ void initialize()
+ {
+ srand((unsigned)time(0));
+ }
+
+ double run()
+ {
+ return (double)rand()/(double)RAND_MAX;
+ }
+
+ };
+};
+#endif
@@ -0,0 +1,14 @@
+/**
+\mainpage
+\htmlinclude manifest.html
+
+\b random_testbench
+
+<!--
+Provide an overview of your package.
+-->
+
+-->
+
+
+*/
@@ -0,0 +1,17 @@
+<package>
+ <description brief="random_testbench">
+This useless test outputs a random score as an example.
+ </description>
+ <author>I Heart Engineering</author>
+ <license>BSD</license>
+ <review status="unreviewed" notes=""/>
+ <url>http://ros.org/wiki/random_testbench</url>
+ <depend package="roscpp"/>
+ <depend package="pluginlib"/>
+ <depend package="testbench"/>
+ <export>
+ <testbench plugin="${prefix}/random_testbench.xml" />
+ </export>
+</package>
+
+
@@ -0,0 +1,5 @@
+<library path="lib/libtestbench">
+ <class name="testbench/test_random" type="test_plugins::Random" base_class_type="test_base::Test">
+ <description>This is a random test.</description>
+ </class>
+</library>
@@ -0,0 +1,4 @@
+#include <pluginlib/class_list_macros.h>
+#include <random_testbench/random_testbench_plugin.h>
+
+PLUGINLIB_DECLARE_CLASS(testbench, test_random, test_plugins::Random, test_base::Test)

0 comments on commit 1550b47

Please sign in to comment.