Other operating systems and bare metal configurations

TestApe do not ship with a bare metal configuration, but it is possible to customize the use of the OS and standard C library by providing an alternative implementation, so that these dependencies can be replaced with handwritten equivalents.

All use of c lib functions are collected in linux_testape_ext.o and testape_messsages.o. These files can be removed from testape.a and replaced with your handcrafted equivalent, like it is shown below

ar d testape.a linux_testape_ext.o
ar d testape.a testape_messsages.o
ar r testape.a my_os.o

You need to fill my_os.c with the implementations of the functions listed in testape_ext.h and testape_customize.h.

If write a vnsprintf replacement, you should know that testape internally uses the following format specifiers %s %d %f %.8x %.3d %02x %04x %08x and %c.

To remove all file operations and reduce the footprint of the initialization code, it may be wise to customize the startup and hardwire it to a specific testcase. Just remove testape_init.o from testape.a like this

ar d testape.a testape_init.o

and implement whatever init function you need ( e.g. main ) in your test source code. You can call the desired test function where appropriate. The example below shows mytest being called from main, but you can call testmain or any other test from anywhere in your implementation.

  void main(void) {

You also need to control the behavior normally determined by the commandline options. You do that by providing the implementation listed in testape_init.h.

As the majority of the libc usage comes from the default init implementation a handcrafted main function in every test excutable will reduce requirements to a tiny c library to atoi, free, malloc, memcmp, memcpy, memset, strcat, strcmp, strcpy, strlen, strstr and vsnprintf

The package contains the sample my_os_sample.c the contains a sample implementation for all of the above. The commandline to use it and use to build sample26 looks like this

cp testape.a my_os_testape.a
gcc -c my_os_sample.c
ar d my_os_testape.a linux_testape_ext.o
ar d my_os_testape.a testape_messsages.o
ar d my_os_testape.a testape_init.o
ar r my_os_testape.a my_os_sample.o
testape gcc convert.c sample26.c my_os_testape.a



The latest headlines from Testape.com

TestApe Release 1171 available, Aug 20th 2014

It has been a long time since last official release and the list of bugfixes, features and supported platforms accumulating in the beta has grown substantially. I am happy to annouce that a new release is ready.


TestApe beta version available, Jul 21th 2014

New beta version is now available for download.


TestApe Release 880 available, Dec 3rd 2011

New is this release are support for floating point validations and function mocking. Also, MinGW has been added to the list of supported platforms.


Forum change, Mar 27th 2011

TestApe forum is now hosted on Proboards. Support questions can be posted here or send directly on email. Due to ...


TestApe beta release available, Sep 27th 2011

TestApe can now be used with MinGW GCC on windows. Also supported in this beta are floating point types in validations or when mocking functions


IPad update for WebTTY, May 15th 2011

A small fix for webtty scripts, to allow the usage from Apple IPads. Tab on textarea to bring up IPad keyboard - you may have to scroll webpage beneath keyboard, in order to actually see what you're typing.

TestApe Release 791 available, Apr 2nd 2010

This release contains a new flexible mocking system with default mocks automatically generated for unresolved functions. Installation packages are available for GCC/Linux, GCC/CygWin as well Visual Studio 2009/Windows XP or Vista.