running continuous integration tests in an automated way · • using cmake with iar embedded...
TRANSCRIPT
Running continuous integration tests in an automated way
Micael Borgefeldt, Product manager
Agenda
• Introduction to Continuous integration (CI) • Using IAR command line tools • Using CMake with IAR Embedded Workbench
Continuous integration
Continuous Integration (CI) • CI is the process of automating build and test
of code every time a team member commits changes to version control
• Primary goal is to prevent integration problems improve quality shorten delivery time
• CI tools are available as open source as well as commercial. Examples: Jenkins, Team Foundation Server, Travis, Bamboo, etc
• A good CI tool is agnostic to the underlying command line tools
Code
Commit
Build Test
Notify
The command-line tools
Iarbuild.exe – to build an IAR Embedded Workbench project
• Compiling and linking using the project file as input (.ewp) • Useful when you want to automate repetitive building • Possibility to perform static analysis with C-STAT • Supports parallel compiling (multi-core PC’s) • Supports multiple configurations (Debug, Release, etc)
– Wildcard (*) support - useful for CI tools to build all configurations
Syntax: iarbuild my_project.ewp [options] my_config
Custom argument variables Useful for:
– simplifying references to files e.g. produced by a 3rd party tool
– Setting project and compiler independent defined symbols
– Workspace or global scope
• Example: $MY_INCLUDE_PATH$ • Stored in xml, possible to edit also
from the command line
Cspybat.exe – to execute an application in the C-SPY Debugger
• Useful for automated application testing • Works with simulated hosts (instruction set simulator) as well as
embedded hardware (development boards) • Terminal output support
– Possibility for a test engine to check for expected output on stdout • C-SPY macro support – powerful scripting language with file I/O
support, add/remove breakpoints, memory and register read/write, etc.
Syntax:
cspybat processor_DLL driver_DLL debug_file [cspybat_options]
Demonstration
CMake
• Open-source, cross-platform family of tools designed to build, test and package software.
• Controls the software compilation process using platform and compiler independent configuration files
• Generates native makefiles and workspaces. Examples: – NMake makefiles – UNIX makefiles – Ninja build system – Visual Studio – Eclipse – Xcode
• Currently supports IAR Embedded Workbench for ARM and AVR
• Straight-forward to add support also for other IAR compilers
• Possibility to contribute to: https://github.com/Kitware/CMake
CMake example IAR Embedded Workbench for ARM CMakeLists.txt - file containing directives and instructions describing the project's source files and targets (executable, library or both).
CMake example IAR Embedded Workbench for ARM toolchain-ewarm.cmake - file specifying the (cross) compiler toolchain with its file paths
CMake example IAR Embedded Workbench for ARM
The building steps: 1) Run CMake to generate an NMake makefile
2) Run NMake to build the executable
cmake -H. -Bbuild -G "NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain-ewarm.cmake
Nmake Makefile
Demonstration
Summary • IAR Embedded Workbench has powerful command line
tools for building as well as for debugging embedded applications – well suited for use with CI systems – supported by CMake
• CI + CMake + IAR command line tools enables a compiler agnostic system for automated building and testing
• Get scanned to have this presentation emailed to you.
• Visit IAR Demo Space to get a demo of our technology.
Want to learn more?
Thank you for your attention!