This FAQ includes setup, runtime issues, faking examples, and advanced topics like threading, linking, and CI/CD deployment.
Why don’t my fakes apply at runtime?
Checks to make first:
- Headers & libs: include the v5 headers and link the Isolator++ runtime (e.g.,
isolator5.handisolator.dll/isolator.so). - Symbols: build your tests with debug symbols so hooks can resolve (GCC/Clang:
-g, MSVC:/Zi+ PDBs). - Toolchain: use a supported compiler (GCC ≥ 5.4, Clang ≥ 10, MSVC 2015+), with C++11+.
- Runtime search paths: ensure the dynamic library is discoverable (
LD_LIBRARY_PATH). - Optimizations: very aggressive LTO/IPO can inline/remove targets; reduce these for test builds.
What does “Isolator++ is a runtime library” mean?
You link the Typemock runtime into your test binary; there is no separate “mocking exe”.
At runtime, Isolator++ intercepts function/method calls and applies your configured behaviors.
How do I fake a global/free function?
#include "isolator5.h"
int GlobalFunc();
TEST(Fakes, GlobalFunction_v5)
{
auto a = Isolator();
a.CallTo(::GlobalFunc).WillReturn(42);
EXPECT_EQ(42, GlobalFunc());
}How do I fake a static method?
auto a = Isolator();
a.CallTo(UserStore::Connect).WillReturn(true);How do I fake a member method for all instances vs a specific instance?
auto a = Isolator();
// All instances
auto futureHandle = a.Fake.All<Calculator>();
a.CallTo(futureHandle.Add(A::Any())).WillReturn(99);
// Specific object
Calculator c;
a.CallTo(c.Add(A::Any())).WillReturn(7);How do I control future constructor calls (objects created later)?
auto a = Isolator();
auto handle = a.Fake.All<Calculator>();
a.CallTo(handle.Add()).WillReturn(5);
RunProductionCode();How do I limit fakes to a scope (During filters)?
This is an Enterprise feature.
auto a = Isolator();
a.CallTo(::LookupUser()).During(
A::Call(DoExpensiveOperation)
).WillReturn("eli");Which C++ test frameworks can I use?
Google Test, Catch2, Boost.Test, CppUnit, and MSTest for C++ are supported.
How do I add Isolator++ to my build?
find_library(ISOLATOR_LIB isolator REQUIRED PATHS /opt/typemock/lib)
include_directories(/opt/typemock/include)
add_executable(mytests tests.cpp)
target_link_libraries(mytests PRIVATE ${ISOLATOR_LIB} pthread)Any special flags for Linux or Clang/GCC?
- Build with
-gfor symbols. - Disable LTO/IPO for test builds.
- Use
-fPICfor shared libs.
Will faking slow my suite?
Overhead is low.
Fake only what you need.
Disable logs and verbose/
Can I use coverage tools with Isolator++?
Yes — works with gcov, lcov, llvm-cov, and Windows coverage tools.
How do I run on CI and build agents?
Enterprise feature — configure license via:
IsolatorConfigurator [key] [license]or include in header.
How do I stub I/O, sockets, or file system access?
auto a = Isolator();
a.CallTo(::ReadFile).WillReturn(std::string{"mock-data"});How do I verify that a behavior occurred?
Use your test framework assertions or fake spies to verify calls.
auto a = Isolator();
auto fake = a.Fake.Instance<Calculator>();
// use fake...
// verify
a.CallTo(fake.Add(A::Eq(1))).VerifyWasCalled();Link isolator.lib or libisolator.so correctly.
Add library path using -L or Linker → Additional Library Directories.
Keep the Isolator() object alive while tests run. Avoid faking destructors directly.
Fakes apply to both; non-virtual fakes don’t require refactoring.
Ensure instantiations are visible; disable LTO for inline symbols.
Typemock Isolator++ is Thread-safe and fakes can be fakes across threads. to limit a fake to a single thead use
During(A::Thread(GetCurrentThreadId())));a.CallTo(&Service::Connect).WillThrow(std::runtime_error("fail"));int LegacyFunc(const char*);
auto a = Isolator();
a.CallTo(::LegacyFunc()).WillReturn(0);Use correct runtime for 32/64-bit; don’t mix. the 32bit libs are in /bin directory under the installation and the 64bit libs are in the /bin/64 diretory
use Configuration.exe --log_enable or on windows run the Configurator
for During use
IsolatorConfig::VerboseLoggingTypemock Isolator++ v5 enables you to:
- ✅ Mock any function, static, or method (virtual or not)
- ✅ Scope and verify calls with clean syntax
- ✅ Test legacy code on Windows and Linux
- ✅ Integrate into CI/CD securely
- ✅ Use AI-based suggestions via LLM API