Skip to content

Instantly share code, notes, and snippets.

@azu
Created June 8, 2013 14:14
Show Gist options
  • Save azu/5735299 to your computer and use it in GitHub Desktop.
Save azu/5735299 to your computer and use it in GitHub Desktop.
xctool test GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YESでビルドした、gcovのディレクトリを取得する
#!/bin/bash
trim()
{
trimmed=$1
trimmed=${trimmed%% }
trimmed=${trimmed## }
echo $trimmed
}
xctoolVars=$(xctool -showBuildSettings | egrep '(BUILT_PRODUCTS_DIR)|(CURRENT_ARCH)|(OBJECT_FILE_DIR_normal)|(SRCROOT)|(OBJROOT)' | egrep -v 'Pods')
while read line; do
declare key=$(echo "${line}" | cut -d "=" -f1)
declare value=$(echo "${line}" | cut -d "=" -f2)
printf -v "`trim ${key}`" "`trim ${value}`"
done < <( echo "${xctoolVars}" )
declare gcov_dir="${OBJECT_FILE_DIR_normal}/${CURRENT_ARCH}"
echo $gcov_dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment