Skip to content

Commit

Permalink
Call vcvars64.bat for unit test environment (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
YaSuenag authored Oct 14, 2024
1 parent 3e88fbd commit 6d1a7eb
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@ jobs:
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2

- name: Setup VSTest Path
uses: darenm/Setup-VSTest@v1.3

- name: Build unit test
run: msbuild SimpleComTest\SimpleComTest.vcxproj -property:"Configuration=Debug" -property:"Platform=x64"

- name: Generate vcvars path
run: |
$installPath = & vswhere.exe '-property' installationPath
$vcvarsPath = $installPath + '\VC\Auxiliary\Build\vcvars64.bat'
"VCVARS_PATH=$vcvarsPath" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: pwsh

- name: Run unit test
run: vstest.console.exe /Platform:x64 SimpleComTest\x64\Debug\SimpleComTest.dll
run: |
call "${{ env.VCVARS_PATH }}"
vstest.console.exe /Platform:x64 SimpleComTest\x64\Debug\SimpleComTest.dll
shell: cmd

0 comments on commit 6d1a7eb

Please sign in to comment.