Quickstart: Add C++ Agent to AUT
Quickstart: Adding the C++ Agent to an Application
This page is meant as a quick reference only. You can find important details for each of these steps at Coverage Listener Mode (Application Under Test)
C++ Agent Configuration and BSID Generation
Base Command: ./SL.Agent.Cpp config [options]
Example Configurations:
Example 1: Using parameters as CLI flags
./SL.Agent.Cpp config \
--token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
--appName="shopping-cart-service" \
--branchName="feature-checkout" \
--buildName="v1.2.3-build-456" \
--labId="shoppingcart.dev.qa-blue" \
--include="<source_folder_path>"Example 2: Using environment variables
export SL_APPNAME="shopping-cart-service"
export SL_BRANCHNAME="feature-checkout"
export SL_BUILDNAME="v1.2.3-build-456"
export SL_LABID="shoppingcart.dev.qa-blue"
export SL_INCLUDE="<source_folder_path>"
./SL.Agent.Cpp configExample 3: Using settings.json configuration file
{
"general": {
"command": "run",
"appName": "shopping-cart-service",
"branchName": "feature-checkout",
"buildName": "v1.2.3-build-456"
},
"session":{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"LabId": "shoppingcart.dev.qa-blue"
},
"scan": {
"binDir": "bin",
"include": [
"src/*.cpp,include/*.h,main.cpp"
]
}
}Scan and Instrument the Application Code
Base Command: ./SL.Agent.Cpp scan
Minimum Required Parameters for this command:
--tokenor--tokenFile- Your SeaLights authentication token or path to token file--buildSessionIdFile- Path to thebuildSessionId.txtfile generated by the./SL.Agent.Cpp configcommand--binDir- Path to the directory with.gcnofiles generated during compilation--include- Comma-separated list of files or patterns to include for scanning. Examples,--include="src/*.cpp,include/*.h,main.cpp"and--inlude="*Core.cpp,mySrc.c??,Api*Client.cpp"
Deploy the Instrumented Application Code
Base Command: LD_PRELOAD=<path_to_cpp_agent>/<corresponding_tracer_library> ./<your_application>
Linux x86-64
libSL.Cpp.TracerLib.Linux_x64.so
Linux x86
libSL.Cpp.TracerLib.Linux_x86.so
Linux ARMv7
libSL.Cpp.TracerLib.Linux_armv7.so
Linux ARM64
libSL.Cpp.TracerLib.Linux_arm64.so
Last updated
Was this helpful?

