Skip to content

Commit

Permalink
Adding a configuration to build binaries for code coverage analysis
Browse files Browse the repository at this point in the history
Made codecoverage to treated similar to a flavor
  • Loading branch information
aneeshdk committed Jan 8, 2016
1 parent a7a33aa commit 3b13275
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Build/Chakra.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
$(ChakraCoreRootDirectory)\lib\common\placeholder;
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>

<!-- ======== For Code Covearge ======== -->
<Optimization Condition="'$(ENABLE_CODECOVERAGE)'=='true'">Disabled</Optimization>
</ClCompile>

<Link>
<!-- ======== For Code Covearge ======== -->
<AdditionalOptions Condition="'$(ENABLE_CODECOVERAGE)'=='true'">%(AdditionalOptions) /DEBUGTYPE:CV,FIXUP</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
</Project>
1 change: 1 addition & 0 deletions Build/Common.Build.Default.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

<!-- Output directories -->
<PropertyGroup>
<OutDirName Condition="'$(ENABLE_CODECOVERAGE)'=='true'">codecoverage</OutDirName>
<OutDirName Condition="'$(OutDirName)'==''">$(Configuration.ToLower())</OutDirName>
<OutDir>$(OutBaseDir)\bin\$(PlatformPathName.ToLower())_$(OutDirName)\</OutDir>
<IntDir>$(IntBaseDir)\obj\$(PlatformPathName.ToLower())_$(Configuration.ToLower())\$(MSBuildProjectName)\</IntDir>
Expand Down
3 changes: 1 addition & 2 deletions Build/scripts/post_build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ param (
[ValidateSet("x86", "x64", "arm", "*")]
[string]$arch="*",

[ValidateSet("debug", "release", "test", "*")]
[ValidateSet("debug", "release", "test", "codecoverage", "*")]
[string]$flavor = "*",

[string]$srcpath = "",
Expand All @@ -23,7 +23,6 @@ param (

$global:exitcode = 0


if ($arch -eq "*") {

. "$PSScriptRoot\util.ps1"
Expand Down
6 changes: 6 additions & 0 deletions test/runtests.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ goto :main
echo.
echo -debug Build type of binaries is debug
echo -test Build type of binaries is test
echo -codecoverage Build type of binaries is codecoverage
echo.
echo Shorthand combinations can be used, e.g. -x64debug
echo.
Expand Down Expand Up @@ -134,13 +135,17 @@ goto :main
if /i "%1" == "-arm" set _BuildArch=arm& goto :ArgOk
if /i "%1" == "-debug" set _BuildType=debug& goto :ArgOk
if /i "%1" == "-test" set _BuildType=test& goto :ArgOk
if /i "%1" == "-codecoverage" set _BuildType=codecoverage& goto :ArgOk

if /i "%1" == "-x86debug" set _BuildArch=x86&set _BuildType=debug& goto :ArgOk
if /i "%1" == "-x64debug" set _BuildArch=x64&set _BuildType=debug& goto :ArgOk
if /i "%1" == "-armdebug" set _BuildArch=arm&set _BuildType=debug& goto :ArgOk
if /i "%1" == "-x86test" set _BuildArch=x86&set _BuildType=test& goto :ArgOk
if /i "%1" == "-x64test" set _BuildArch=x64&set _BuildType=test& goto :ArgOk
if /i "%1" == "-armtest" set _BuildArch=arm&set _BuildType=test& goto :ArgOk
if /i "%1" == "-x86codecoverage" set _BuildArch=x86&set _BuildType=codecoverage& goto :ArgOk
if /i "%1" == "-x64codecoverage" set _BuildArch=x64&set _BuildType=codecoverage& goto :ArgOk
if /i "%1" == "-armcodecoverage" set _BuildArch=arm&set _BuildType=codecoverage& goto :ArgOk

if /i "%1" == "-binary" set _Binary=-binary:%2& goto :ArgOkShift2
if /i "%1" == "-bindir" set _BinDir=%~f2& goto :ArgOkShift2
Expand Down Expand Up @@ -318,6 +323,7 @@ goto :main
if "%_BuildArchMapped%" == "x64" set _BuildArchMapped=amd64
if "%_BuildTypeMapped%" == "debug" set _BuildTypeMapped=chk
if "%_BuildTypeMapped%" == "test" set _BuildTypeMapped=fre
if "%_BuildTypeMapped%" == "codecoverage" set _BuildTypeMapped=fre

if "%Disable_JIT%" == "1" (
set _dynamicprofilecache=
Expand Down

0 comments on commit 3b13275

Please sign in to comment.