Cloudops fundamentals management, tdd, test driven design, continuous integration, CI
Running continuous integration tests in an automated way · • Using CMake with IAR Embedded...
Transcript of Running continuous integration tests in an automated way · • Using CMake with IAR Embedded...
![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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/1.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/2.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/3.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/4.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/5.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/6.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/7.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/8.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/9.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/10.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/11.jpg)
• 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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/12.jpg)
• 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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/13.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/14.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/15.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/16.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/17.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022040102/5e6e74db678e7473613b30e6/html5/thumbnails/18.jpg)
• 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!