Configure Test Code for Isolator++ Professional |
Top Previous Next |
Test Project Setup:
In your test code:
In the test code add before any standard header inclusion:
#define _GLIBCXX_USE_CXX11_ABI 0
Include 'Isolator.h':
#include "Isolator.h"
In your Makefile:
Compile:
ISOLATOR_INCDIR = /usr/include/typemock -I$(ISOLATOR_INCDIR)
Isolator++ Professional requires these compilation flags:
C_FLAGS := -w -O0 -g3 CXX_FLAGS := -w -O0 -g3
Link:
There are 2 options to link with Typemock library:
ISOLATOR_LIBDIR = /usr/lib64/typemock
Note: When linking with the static library, libisolator.so must be in LD_LIBRARY_PATH or use -rpath=/usr/lib64/typemock
ifdef SO LIBS += -L$(ISOLATOR_LIBDIR) -l:libisolator.so else LIBS += $(ISOLATOR_LIBDIR)/libisolator.a
Note: Link order might cause different results. Link Isolator++ Professional as first as possible.
Note: If you gcc version is greater then 6 you need to add the flag "-no-pie"
For example:
GCCVERSIONGTEQ6 := $(shell expr gcc -dumpversion | cut -f1 -d. \>= 6) ifeq "$(GCCVERSIONGTEQ6)" "1" NO_PIE := -no-pie endifLD_FLAGS = $(NO_PIE)
Run The Tests
Once everything is set, in order to run the tests, Isolator++ Professional requires setting environment variable LD_BIND_NOW to 1.
export LD_BIND_NOW=1 |
Copyright Typemock Ltd. 2009-2023. All Rights Reserved.