Skip to content

Commit

Permalink
Update cxplat environment variable names
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Thaler <[email protected]>
  • Loading branch information
dthaler committed Aug 18, 2023
1 parent ea0d796 commit 6c6a136
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
BUILD_CONFIGURATION: ${{matrix.configurations}}

BUILD_PLATFORM: x64
USERSIM_MEMORY_LEAK_DETECTION: true
CXPLAT_MEMORY_LEAK_DETECTION: true

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
BUILD_PLATFORM: x64
CMAKE_GENERATOR: Visual Studio 17 2022
PLATFORM_TOOLSET: v143
USERSIM_MEMORY_LEAK_DETECTION: true
CXPLAT_MEMORY_LEAK_DETECTION: true

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ To use this repository from another project:

### Leak Detection

To detect memory leaks on exit, define the environment variable USERSIM_MEMORY_LEAK_DETECTION=true
To detect memory leaks on exit, define the environment variable CXPLAT_MEMORY_LEAK_DETECTION=true

### Fault Injection

To use fault injection, define the environment variable USERSIM_FAULT_INJECTION_SIMULATION=4
To use fault injection, define the environment variable CXPLAT_FAULT_INJECTION_SIMULATION=4
where the value (4 in this example) is the number of stack frames to use to determine whether a call stack is unique.
Fault injection will cause one call into the UserSim library to fail, for every unique call stack.

Expand Down
5 changes: 2 additions & 3 deletions cxplat/src/cxplat_winuser/cxplat_winuser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ cxplat_leak_detector_ptr _cxplat_leak_detector_ptr;

/**
* @brief Environment variable to enable fault injection testing.
* TODO: update names from USERSIM to CXPLAT
*/
#define CXPLAT_FAULT_INJECTION_SIMULATION_ENVIRONMENT_VARIABLE_NAME "USERSIM_FAULT_INJECTION_SIMULATION"
#define CXPLAT_MEMORY_LEAK_DETECTION_ENVIRONMENT_VARIABLE_NAME "USERSIM_MEMORY_LEAK_DETECTION"
#define CXPLAT_FAULT_INJECTION_SIMULATION_ENVIRONMENT_VARIABLE_NAME "CXPLAT_FAULT_INJECTION_SIMULATION"
#define CXPLAT_MEMORY_LEAK_DETECTION_ENVIRONMENT_VARIABLE_NAME "CXPLAT_MEMORY_LEAK_DETECTION"

/**
* @brief Get an environment variable as a string.
Expand Down
2 changes: 1 addition & 1 deletion scripts/Test-FaultInjection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ param ($OutputFolder, $Timeout, $TestProgram, $StackDepth)
# Gather list of all possible tests
$tests = & $TestProgram "--list-tests" "--verbosity=quiet"

$env:USERSIM_FAULT_INJECTION_SIMULATION = $StackDepth
$env:CXPLAT_FAULT_INJECTION_SIMULATION = $StackDepth
$env:EBPF_ENABLE_WER_REPORT = "yes"

Set-Content -Path ($TestProgram + ".passed.log") ""
Expand Down

0 comments on commit 6c6a136

Please sign in to comment.