75 lines
No EOL
2.4 KiB
Bash
75 lines
No EOL
2.4 KiB
Bash
#//========================================================================
|
|
#// Copyright (c) Technische Software Entwicklung Plazotta © 2021
|
|
#//
|
|
#// DESCRIPTION:
|
|
#// Shell Script to Build a cmake project under linux, running the Unittest and finally start teh install step
|
|
#//
|
|
#// HISTORY:
|
|
#// 09.04.2021 / PP
|
|
#// Module created.
|
|
#//========================================================================
|
|
#!/bin/bash
|
|
#
|
|
#=======================================================================
|
|
# Check Parameter
|
|
#=======================================================================
|
|
if [ -z "$1" ]
|
|
then
|
|
echo "usage: BuildLinuxProject [ProjectName] [Configuration] [UnitTestExe]"
|
|
exit 2
|
|
fi
|
|
if [ -z "$2" ]
|
|
then
|
|
echo "usage: BuildLinuxProject [ProjectName] [Configuration] [UnitTestExe]"
|
|
exit 2
|
|
fi
|
|
if [ -z "$3" ]
|
|
then
|
|
echo "usage: BuildLinuxProject [ProjectName] [Configuration] [UnitTestExe]"
|
|
exit 2
|
|
fi
|
|
#=======================================================================
|
|
# Show Parameter
|
|
#=======================================================================
|
|
echo "======================================================================="
|
|
echo " Build Parameter"
|
|
echo "======================================================================="
|
|
echo " Project = $1"
|
|
echo " Configuration = $2"
|
|
echo " Unit Test Executable = $3"
|
|
echo "======================================================================="
|
|
echo "."
|
|
#=======================================================================
|
|
# parse unit test s
|
|
#=======================================================================
|
|
IFS=','
|
|
read -rasplitIFS<<< "$3"
|
|
#=======================================================================
|
|
# Start build
|
|
#=======================================================================
|
|
cd ../../BuildResults_linux_$2
|
|
#- MAKE ALL ------------------------------------------------------------
|
|
make all
|
|
if [ $? -ne 0 ]; then
|
|
echo "Build error ..."
|
|
exit 1
|
|
fi
|
|
#- UNIT Test -----------------------------------------------------------
|
|
cd bin
|
|
for unittests in "${splitIFS[@]}"; do
|
|
|
|
echo tsep | sudo -S ./../../AutoBuild/linux/scripts/RunUnitTest.sh $unittests
|
|
if [ $? -ne 0 ]; then
|
|
echo "Error during Unit test ..."
|
|
exit 1
|
|
fi
|
|
done
|
|
cd ..
|
|
#- Install -------------------------------------------------------------
|
|
make install
|
|
if [ $? -ne 0 ]; then
|
|
echo "Error during INSTALL ..."
|
|
exit 1
|
|
fi
|
|
#
|
|
exit 0 |