running continuous integration tests in an automated way · • using cmake with iar embedded...

18
Running continuous integration tests in an automated way Micael Borgefeldt, Product manager

Upload: others

Post on 13-Mar-2020

40 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

Running continuous integration tests in an automated way

Micael Borgefeldt, Product manager

Page 2: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

Agenda

• Introduction to Continuous integration (CI) • Using IAR command line tools • Using CMake with IAR Embedded Workbench

Page 3: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

Continuous integration

Page 4: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

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

Page 5: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

The command-line tools

Page 6: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

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

Page 7: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

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

Page 8: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

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]

Page 9: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

Demonstration

Page 10: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

CMake

Page 11: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

• 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

Page 12: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

• 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

Page 13: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

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).

Page 14: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

CMake example IAR Embedded Workbench for ARM toolchain-ewarm.cmake - file specifying the (cross) compiler toolchain with its file paths

Page 15: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

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

Page 16: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

Demonstration

Page 17: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

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

Page 18: Running continuous integration tests in an automated way · • Using CMake with IAR Embedded Workbench . Continuous integration . Continuous Integration (CI) • CI is the process

• 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!