removing in favor of rosunit

This commit is contained in:
Ken Conley 2010-10-27 01:27:58 +00:00
parent 67fdd87768
commit fd5a21bc63
9 changed files with 0 additions and 470 deletions

View File

@ -1,30 +0,0 @@
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})

View File

@ -1 +0,0 @@
include $(shell rospack find mk)/cmake.mk

View File

@ -1,106 +0,0 @@
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Revision $Id: cleanunit 8966 2010-04-08 01:49:41Z kwc $
"""
Cleanunit is a simple script that takes all the xml-formatted unit
test output in test_results and aggregates them into
test_results/_hudson. In this process, it strips any characters that
tend to cause Hudson trouble.
"""
from __future__ import with_statement
import roslib;
import sys
import os
try:
roslib.load_manifest('rostest')
except roslib.packages.InvalidROSPkgException, ex:
print("CLEANUNIT: ERROR: rostest not detected")
sys.exit(0)
import roslib.rosenv
import rostest.xmlresults as xmlr
def prepare_dirs(output_dir_name):
test_results_dir = roslib.rosenv.get_test_results_dir()
print "will read test results from", test_results_dir
output_dir = os.path.join(test_results_dir, output_dir_name)
if not os.path.exists(output_dir):
print "creating directory", output_dir
os.makedirs(output_dir)
return test_results_dir, output_dir
## read results from \a test_results_dir and write them into \a output_dir
def clean_results(test_results_dir, output_dir, filter):
for d in os.listdir(test_results_dir):
if filter and d in filter:
continue
print "looking at", d
test_dir = os.path.join(test_results_dir, d)
if not os.path.isdir(test_dir):
continue
base_test_name = os.path.basename(test_dir)
# for each test result that a package generated, read it, then
# rewrite it to our output directory. This will invoke our
# cleaning rules on the XML that protect the result from Hudson
# issues.
for file in os.listdir(test_dir):
if file.endswith('.xml'):
test_name = base_test_name + '.' + file[:-4]
file = os.path.join(test_dir, file)
try:
result = xmlr.read(file, test_name)
output_path = os.path.join(output_dir, "%s.xml"%test_name)
with open(output_path, 'w') as f:
print "re-writing", output_path
f.write(result.xml().encode('utf-8'))
except Exception, e:
print >> sys.stderr, "ignoring [%s]: %s"%(file, e)
def main():
print "[cleanunit]: STARTING"
output_dir_name = '_hudson'
test_results_dir, output_dir = prepare_dirs(output_dir_name)
print "[cleanunit]: writing aggregated test results to %s"%output_dir
clean_results(test_results_dir, output_dir, [output_dir_name, '.svn'])
print "[cleanunit]: FINISHED"
if __name__ == '__main__':
main()

View File

@ -1,86 +0,0 @@
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Revision $Id: coverage-html 8966 2010-04-08 01:49:41Z kwc $
"""
Generate HTML reports from coverage.py (aka python-coverage). This is
currently a no-frills backend tool.
"""
from __future__ import with_statement
import sys
import roslib
try:
import coverage
except ImportError, e:
print >> sys.stderr, "ERROR: cannot import python-coverage, coverage report will not run.\nTo install coverage, run 'easy_install coverage'"
sys.exit(1)
def coverage_html():
import os.path
if not os.path.isfile('.coverage-modules'):
print >> sys.stderr, "No .coverage-modules file; nothing to do"
return
with open('.coverage-modules','r') as f:
modules = [x for x in f.read().split('\n') if x.strip()]
cov = coverage.coverage()
cov.load()
# import everything
for m in modules:
try:
base = m.split('.')[0]
roslib.load_manifest(base)
__import__(m)
except:
print >> sys.stderr, "WARN: cannot import %s"%base
print "Generating for\n"+'\n'.join([" * %s"%m for m in modules])
# load the module instances to pass to coverage so it can generate annotation html reports
mods = []
# TODO: rewrite, buggy
for m in modules:
mods.extend([v for v in sys.modules.values() if v and v.__name__.startswith(m) and not v in mods])
# dump the output to covhtml directory
cov.html_report(mods, directory="covhtml")
if __name__ == '__main__':
coverage_html()

View File

@ -1,54 +0,0 @@
#!/usr/bin/env python
import os
import sys
def usage():
print >> sys.stderr, """Usage:
\trostest-check-results test-file.xml
or
\trostest-check-results --rostest pkg-name test-file.xml
"""
print sys.argv
sys.exit(os.EX_USAGE)
## writes a test failure out to test file if it doesn't exist
if __name__ == '__main__':
if len(sys.argv) < 2:
usage()
if '--rostest' in sys.argv[1:]:
if len(sys.argv) != 4:
usage()
test_pkg, test_file = [a for a in sys.argv[1:] if a != '--rostest']
# this logic derives the output filename that rostest uses
import roslib; roslib.load_manifest('rostest')
import roslib.packages
import rostest.rostestutil
pkg_dir, _ = roslib.packages.get_dir_pkg(test_file)
outname = rostest.rostestutil.rostest_name_from_path(pkg_dir, test_file)
test_file = rostest.rostestutil.xmlResultsFile(test_pkg, outname, is_rostest=True)
else:
if len(sys.argv) != 2:
usage()
test_file = sys.argv[1]
print "Checking for test results in %s"%test_file
if not os.path.exists(test_file):
if not os.path.exists(os.path.dirname(test_file)):
os.makedirs(os.path.dirname(test_file))
print "Cannot find results, writing failure results to", test_file
f = open(test_file, 'w')
try:
test_name = os.path.basename(test_file)
d = {'test': test_name, 'test_file': test_file }
f.write("""<?xml version="1.0" encoding="UTF-8"?>
<testsuite tests="1" failures="1" time="1" errors="0" name="%(test)s">
<testcase name="test_ran" status="run" time="1" classname="Results">
<failure message="Unable to find test results for %(test)s, test did not run.\nExpected results in %(test_file)s" type=""/>
</testcase>
</testsuite>"""%d)
finally:
f.close()

View File

@ -1,113 +0,0 @@
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Revision $Id: rostest-results 6512 2009-10-13 19:32:34Z kwc $
## script that prints summary of aggregated test results to console
import roslib;
import sys
import cStringIO
import os
try:
roslib.load_manifest('rostest')
except roslib.packages.InvalidROSPkgException, ex:
print("ERROR: rostest not detected")
sys.exit(0)
import roslib.rospack
import rostest.xmlresults as xmlr
def create_summary(result, packages):
buff = cStringIO.StringIO()
buff.write('-'*80+'\n')
buff.write('\033[1m[AGGREGATED TEST RESULTS SUMMARY]\033[0m\n\n')
errors_failures = [r for r in result.test_case_results if r.errors or r.failures]
if errors_failures:
buff.write('ERRORS/FAILURES:\n')
for tc_result in errors_failures:
buff.write(tc_result.description)
buff.write("PACKAGES: \n%s\n\n"%'\n'.join([" * %s"%p for p in packages]))
buff.write('\nSUMMARY\n')
if (result.num_errors + result.num_failures) == 0:
buff.write("\033[32m * RESULT: SUCCESS\033[0m\n")
else:
buff.write("\033[1;31m * RESULT: FAIL\033[0m\n")
# TODO: still some issues with the numbers adding up if tests fail to launch
# number of errors from the inner tests, plus add in count for tests
# that didn't run properly ('result' object).
buff.write(" * TESTS: %s\n"%result.num_tests)
if result.num_errors:
buff.write("\033[1;31m * ERRORS: %s\033[0m\n"%result.num_errors)
else:
buff.write(" * ERRORS: 0\n")
if result.num_failures:
buff.write("\033[1;31m * FAILURES: %s\033[0m\n"%result.num_failures)
else:
buff.write(" * FAILURES: 0\n")
return buff.getvalue()
def main():
from optparse import OptionParser
parser = OptionParser(usage="usage: rostest-results [options] package")
parser.add_option("--nodeps",
dest="no_deps", default=False,
action="store_true",
help="don't compute test results for the specified package only")
(options, args) = parser.parse_args()
if len(args) != 1:
parser.error("Only one package may be specified")
package = args[0]
if options.no_deps:
packages = [package]
else:
packages = [package] + roslib.rospack.rospackexec(['depends-on', package]).split('\n')
packages = [p for p in packages if p]
result = xmlr.read_all(packages)
print create_summary(result, packages)
if result.num_errors or result.num_failures:
sys.exit(1)
if __name__ == '__main__':
main()

View File

@ -1,39 +0,0 @@
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Revision $Id: test-results-dir 8966 2010-04-08 01:49:41Z kwc $
"""test-results-dir simply prints the directory that test_results are stored in"""
import roslib.rosenv
print roslib.rosenv.get_test_results_dir()

View File

@ -1,26 +0,0 @@
/**
\mainpage
\htmlinclude manifest.html
\b ros_unit is ...
<!--
Provide an overview of your package.
-->
\section codeapi Code API
<!--
Provide links to specific auto-generated API documentation within your
package that is of particular interest to a reader. Doxygen will
document pretty much every part of your code, so do your best here to
point the reader to the actual API.
If your codebase is fairly large or has different sets of APIs, you
should use the doxygen 'group' tag to keep these APIs together. For
example, the roscpp documentation has 'libros' group.
-->
*/

View File

@ -1,15 +0,0 @@
<package>
<description brief="ros_unit">
ros_unit is a package to contain tools used for unit tests.
</description>
<author>Tully Foote</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<url>http://ros.org/wiki/ros_unit</url>
<depend package="roslib"/>
</package>