tag:help.appveyor.com,2012-11-13:/discussions/questions/1110-expand-variable-in-after_testAppVeyor: Discussion 2018-10-19T08:17:05Ztag:help.appveyor.com,2012-11-13:Comment/363672212015-03-24T04:53:57Z2015-03-24T04:53:57ZExpand variable in after_test<div><p>As there is just a command try this:</p>
<pre>
<code>after_test:
- packages\OpenCover.4.5.3723\OpenCover.Console.exe -register:user -target:"vstest.console.exe" -targetargs:"MyProject.UnitTests\bin\%configuration%\MyProject.UnitTests.dll" -output:coverage.xml</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/363672212015-03-24T16:18:52Z2015-03-24T16:18:52ZExpand variable in after_test<div><p>Yes it worked. Thank you. The output in the appveyor console
shows the %configuration% instead of 'Debug' or 'Release', which is
slightly confusing. If you ever have a chance, it would be great to
improve the output in the console to display the actual value.
Here's an example of the console to illustrate my point:</p>
<pre>
<code>Total tests: 40. Passed: 40. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 5.3747 Seconds
packages\OpenCover.4.5.3723\OpenCover.Console.exe -register:user -target:"vstest.console.exe" -targetargs:"""MyProject.UnitTests\bin\%configuration%\MyProject.UnitTests.dll""" -output:coverage.xml
Executing: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe
Microsoft (R) Test Execution Command Line Tool Version 12.0.30723.0
Copyright (c) Microsoft Corporation. All rights reserved.</code>
</pre>
<p>As a follow-up question: when are we supposed to use curly
brackets such as {myvariable}? When are we supposed to use the
dollar sign and parenthesis such as $(myvariable)? and when are we
supposed to use the percent signs (such as %myvariable%)?</p></div>desautelsjtag:help.appveyor.com,2012-11-13:Comment/363672212015-03-25T10:24:28Z2015-03-25T10:24:28ZExpand variable in after_test<div><p>If it is a "shell" command line, such as something starting with
<code>-</code> use <code>%myvariable%</code>. if it's PS command,
starting with <code>- ps:</code> use
<code>"$env:myvariable"</code>. In all other places should use
<code>$(myvariable)</code>. <code>{myvariable}</code> is only used
in version format and assembly patching and there only two vars:
<code>{biuld}</code> and <code>{version}</code>.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/363672212015-07-17T20:16:30Z2015-07-17T20:16:31ZExpand variable in after_test<div><p>Is the above info on variable usage specified anywhere in docs?
Had to search for this - would be very useful to make easier to
find! Thanks :)</p></div>brian.donahue