Skip to content

Commit

Permalink
Setting up ASAN builds of unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekazakov committed Jan 13, 2024
1 parent 08ff504 commit 026756a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
CCACHE_MAXSIZE: "400M"
strategy:
matrix:
configuration: ["Debug", "Release"]
configuration: ["Debug", "Release", "ASAN"]
steps:
- name: Select latest Xcode
run: "sudo xcode-select -s /Applications/Xcode_$XC_VERSION.app"
Expand Down
9 changes: 9 additions & 0 deletions Scripts/run_all_unit_tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
# Usage: ./run_all_unit_tests.sh [Debug|Release|ASAN]

set -e
set -o pipefail
Expand Down Expand Up @@ -36,13 +37,21 @@ build_target()
TARGET=$1
CONFIGURATION=$2
echo building ${TARGET} - ${CONFIGURATION}

asan_flags=""
if [ "$CONFIGURATION" == "ASAN" ]; then
CONFIGURATION="Release"
asan_flags="-enableAddressSanitizer YES"
fi

XC="xcodebuild \
-project ${XCODEPROJ} \
-scheme ${TARGET} \
-configuration ${CONFIGURATION} \
SYMROOT=${BUILD_DIR} \
OBJROOT=${BUILD_DIR} \
-parallelizeTargets \
${asan_flags} \
OTHER_CFLAGS=\"-fdebug-prefix-map=${ROOT_DIR}=.\""
BINARY_DIR=$($XC -showBuildSettings | grep " BUILT_PRODUCTS_DIR =" | sed -e 's/.*= *//')
BINARY_NAME=$($XC -showBuildSettings | grep " FULL_PRODUCT_NAME =" | sed -e 's/.*= *//')
Expand Down

0 comments on commit 026756a

Please sign in to comment.