SIListra Unit Testing Library

Reuse your GoogleTest tests for the encoded channel: the SIListra Unit Testing Library can be fully encoded with the SIListra Safety Transformer and reports the results of both channels in one run.

  • Compatible with common GoogleTest features
  • Supports all features of the SIListra Safety Transformer
  • Results for both channels in one run
  • CMake / CTest integration
GoogleTest-compatible CMake / CTest

Testing the Encoded Channel

The encoded channel needs testing just like the native channel. Since both channels are functionally equivalent, the simplest way is to encode the native-channel tests themselves with the SIListra Safety Transformer – the result is a set of additional tests that check the encoded channel in the same way.

Off-the-shelf test frameworks cannot be fully encoded with the SIListra Safety Transformer, because they use features it does not support. The SIListra Unit Testing Library solves this by encapsulating the unsupported features in a plain C API, on top of which it provides compatibility with existing frameworks. GoogleTest tests that use the supported feature set can be encoded and run against the encoded channel without changing the test code.

One Test Binary, Both Channels

The SIListra Safety Transformer encodes your source code and your tests. The compiler and linker of your choice build the test binary from both channels, with the SIListra Unit Testing Library linked statically. Running it yields a test report for the native and the encoded channel.

1. Native Code & Tests
Your source code and its existing unit tests
➔
2. SIListra Safety Transformer
Encodes your source code and tests
➔
3. Your Compiler & Linker
Builds both channels, SIListra Unit Testing Library linked statically
➔
4. Test Binary
Test report for the native and the encoded channel

The SIListra Unit Testing Library also works with the library feature of the SIListra Safety Transformer: the native and encoded channel are compiled into a static library, and the native and encoded tests are linked against it together with the SIListra Unit Testing Library – so the binary code of the static library itself is what gets tested.

Familiar Tests, Built for Safety

Compatibility

GoogleTest-Compatible

Supports the most commonly used GoogleTest features, so existing tests that use the supported feature set run unchanged with the SIListra Unit Testing Library.
Build

Native CMake Integration

Integrates natively into your CMake build: CTest discovers your tests automatically, and one test run covers the native and the encoded channel.
Development

Built for Safety

Developed with safety-critical practices in mind and shipped with an extensive test suite that verifies the framework itself.
Details

What the SIListra Unit Testing Library Supports

  • Tests with TEST, fixtures with SetUp and TearDown via TEST_F
  • ASSERT_* and EXPECT_* for EQ, NE, LT, LE, GT, GE, TRUE and FALSE
  • IEEE 754 floating-point and C-string comparisons
  • Subset of the CUnit API; compatibility with other frameworks on request
  • Shows which channel a test runs on; tests can be excluded from the native or the encoded channel
  • Detailed test output and an xUnit-like XML report
  • Supports all features of the SIListra Safety Transformer
  • Documentation and tutorials included
Example

Runs With the SIListra Unit Testing Library and GoogleTest

/* A small adder function to test. */
static int lib_add(int a, int b) { return a + b; }

TEST(TestBasic, BasicAsserts) {
    EXPECT_EQ(true, true);
    EXPECT_GT(78, 77);

    /* ASSERT_* stops the test on failure,
       EXPECT_* continues with the next check. */
    ASSERT_EQ(lib_add(3, 3), 6);

    ASSERT_TRUE(lib_add(1, 1) == 2);
    ASSERT_FALSE(lib_add(2, 2) == 5);
}

Testing the Encoded Channel in Your Project?

Talk to us about the SIListra Unit Testing Library and your existing tests – non-binding and confidential.

Start Evaluation
Follow us on: