Unit Integration Framework for B&R Automation Studio (GoogleTest-style test workflow)

Hello Community,

I would like to share a Unit Integration Framework project for B&R Automation Studio that helps build, execute, and visualize PLC unit/integration tests with a workflow similar to GoogleTest.

General information

What it is
A reusable test framework for Automation Studio projects that combines:

  • GoogleTest-like assertions/macros (AWAIT, EXPECT, ASSERT)

  • Auto-generation support for Unit Test setup from C test sources

  • XML report generation (with XSL styling for browser-friendly viewing)

  • mappView-based UI to run tests in Group or Single mode

Why this project
In many projects, setting up repeatable PLC tests is fragmented (manual setup, inconsistent asserts, no unified report view). This framework provides one consistent structure for:

  • authoring tests,

  • running them from runtime or visualization,

  • collecting readable reports for teams.

Main features

  • AutoGenerate workflow: optional pre-build PowerShell generation or manual batch trigger

  • Rich assert set: boolean, integer signed/unsigned, REAL/LREAL, STRING/WSTRING, NEAR/tolerance variants

  • Async test handling: AWAIT_* with configurable timeout and abort behavior

  • Structured test lifecycle: TEST_SET, TEST_CASE, setup/teardown hooks

  • Report pipeline: XML output + style.xsl formatting for browser viewing

  • mappView dashboard: run configured suites sequentially, run single tests, monitor status and statistics

Quick start

  1. Add tests using TEST_SET / TEST_CASE and assertion macros.

  2. Enable auto-generation in pre-build, or run generation manually when needed.

  3. Configure report FileDevice and keep style.xsl next to generated XML.

  4. Run tests from mappView (GroupUIT/SingleUIT) or project flow.

  5. Open report XML in Chrome (with file-access option enabled) for formatted results.

Example use cases

  • Regression checks for cyclic logic changes

  • Interface validation for function blocks with setup/teardown dependencies

  • CI-ready report artifacts (XML) for traceable pass/fail history

Downloads and links

View of test report in Google Chrome

6 Likes

Hi @umraniab, thanks for sharing :slight_smile: