Unverified Commit 3d1b17b2 authored by Guilhem Saurel's avatar Guilhem Saurel Committed by GitHub
Browse files

Merge pull request #2 from nim65s/master

[CI] add .gitlab-ci.yml, but fix tests first, but clean cmake first.
parents 3101ed41 05d40b0a
Pipeline #3327 passed with stage
in 9 minutes and 59 seconds
variables:
GIT_SUBMODULE_STRATEGY: "recursive"
GIT_DEPTH: "3"
CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
cache:
paths:
- ccache
.robotpkg-py-dynamic-graph-tutorial: &robotpkg-py-dynamic-graph-tutorial
except:
- gh-pages
script:
- mkdir -p ccache
- cd /root/robotpkg/wip/py-dynamic-graph-tutorial
- git pull
- make checkout MASTER_REPOSITORY="dir ${CI_PROJECT_DIR}"
- make install
- cd work.$(hostname)/$(make show-var VARNAME=DISTNAME)
- make test
robotpkg-py-dynamic-graph-tutorial-14.04-release:
<<: *robotpkg-py-dynamic-graph-tutorial
image: eur0c.laas.fr:5000/stack-of-tasks/dynamic-graph-tutorial/py-dynamic-graph-tutorial:14.04
robotpkg-py-dynamic-graph-tutorial-16.04-release:
<<: *robotpkg-py-dynamic-graph-tutorial
image: eur0c.laas.fr:5000/stack-of-tasks/dynamic-graph-tutorial/py-dynamic-graph-tutorial:16.04
robotpkg-py-dynamic-graph-tutorial-18.04-release:
<<: *robotpkg-py-dynamic-graph-tutorial
image: eur0c.laas.fr:5000/stack-of-tasks/dynamic-graph-tutorial/py-dynamic-graph-tutorial:18.04
doc-coverage:
<<: *robotpkg-py-dynamic-graph-tutorial
image: eur0c.laas.fr:5000/stack-of-tasks/dynamic-graph-tutorial/py-dynamic-graph-tutorial:16.04
before_script:
- echo -e 'CXXFLAGS+= --coverage\nLDFLAGS+= --coverage\nPKG_DEFAULT_OPTIONS= debug' >> /opt/openrobots/etc/robotpkg.conf
after_script:
- cd /root/robotpkg/wip/py-dynamic-graph-tutorial
- cd work.$(hostname)/$(make show-var VARNAME=DISTNAME)
- make doc
- mv doc/doxygen-html ${CI_PROJECT_DIR}
- mkdir -p ${CI_PROJECT_DIR}/coverage/
- gcovr -r .
- gcovr -r . --html --html-details -o ${CI_PROJECT_DIR}/coverage/index.html
artifacts:
expire_in: 1 day
paths:
- doxygen-html/
- coverage/
#
# Copyright 2010 CNRS
# Copyright 2010, 2018 CNRS
# Author: Florent Lamiraux
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET (CXX_DISABLE_WERROR ON)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/lapack.cmake)
INCLUDE(cmake/cpack.cmake)
INCLUDE(cmake/test.cmake)
INCLUDE(cmake/python.cmake)
SET(PROJECT_NAME dynamic-graph-tutorial)
project(${PROJECT_NAME})
SET(PROJECT_DESCRIPTION "Tutorial for dynamic-graph")
SET(PROJECT_URL "http://github.com/jrl-umi3218/dynamic-graph-tutorial")
SET(${PROJECT_NAME}_HEADERS
include/dynamic-graph/tutorial/inverted-pendulum.hh
include/dynamic-graph/tutorial/feedback-controller.hh
)
#
# Look for dependencies
#
SET(PROJECT_URL "http://github.com/stack-of-tasks/${PROJECT_NAME}")
SETUP_PROJECT()
#
# Documentation dependency to package dynamic-graph
#
ADD_REQUIRED_DEPENDENCY("dynamic-graph")
#
# Dependency to package dynamic-graph-python
#
ADD_REQUIRED_DEPENDENCY("dynamic-graph-python")
SET(BOOST_COMPONENTS unit_test_framework)
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
IF(BUILD_PYTHON_INTERFACE)
ADD_REQUIRED_DEPENDENCY("dynamic-graph-python")
FINDPYTHON()
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
ENDIF(BUILD_PYTHON_INTERFACE)
SEARCH_FOR_BOOST()
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
ADD_SUBDIRECTORY(include/dynamic-graph/tutorial)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(tests)
SETUP_PROJECT_FINALIZE()
#
# Copyright (c)
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Write in this file the modifications you commit.
#
# Copyright
#
Installation instructions for library dg-tutorial
----------------------------------------------
It is recommended to create a specific directory to install this package.
mkdir build
cd build
cmake [Options] ..
make
make install
Options:
-DCMAKE_INSTALL_PREFIX=...
specifies the directory where to install the package.
-DCMAKE_BUILD_TYPE=[none|debug|release|relwithdebinfo|MinSizeRel]
specifies to type of compilation (release, debug, ...)
Write in this file the news related to package dg-tutorial.
[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)
# dynamic-graph-tutorial
[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)
[![Building Status](https://travis-ci.org/stack-of-tasks/dynamic-graph-tutorial.svg?branch=master)](https://travis-ci.org/stack-of-tasks/dynamic-graph-tutorial)
[![Pipeline status](https://gepgitlab.laas.fr/stack-of-tasks/dynamic-graph-tutorial/badges/master/pipeline.svg)](https://gepgitlab.laas.fr/stack-of-tasks/dynamic-graph-tutorial/commits/master)
[![Coverage report](https://gepgitlab.laas.fr/stack-of-tasks/dynamic-graph-tutorial/badges/master/coverage.svg?job=doc-coverage)](http://projects.laas.fr/stack-of-tasks/doc/stack-of-tasks/dynamic-graph-tutorial/master/coverage/)
See INSTALL for installation instruction.
The documentation is available here:
[http://stack-of-tasks.github.io/dynamic-graph-tutorial/](http://stack-of-tasks.github.io/dynamic-graph-tutorial/)
\ No newline at end of file
[http://stack-of-tasks.github.io/dynamic-graph-tutorial/](http://stack-of-tasks.github.io/dynamic-graph-tutorial/)
echo ""
echo "This package is installed through cmake. Please read INSTALL for instructions."
echo ""
prefix=${CMAKE_INSTALL_PREFIX}
exec_prefix=${install_pkg_prefix}
libdir=${install_pkg_exec_prefix}/lib
includedir=${install_pkg_prefix}/include
datarootdir=${install_pkg_prefix}/share
docdir=${install_pkg_datarootdir}/doc/${PROJECT_NAME}
Name: ${PROJECT_NAME}
Description:
Version: ${PROJECT_VERSION}
Requires: ${PACKAGE_REQUIREMENTS}
Libs: ${LIBDIR_KW}${install_pkg_libdir} ${${PROJECT_NAME}_LDFLAGS}
Cflags: -I${install_pkg_include_dir} ${${PROJECT_NAME}_CXXFLAGS}
SET(${PROJECT_NAME}_HEADERS}
inverted-pendulum.hh
feedback-controller.hh
)
INSTALL(FILES
${${PROJECT_NAME}_HEADERS}
DESTINATION include/${PROJECT_NAME}
)
# Copyright 2010, Florent Lamiraux, CNRS
# Copyright 2010, 2018, Florent Lamiraux, CNRS
#
# This file is part of sot-core.
# sot-core is free software: you can redistribute it and/or
......@@ -13,33 +13,23 @@
# received a copy of the GNU Lesser General Public License along with
# dynamic-graph-tutorial. If not, see <http://www.gnu.org/licenses/>.
# Libraries DEFINITIONS and INCLUDES
INCLUDE(../cmake/python.cmake)
SET(LIBRARY_NAME ${PROJECT_NAME})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
# provide path to dependency libraries
LINK_DIRECTORIES(${DYNAMIC_GRAPH_PYTHON_LIBRARY_DIRS} ${PYTHON_LIBRARY_DIRS})
ADD_LIBRARY(${LIBRARY_NAME}
SHARED
inverted-pendulum.cc
feedback-controller.cc
SET(${PROJECT_NAME}_SOURCES
inverted-pendulum
feedback-controller
)
SET_TARGET_PROPERTIES(${LIBRARY_NAME}
PROPERTIES
SOVERSION ${PROJECT_VERSION}
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
SET(${PY_NAME}_PYTHON
simu.py
)
# Add dynamic-graph-python compilation flags and link to dependency libraries
PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} dynamic-graph-python)
ADD_LIBRARY(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES})
PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} dynamic-graph)
INSTALL(TARGETS ${LIBRARY_NAME}
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
IF(BUILD_PYTHON_INTERFACE)
PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} dynamic-graph-python)
DYNAMIC_GRAPH_PYTHON_MODULE("tutorial" ${PROJECT_NAME} wrap)
INSTALL(FILES ${${PY_NAME}_PYTHON} DESTINATION "${PYTHON_SITELIB}/dynamic-graph/tutorial/")
ENDIF(BUILD_PYTHON_INTERFACE)
# Create a python module containing new Python entity classes
DYNAMIC_GRAPH_PYTHON_MODULE("tutorial" ${LIBRARY_NAME} wrap)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
ADD_UNIT_TEST(pendulum pendulum)
TARGET_LINK_LIBRARIES(pendulum ${PROJECT_NAME} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
PKG_CONFIG_USE_DEPENDENCY(pendulum dynamic-graph)
ADD_UNIT_TEST(controller controller)
TARGET_LINK_LIBRARIES(controller ${PROJECT_NAME} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
PKG_CONFIG_USE_DEPENDENCY(controller dynamic-graph)
#include <boost/test/unit_test.hpp>
#include "dynamic-graph/tutorial/feedback-controller.hh"
BOOST_AUTO_TEST_SUITE ( BOOST_TEST_MODULE )
BOOST_AUTO_TEST_CASE(test_controller)
{
dynamicgraph::tutorial::FeedbackController controller("test controller");
}
BOOST_AUTO_TEST_SUITE_END()
#include <boost/test/unit_test.hpp>
#include "dynamic-graph/tutorial/inverted-pendulum.hh"
BOOST_AUTO_TEST_SUITE ( BOOST_TEST_MODULE )
BOOST_AUTO_TEST_CASE(test_pendulum)
{
dynamicgraph::tutorial::InvertedPendulum pendulum("test pendulum");
pendulum.setCartMass(1.2);
BOOST_CHECK(pendulum.getCartMass() == 1.2);
pendulum.setPendulumMass(0.6);
BOOST_CHECK(pendulum.getPendulumMass() == 0.6);
pendulum.setPendulumLength(1.8);
BOOST_CHECK(pendulum.getPendulumLength() == 1.8);
}
BOOST_AUTO_TEST_SUITE_END()
#
# Copyright
#
SET(EXECUTABLE_NAME test${PROJECT_NAME})
ADD_DEFINITIONS(-DDEBUG=2)
# provide path to dependency libraries
LINK_DIRECTORIES(${DYNAMIC_GRAPH_PYTHON_LIBRARY_DIRS})
ADD_EXECUTABLE(${EXECUTABLE_NAME}
main.cc
dg-tutorial-test.cc)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
LINK_DIRECTORIES(${${PROJECT_NAME}_BINARY_DIR}/src)
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME}
dg-tutorial)
# Add dependency compilation flags and link to dependency libraries
ADD_DEFINITIONS(${DYNAMIC_GRAPH_PYTHON_CFLAGS})
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} ${DYNAMIC_GRAPH_PYTHON_LIBRARIES})
/*
* Copyright
*/
#include "dg-tutorial-test.hh"
int main (int argc, char** argv)
{
TutorialTest testTutorial();
}
/*
* Copyright
*/
#include <iostream>
#include "dg-tutorial-test.hh"
TutorialTest::TutorialTest()
{
std::cout << "Constructor of unitTesting object of class Tutorial." << std::endl;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment