Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions catkin_make_repo
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CI_MODULES=$DIR/modules
CI_MODULES="$DIR/modules"

# "Setup common functions and definitions and source current ROS"
source $CI_MODULES/common_definitions.sh
source "$CI_MODULES/common_definitions.sh"

export PATH=/usr/texbin/:/usr/lib/ccache:/usr/local/bin/:/usr/local/opt/ccache/libexec/:$PATH

Expand All @@ -23,7 +23,7 @@ if [ -n "$TERM" ] ; then
export TERM=xterm
fi

mkdir -p $WORKSPACE/devel/include
mkdir -p "$WORKSPACE/devel/include"

echo Checking whether we should run the tests...
if $RUN_TESTS; then
Expand All @@ -45,22 +45,22 @@ fi

if $RUN_TESTS; then
echo "*** sourcing the devel space"
source $WORKSPACE/devel/setup.bash
source "$WORKSPACE/devel/setup.bash"
# Clear out results from the requested packages.
TEST_RESULTS_FOLDER=$WORKSPACE/build/test_results
rm -rf $TEST_RESULTS_FOLDER
mkdir $TEST_RESULTS_FOLDER
TEST_RESULTS_FOLDER="$WORKSPACE/build/test_results"
rm -rf "$TEST_RESULTS_FOLDER"
mkdir "$TEST_RESULTS_FOLDER"

echo "*** building tests"
catkin build -w $WORKSPACE --verbose --no-deps --no-status $CATKIN_ARGS $PACKAGES --make-args tests $MAKE_ARGS --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-DALWAYS_ASSERT -DCMAKE_C_FLAGS=-DALWAYS_ASSERT
catkin build -w "$WORKSPACE" --verbose --no-deps --no-status $CATKIN_ARGS $PACKAGES --make-args tests $MAKE_ARGS --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-DALWAYS_ASSERT -DCMAKE_C_FLAGS=-DALWAYS_ASSERT

echo "*** running tests"
catkin run_tests -w $WORKSPACE --verbose --no-deps --no-status $CATKIN_ARGS $PACKAGES -j1
catkin run_tests -w "$WORKSPACE" --verbose --no-deps --no-status $CATKIN_ARGS $PACKAGES -j1

# Collect the results files
for PACKAGE in $PACKAGES
do
PACKAGE_TEST_RESULTS_FOLDER=$WORKSPACE/build/$PACKAGE/test_results/$PACKAGE
PACKAGE_TEST_RESULTS_FOLDER="$WORKSPACE/build/$PACKAGE/test_results/$PACKAGE"
if [ -d $PACKAGE_TEST_RESULTS_FOLDER ] ; then
echo "*** $PACKAGE -- Copy unit test results to common folder."
cp -r $PACKAGE_TEST_RESULTS_FOLDER $TEST_RESULTS_FOLDER/ || true
Expand All @@ -70,13 +70,13 @@ if $RUN_TESTS; then
done

# Clear / Create a directory in the workspace where we can store the test results.
TEST_RESULTS_DEST=$WORKSPACE/test_results/
rm -rf $TEST_RESULTS_DEST
mkdir -p $TEST_RESULTS_DEST
TEST_RESULTS_DEST="$WORKSPACE/test_results/"
rm -rf "$TEST_RESULTS_DEST"
mkdir -p "$TEST_RESULTS_DEST"

# Copy all test results from the currently build packages to the workspace folder.
echo "Copying test results from $TEST_RESULTS_FOLDER/$package to $TEST_RESULTS_DEST..."
cp -vr $TEST_RESULTS_FOLDER/* $TEST_RESULTS_DEST/ || true
cp -vr "$TEST_RESULTS_FOLDER/"* "$TEST_RESULTS_DEST/" || true
fi

exit 0
20 changes: 15 additions & 5 deletions modules/common_definitions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
if [ -z "$_COMMON_LOADED_" ]; then
_COMMON_LOADED_=true

ROS_VERSION=$(source $CI_MODULES/get_latest_ros_version.sh)
ROS_VERSION=$(source "$CI_MODULES/get_latest_ros_version.sh")

# Source current ROS
source /opt/ros/$ROS_VERSION/setup.sh
Expand All @@ -28,10 +28,20 @@ if [ -z "$_COMMON_LOADED_" ]; then
echo "WARNING: $@" >&2
}

WSTOOL_MERGE_REPLACE="wstool merge --confirm-all --merge-replace -t $WORKSPACE/$DEPS"
function wstoolMergeReplace () {
(
cd "$WORKSPACE" ## wstool has a bug concerning spaces in the -t arg
wstool merge --confirm-all --merge-replace -t "$DEPS" "$@"
)
}
WSTOOL_MERGE_REPLACE=wstoolMergeReplace

function wstoolUpdateReplace () {
wstool status -t $WORKSPACE/$DEPS
wstool update --delete-changed-uris -t $WORKSPACE/$DEPS -j1 "$@"
(
cd "$WORKSPACE" ## wstool has a bug concerning spaces in the -t arg
wstool status -t "$DEPS"
wstool update --delete-changed-uris -t "$DEPS" -j1 "$@"
)
}
WSTOOL_UPDATE_REPLACE="wstoolUpdateReplace"
WSTOOL_UPDATE_REPLACE=wstoolUpdateReplace
fi
4 changes: 2 additions & 2 deletions modules/prepare_wstool_workspace.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Make a separate workspace for the deps, so we can exclude them from cppcheck etc.
echo "Dependencies specified by rosinstall file.";
rm -f $WORKSPACE/$DEPS/.rosinstall || true # start fresh workspace so reduce double updates
wstool init $WORKSPACE/$DEPS || true
rm -f "$WORKSPACE/$DEPS/.rosinstall" || true # start fresh workspace so reduce double updates
wstool init "$WORKSPACE/$DEPS" || true


if $CHECKOUT_ASLAM_INSTALL; then
Expand Down
8 changes: 4 additions & 4 deletions modules/pull_auto_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e

source $CI_MODULES/common_definitions.sh
source "$CI_MODULES/common_definitions.sh"

DEP_FILE_NAME=dependencies.rosinstall
DEP_WORKSPACE_FILE=.rosinstall
Expand All @@ -14,13 +14,13 @@ if [[ ${#DEPS_FILES[@]} -eq 0 ]]; then
fi

CHECKOUT_ASLAM_INSTALL=false
source $CI_MODULES/prepare_wstool_workspace.sh
source "$CI_MODULES/prepare_wstool_workspace.sh"

while true; do
new_packages=()
for dep_file in "${DEPS_FILES[@]}"; do
echo "Processing dependency file $dep_file"
IFS=$'\n' np=($($CI_MODULES/rosinstall_diff.py $DEP_WORKSPACE_FILE $dep_file))
IFS=$'\n' np=($("$CI_MODULES/rosinstall_diff.py" $DEP_WORKSPACE_FILE $dep_file))
IFS="$normalIFS"
if [ -n "$np" ] ; then echo "Found new packages: ${np[@]}."; fi
new_packages+=("${np[@]}")
Expand All @@ -36,7 +36,7 @@ done

unset new_packages

IFS=$'\n' all_superfluous_local_names=($($CI_MODULES/rosinstall_diff.py $DEP_WORKSPACE_FILE ${WORKSPACE}/$DEPS/))
IFS=$'\n' all_superfluous_local_names=($("$CI_MODULES/rosinstall_diff.py" $DEP_WORKSPACE_FILE ${WORKSPACE}/$DEPS/))
IFS="$normalIFS"

if [ -n "$all_superfluous_local_names" ]; then
Expand Down
22 changes: 11 additions & 11 deletions rosmake_repo
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CI_MODULES=$DIR/modules
CI_MODULES="$DIR/modules"

# "Setup common functions and definitions and source current ROS"
source $CI_MODULES/common_definitions.sh
source "$CI_MODULES/common_definitions.sh"

export PATH=/usr/lib/ccache:$PATH

Expand All @@ -18,8 +18,8 @@ else
fi


cd $WORKSPACE
export ROS_WS=$WORKSPACE/ros_ws
cd "$WORKSPACE"
export ROS_WS="$WORKSPACE/ros_ws"
rm -rf $ROS_WS
mkdir -p $ROS_WS

Expand All @@ -40,7 +40,7 @@ do
rosws set ../$package -y
fi
fi
cd $WORKSPACE
cd "$WORKSPACE"
done
source $ROS_WS/setup.bash
source $ROS_WS/setup.sh
Expand All @@ -60,21 +60,21 @@ if $RUN_TESTS; then
for package in ${PACKAGES}
do
echo "Clearing test results in $TEST_RESULTS_FOLDER/$package ..."
rm -rf $TEST_RESULTS_FOLDER/$package
rm -rf "$TEST_RESULTS_FOLDER/$package"
done
# Run the tests. Don't fail if the tests fail, we will parse their results later.
rosmake ${PACKAGES} -Vk --test-only

# Clear / Create a directory in the workspace where we can store the test results.
TEST_RESULTS_DEST=$WORKSPACE/test_results/
rm -rf $TEST_RESULTS_DEST
mkdir -p $TEST_RESULTS_DEST
TEST_RESULTS_DEST="$WORKSPACE/test_results/"
rm -rf "$TEST_RESULTS_DEST"
mkdir -p "$TEST_RESULTS_DEST"
for package in ${PACKAGES}
do
# Copy all test results from the currently build packages to the workspace folder.
echo "Copying test results from $TEST_RESULTS_FOLDER/$package to $TEST_RESULTS_DEST..."
mkdir -p $TEST_RESULTS_DEST/$package/
mkdir -p "$TEST_RESULTS_DEST/$package/"
# Only copy rosunit xml files.
cp -r $TEST_RESULTS_FOLDER/$package/rosunit* $TEST_RESULTS_DEST/$package/ || true
cp -r "$TEST_RESULTS_FOLDER/$package/rosunit"* "$TEST_RESULTS_DEST/$package/" || true
done
fi
6 changes: 3 additions & 3 deletions run_build.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash -e
## This script does nothing but update the local repo and then forward everything
## to the actual build script which by this time is updated from the remote.
CWD=$(pwd)
CWD="$(pwd)"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Reload ci scripts from repo.
cd $DIR
cd "$DIR"
git checkout master
git pull
cd $CWD
cd "$CWD"

# Now run actual script.
$DIR/run_build_impl.sh "$@"
6 changes: 3 additions & 3 deletions run_build_catkin_or_rosbuild
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd $WORKSPACE/src
cd "$WORKSPACE/src"
if [ -e "manifest.xml" ] || [ -e "stack.xml" ]; then
echo "#### Found a rosmake repo"
$DIR/rosmake_repo $@
"$DIR/rosmake_repo" $@
else
echo "#### Found a catkin repo"
cd $WORKSPACE
$DIR/catkin_make_repo $@
"$DIR/catkin_make_repo" $@
fi
32 changes: 16 additions & 16 deletions run_build_impl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ export PATH=/usr/local/bin/:$PATH

# Get the directory of this script.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export CI_MODULES=$DIR/modules
export CI_MODULES="$DIR/modules"

# "Setup common functions and definitions and source current ROS"
source $CI_MODULES/common_definitions.sh
source "$CI_MODULES/common_definitions.sh"

PACKAGE="--all"
DEPENDENCIES=""
Expand Down Expand Up @@ -73,10 +73,10 @@ esac
done

# run sanity checks:
source $CI_MODULES/sanity_checks.sh
source "$CI_MODULES/sanity_checks.sh"

# Find workspace
cd $WORKSPACE
cd "$WORKSPACE"
echo "-----------------------------"
# Locate the main folder everything is checked out into.
REP=$(find . -maxdepth 3 -type d -name .git -a \( -path "./$DEPS/*" -prune -o -path "./test_repos/*" -prune -o -print -quit \) )
Expand Down Expand Up @@ -175,20 +175,20 @@ echo "Initialize workspace:"
echo "-----------------------------"
source /opt/ros/$ROS_VERSION/setup.sh

cd $WORKSPACE/
mkdir -vp $WORKSPACE/src
cd "$WORKSPACE/"
mkdir -vp "$WORKSPACE/src"
catkin init
echo "-----------------------------"

echo "Pull dependencies:"
echo "-----------------------------"
mkdir -vp $WORKSPACE/$DEPS
cd $WORKSPACE/$DEPS
mkdir -vp "$WORKSPACE/$DEPS"
cd "$WORKSPACE/$DEPS"

if [[ $DEPENDENCIES == *.rosinstall ]]
then
CHECKOUT_ASLAM_INSTALL=true
source $CI_MODULES/prepare_wstool_workspace.sh
source "$CI_MODULES/prepare_wstool_workspace.sh"

for dep in $DEPENDENCIES; do
# Remove the entry from the provided rosinstall that specifies this repository itself (if any).
Expand All @@ -212,17 +212,17 @@ then

elif [ "$DEPENDENCIES" == "AUTO" ]; then
echo "Performing AUTO dependency discovery:";
$CI_MODULES/pull_auto_dependencies.sh
"$CI_MODULES/pull_auto_dependencies.sh"
else
if $CHECKOUT_CATKIN_SIMPLE; then
DEPENDENCIES="${DEPENDENCIES} ${CATKIN_SIMPLE_URL}"
fi

for dependency_w_branch in ${DEPENDENCIES}
do
cd $WORKSPACE/$DEPS
cd "$WORKSPACE/$DEPS"

source $CI_MODULES/parse_dependency.sh
source "$CI_MODULES/parse_dependency.sh"

if [ -d $foldername ]; then
echo "Package $foldername exists, running: git fetch $depth_args && git checkout ${revision} && git submodule update --recursive"
Expand All @@ -242,12 +242,12 @@ echo "-----------------------------"
if [[ -n "$PREPARE_SCRIPT" ]]; then
echo "Run prepare script:"
echo "-----------------------------"
cd $WORKSPACE
cd "$WORKSPACE"

function runPrepareScript() {
export DEBIAN_FRONTEND=noninteractive
echo "Running $PREPARE_SCRIPT in $WORKSPACE:";
bash -ex $PREPARE_SCRIPT
bash -ex "$PREPARE_SCRIPT"
echo "Successfully run $PREPARE_SCRIPT.";
}

Expand All @@ -273,7 +273,7 @@ fi

echo "Build workspace:"
echo "-----------------------------"
cd $WORKSPACE
cd "$WORKSPACE"

# Prepare cppcheck ignore list. We want to skip dependencies.
CPPCHECK_PARAMS="src --xml --enable=missingInclude,performance,style,portability,information -j8 -ibuild -i$DEPS"
Expand Down Expand Up @@ -327,7 +327,7 @@ if $DIR/run_build_catkin_or_rosbuild ${RUN_TESTS} ${PACKAGES}; then
if [[ "$unamestr" == 'Linux' ]]; then
echo "Running cppcheck $CPPCHECK_PARAMS ..."
# Run cppcheck excluding dependencies.
cd $WORKSPACE
cd "$WORKSPACE"
if $RUN_CPPCHECK; then
rm -f cppcheck-result.xml
cppcheck $CPPCHECK_PARAMS 2> cppcheck-result.xml
Expand Down