Skip to content
Snippets Groups Projects
Commit 6248cd30 authored by Marco Bartolini's avatar Marco Bartolini
Browse files

Added Roach component to SystemMake Makefile Common Modules

parent 61d64b18
No related branches found
No related tags found
No related merge requests found
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
PY_SCRIPTS = getTemplateForTest PY_SCRIPTS = getTemplateForTest
PY_MODULES = gettemplatefortest PY_MODULES = gettemplatefortest
SCRIPTS_L = install_gmock
# #
#>>>>> END OF standard rules #>>>>> END OF standard rules
...@@ -37,7 +35,7 @@ all: do_all ...@@ -37,7 +35,7 @@ all: do_all
@echo " . . . 'all' done" @echo " . . . 'all' done"
clean_templates: clean_templates:
rm -rf $(INTROOT)/templates/test rm -rf $(INTROOT)/templates/discos-test
@echo " . . . templates removed from introot" @echo " . . . templates removed from introot"
clean : clean_all clean_templates clean : clean_all clean_templates
...@@ -50,8 +48,8 @@ man : do_man ...@@ -50,8 +48,8 @@ man : do_man
@echo " . . . man page(s) done" @echo " . . . man page(s) done"
install_templates: install_templates:
cp -r ../templates/test $(INTROOT)/templates cp -r ../templates/discos-test $(INTROOT)/templates
find $(INTROOT)/templates/test -type d -name ".svn" | xargs rm -rf find $(INTROOT)/templates/discos-test -type d -name ".svn" | xargs rm -rf
@echo " . . . templates installed" @echo " . . . templates installed"
install : install_all install_templates install : install_all install_templates
......
...@@ -6,7 +6,7 @@ usage = """ ...@@ -6,7 +6,7 @@ usage = """
getTmplateForTest - create a test directory containing the necessary code templates getTmplateForTest - create a test directory containing the necessary code templates
used for component automated testing. used for component automated testing.
This command should be run from within a Component directory at This command should be run from within a Component directory at
the first level of depth, creating a 'test' directory at the same level the first level of depth, creating a 'discos-test' directory at the same level
of 'src, objects' ecc... of 'src, objects' ecc...
""" """
...@@ -19,7 +19,7 @@ def get_introot(): ...@@ -19,7 +19,7 @@ def get_introot():
def get_template_dir_name(): def get_template_dir_name():
introot = get_introot() introot = get_introot()
return os.path.join(introot, "templates/test") return os.path.join(introot, "templates/discos-test")
def get_template_dir(): def get_template_dir():
template_dir = get_template_dir_name() template_dir = get_template_dir_name()
...@@ -40,7 +40,7 @@ def command_line_util(args): ...@@ -40,7 +40,7 @@ def command_line_util(args):
print usage print usage
sys.exit(0) sys.exit(0)
else: else:
target_dir = 'test' # Default target directory target_dir = 'discos-test' # Default target directory
if os.path.exists(target_dir): if os.path.exists(target_dir):
msg = "ERROR: %s directory already exists." %target_dir msg = "ERROR: %s directory already exists." %target_dir
......
#!/bin/bash
if [[ $(id -u) -ne 0 ]] ; then echo "Script must be run as root" ; exit 1 ; fi
GMOCK=gmock-1.7.0
GMOCK_BASE_URL=https://googlemock.googlecode.com/files
BUILDDIR=build
PWD=`pwd`
TMPDIR=`mktemp -d`
cd $TMPDIR
wget $GMOCK_BASE_URL/$GMOCK.zip
unzip $GMOCK.zip
cd $GMOCK
export GMOCK_HOME=`pwd`
mkdir $BUILDDIR
cd $BUILDDIR
cmake ..
make
chmod a+x *.a
cp *.a /usr/local/lib
cd $GMOCK_HOME/include
cp -r gmock /usr/local/include
cd $GMOCK_HOME/gtest
mkdir $BUILDDIR
cd $BUILDDIR
cmake ..
make
chmod a+x *.a
cp *.a /usr/local/lib
cd $GMOCK_HOME/gtest/include
cp -r gtest /usr/local/include
cd $PWD
rm -rf $TMPDIR
# CPP UNIT TESTING SETUP
#--------------
GTEST_HOME=/usr/local/include/gtest
GMOCK_HOME=/usr/local/include/gmock
GTEST_LIBS=gtest gtest_main
USER_INC=-I$(GTEST_HOME) -I$(GMOCK_HOME)
USER_LIBS=C++ pthread
# END OF CPP UNIT TESTING SETUP
#---------------------
# DEFINE YOUR CPP UNIT TEST EXECUTABLES HERE as:
#
# EXECTUABLES_L = unittest
# unittest_OBJECTS = unittest
# unittest_LIBS = $(GTEST_LIBS) <ComponentNameImpl>
EXECUTABLES_L = unittest
unittest_OBJECTS = unittest
unittest_LIBS = $(GTEST_LIBS)
# END OF CUSTOMIZATION
# do not edit below this line
#----------------------------
CSOURCENAMES = \
$(foreach exe, $(EXECUTABLES) $(EXECUTABLES_L), $($(exe)_OBJECTS)) \
$(foreach rtos, $(RTAI_MODULES) , $($(rtos)_OBJECTS)) \
$(foreach lib, $(LIBRARIES) $(LIBRARIES_L), $($(lib)_OBJECTS))
MAKEDIRTMP := $(shell searchFile include/acsMakefile)
ifneq ($(MAKEDIRTMP),\#error\#)
MAKEDIR := $(MAKEDIRTMP)/include
include $(MAKEDIR)/acsMakefile
endif
# TEST TARGETS
#TODO: unittest(2) discover pyunit
do_unit: all
@echo "running cpp unit tests"
../bin/unittest --gtest_output=xml:results/cppunittest.xml
do_pyunit:
@echo "running python unit tests"
python -m unittest pyunit
do_functional:
@echo "running python functional tests"
python -m unittest functional
do_external:
@echo "running python external tests"
python -m unittest external
clean_test:
rm -f results/*.xml
rm -f functional/*.pyc
rm -f pyunit/*.pyc
rm -f external/*.pyc
unit: do_unit
@echo " . . . 'unit' done"
pyunit: do_pyunit
@echo " . . . 'pyunit' done"
functional: do_functional
@echo " . . . 'functional' done"
external: do_external
@echo " . . . 'external' done"
# TARGETS
# -------
all: do_all
@echo " . . . 'all' done"
clean : clean_all clean_test
@echo " . . . clean done"
clean_dist : clean_all clean_dist_all clean_test
@echo " . . . clean_dist done"
man : do_man
@echo " . . . man page(s) done"
install : install_all
@echo " . . . installation done"
#include "gtest/gtest.h"
TEST(FakeTest, Success){
EXPECT_EQ(1, 1);
}
...@@ -281,6 +281,7 @@ MedMinorServoControl::reset() ...@@ -281,6 +281,7 @@ MedMinorServoControl::reset()
_commanded_status.enable = 0; _commanded_status.enable = 0;
_commanded_status.acknowledge = 0; _commanded_status.acknowledge = 0;
_send_commanded_status(true); _send_commanded_status(true);
//TODO: add a little wait time
CUSTOM_LOG(LM_FULL_INFO, CUSTOM_LOG(LM_FULL_INFO,
"MinorServo::MedMinorServoControl::reset", "MinorServo::MedMinorServoControl::reset",
(LM_DEBUG, "enable = 0")); (LM_DEBUG, "enable = 0"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment