Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
id: native_test
shell: powershell
run: |
.\test.ps1 -Configuration Debug -Native
.\test.ps1 -Configuration Debug -TestFilter 'TestCategory!=LongRunning&TestCategory!=ByHand&TestCategory!=SmokeTest&TestCategory!=DesktopRequired'
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

- name: Summarize native test results
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,27 @@ concurrency:

jobs:
debug_build_and_test:
name: Build Debug and run managed tests
name: Build Debug and run all tests
runs-on: windows-latest
steps:
- name: Checkout Files
uses: actions/checkout@v6
id: checkout

- name: Build managed (with tests)
id: managed_build
- name: Build and run tests
id: test
shell: powershell
run: |
.\build.ps1 -Configuration Debug -BuildTests
.\test.ps1 -Configuration Debug -TestFilter 'TestCategory!=LongRunning&TestCategory!=ByHand&TestCategory!=SmokeTest&TestCategory!=DesktopRequired'
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

- name: Run managed tests
id: managed_test
- name: Summarize native test results
if: ${{ always() }}
shell: powershell
run: |
.\test.ps1 -Configuration Debug -NoBuild -TestFilter 'TestCategory!=LongRunning&TestCategory!=ByHand&TestCategory!=SmokeTest&TestCategory!=DesktopRequired'
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
.\Build\Agent\Summarize-NativeTestResults.ps1 -Configuration Debug

- name: Upload TRX test results
- name: Upload TRX test results (managed)
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7
with:
Expand Down
114 changes: 65 additions & 49 deletions FieldWorks.sln
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "xWorksTests", "Src\xWorks\x
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Generic", "Src\Generic\Generic.vcxproj", "{7F6B25EE-CD22-4E4C-898D-A0F846E6E9D4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Kernel", "Src\Kernel\Kernel.vcxproj", "{6396B488-4D34-48B2-8639-EEB90707405B}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FwKernel", "Src\Kernel\Kernel.vcxproj", "{6396B488-4D34-48B2-8639-EEB90707405B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "views", "Src\views\views.vcxproj", "{C86CA2EB-81B5-4411-B5B7-E983314E02DA}"
EndProject
Expand Down Expand Up @@ -276,6 +276,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ToneParsFLExDll", "Src\Util
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DisambiguateInFLExDBTests", "Src\Utilities\pcpatrflex\DisambiguateInFLExDB\DisambiguateInFLExDBTests\DisambiguateInFLExDBTests.csproj", "{1D9F7F7D-F4DE-43DC-9E1D-9D0E512D1CB6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestViews", "Src\views\Test\TestViews.vcxproj", "{1D4CC42D-BC16-4EC3-A89B-173798828F56}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestGeneric", "Src\Generic\Test\TestGeneric.vcxproj", "{C644C392-FB14-4DF1-9989-897E182D3849}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Bounds|x64 = Bounds|x64
Expand Down Expand Up @@ -991,6 +995,54 @@ Global
{5DB1CEDA-B7AA-4594-9CE0-6D3A6F5763DF}.Debug|x64.Build.0 = Debug|x64
{5DB1CEDA-B7AA-4594-9CE0-6D3A6F5763DF}.Release|x64.ActiveCfg = Release|x64
{5DB1CEDA-B7AA-4594-9CE0-6D3A6F5763DF}.Release|x64.Build.0 = Release|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Bounds|x64.ActiveCfg = Debug|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Bounds|x64.Build.0 = Debug|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Debug|x64.ActiveCfg = Debug|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Debug|x64.Build.0 = Debug|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Release|x64.ActiveCfg = Release|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Release|x64.Build.0 = Release|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Bounds|x64.ActiveCfg = Debug|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Bounds|x64.Build.0 = Debug|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Debug|x64.ActiveCfg = Debug|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Debug|x64.Build.0 = Debug|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Release|x64.ActiveCfg = Release|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Release|x64.Build.0 = Release|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Bounds|x64.ActiveCfg = Debug|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Bounds|x64.Build.0 = Debug|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Debug|x64.ActiveCfg = Debug|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Debug|x64.Build.0 = Debug|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Release|x64.ActiveCfg = Release|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Release|x64.Build.0 = Release|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Bounds|x64.ActiveCfg = Debug|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Bounds|x64.Build.0 = Debug|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Debug|x64.ActiveCfg = Debug|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Debug|x64.Build.0 = Debug|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Release|x64.ActiveCfg = Release|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Release|x64.Build.0 = Release|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Bounds|x64.ActiveCfg = Debug|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Bounds|x64.Build.0 = Debug|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Debug|x64.ActiveCfg = Debug|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Debug|x64.Build.0 = Debug|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Release|x64.ActiveCfg = Release|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Release|x64.Build.0 = Release|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Bounds|x64.ActiveCfg = Debug|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Bounds|x64.Build.0 = Debug|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Debug|x64.ActiveCfg = Debug|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Debug|x64.Build.0 = Debug|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Release|x64.ActiveCfg = Release|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Release|x64.Build.0 = Release|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Bounds|x64.ActiveCfg = Debug|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Bounds|x64.Build.0 = Debug|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Debug|x64.ActiveCfg = Debug|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Debug|x64.Build.0 = Debug|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Release|x64.ActiveCfg = Release|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Release|x64.Build.0 = Release|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Bounds|x64.ActiveCfg = Debug|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Bounds|x64.Build.0 = Debug|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Debug|x64.ActiveCfg = Debug|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Debug|x64.Build.0 = Debug|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Release|x64.ActiveCfg = Release|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Release|x64.Build.0 = Release|x64
{6A3359E7-E3DA-4CF6-B6F8-C6A4E8D9800B}.Bounds|x64.ActiveCfg = Debug|x64
{6A3359E7-E3DA-4CF6-B6F8-C6A4E8D9800B}.Bounds|x64.Build.0 = Debug|x64
{6A3359E7-E3DA-4CF6-B6F8-C6A4E8D9800B}.Debug|x64.ActiveCfg = Debug|x64
Expand Down Expand Up @@ -1045,54 +1097,18 @@ Global
{1D9F7F7D-F4DE-43DC-9E1D-9D0E512D1CB6}.Debug|x64.Build.0 = Debug|x64
{1D9F7F7D-F4DE-43DC-9E1D-9D0E512D1CB6}.Release|x64.ActiveCfg = Release|x64
{1D9F7F7D-F4DE-43DC-9E1D-9D0E512D1CB6}.Release|x64.Build.0 = Release|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Bounds|x64.ActiveCfg = Debug|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Bounds|x64.Build.0 = Debug|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Debug|x64.ActiveCfg = Debug|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Debug|x64.Build.0 = Debug|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Release|x64.ActiveCfg = Release|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Release|x64.Build.0 = Release|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Bounds|x64.ActiveCfg = Debug|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Bounds|x64.Build.0 = Debug|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Debug|x64.ActiveCfg = Debug|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Debug|x64.Build.0 = Debug|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Release|x64.ActiveCfg = Release|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Release|x64.Build.0 = Release|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Bounds|x64.ActiveCfg = Debug|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Bounds|x64.Build.0 = Debug|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Debug|x64.ActiveCfg = Debug|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Debug|x64.Build.0 = Debug|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Release|x64.ActiveCfg = Release|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Release|x64.Build.0 = Release|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Bounds|x64.ActiveCfg = Debug|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Bounds|x64.Build.0 = Debug|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Debug|x64.ActiveCfg = Debug|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Debug|x64.Build.0 = Debug|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Release|x64.ActiveCfg = Release|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Release|x64.Build.0 = Release|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Bounds|x64.ActiveCfg = Debug|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Bounds|x64.Build.0 = Debug|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Debug|x64.ActiveCfg = Debug|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Debug|x64.Build.0 = Debug|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Release|x64.ActiveCfg = Release|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Release|x64.Build.0 = Release|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Bounds|x64.ActiveCfg = Debug|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Bounds|x64.Build.0 = Debug|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Debug|x64.ActiveCfg = Debug|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Debug|x64.Build.0 = Debug|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Release|x64.ActiveCfg = Release|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Release|x64.Build.0 = Release|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Bounds|x64.ActiveCfg = Debug|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Bounds|x64.Build.0 = Debug|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Debug|x64.ActiveCfg = Debug|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Debug|x64.Build.0 = Debug|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Release|x64.ActiveCfg = Release|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Release|x64.Build.0 = Release|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Bounds|x64.ActiveCfg = Debug|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Bounds|x64.Build.0 = Debug|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Debug|x64.ActiveCfg = Debug|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Debug|x64.Build.0 = Debug|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Release|x64.ActiveCfg = Release|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Release|x64.Build.0 = Release|x64
{1D4CC42D-BC16-4EC3-A89B-173798828F56}.Bounds|x64.ActiveCfg = Debug|x64
{1D4CC42D-BC16-4EC3-A89B-173798828F56}.Bounds|x64.Build.0 = Debug|x64
{1D4CC42D-BC16-4EC3-A89B-173798828F56}.Debug|x64.ActiveCfg = Debug|x64
{1D4CC42D-BC16-4EC3-A89B-173798828F56}.Debug|x64.Build.0 = Debug|x64
{1D4CC42D-BC16-4EC3-A89B-173798828F56}.Release|x64.ActiveCfg = Release|x64
{1D4CC42D-BC16-4EC3-A89B-173798828F56}.Release|x64.Build.0 = Release|x64
{C644C392-FB14-4DF1-9989-897E182D3849}.Bounds|x64.ActiveCfg = Debug|x64
{C644C392-FB14-4DF1-9989-897E182D3849}.Bounds|x64.Build.0 = Debug|x64
{C644C392-FB14-4DF1-9989-897E182D3849}.Debug|x64.ActiveCfg = Debug|x64
{C644C392-FB14-4DF1-9989-897E182D3849}.Debug|x64.Build.0 = Debug|x64
{C644C392-FB14-4DF1-9989-897E182D3849}.Release|x64.ActiveCfg = Release|x64
{C644C392-FB14-4DF1-9989-897E182D3849}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion Src/CacheLight/CacheLightTests/MetaDataCacheTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public class MetaDataCacheFieldAccessTests : MetaDataCacheBase
[Test]
public void GetDstClsNameTest()
{
Assert.That(m_metaDataCache.GetDstClsName(59005), Is.EqualTo("ClassL"), "Wrong class name");
Assert.Fail("just checking");
}

/// <summary>
Expand Down
85 changes: 5 additions & 80 deletions Src/Generic/Test/TestUtil.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------*//*:Ignore this sentence.
Copyright (c) 2003-2013 SIL International
Copyright (c) 2003-2026 SIL International
This software is licensed under the LGPL, version 2.1 or later
(http://www.gnu.org/licenses/lgpl-2.1.html)

Expand All @@ -21,6 +21,10 @@ namespace TestGenericLib
{
class TestUtil : public unitpp::suite
{
void testFailure()
{
unitpp::assert_fail("Oh, what fun it is to type in a one-line failing test, hey!");
}
void testGetPrimeNear()
{
uint u;
Expand Down Expand Up @@ -100,85 +104,6 @@ namespace TestGenericLib
//GetFullPathName(const achar * psz, StrAnsi & staPath)
// ...

// Clipboard is entirely handled in C# now
// void GetClipboardFormat(CLIPFORMAT cf, StrUni stuNFC)
// {
// // TODO-Linux: Clipboard not supported in C++
//#ifdef WIN32
// FORMATETC format;
// STGMEDIUM medium;
//
// HRESULT hr;
// IDataObjectPtr qdobj;
// for (int i = 0; i < 10; i++) // try up to 20 times.
// {
// hr = ::OleGetClipboard(&qdobj);
// if (SUCCEEDED(hr))
// break;
// ::Sleep(100);
// }
// CheckHr(hr);
//
// format.cfFormat = static_cast<unsigned short>(cf);
// format.ptd = NULL;
// format.dwAspect = DVASPECT_CONTENT;
// format.lindex = -1;
// format.tymed = TYMED_HGLOBAL;
//
// hr = qdobj->GetData(&format, &medium);
// if (hr == S_OK)
// {
// StrUni stu;
// if (medium.tymed == TYMED_HGLOBAL && medium.hGlobal)
// {
// const char * pszClip;
// const wchar * pwszClip;
// switch(cf)
// {
// case CF_OEMTEXT:
// case CF_TEXT:
// pszClip = (const char *)::GlobalLock(medium.hGlobal);
// stu = pszClip;
// break;
//
// case CF_UNICODETEXT:
// default:
// pwszClip = (const wchar *)::GlobalLock(medium.hGlobal);
// stu = pwszClip;
// }
// ::GlobalUnlock(medium.hGlobal);
// }
// ::ReleaseStgMedium(&medium);
// unitpp::assert_true("Clipboard data normalized correctly in some format",
// stu.Equals(stuNFC.Chars(), stuNFC.Length()));
// }
// else
// unitpp::assert_true("GetData failed in GetClipboardFormat", 0);
//#endif
// }
//
// void testGetDataNormalized()
// {
// // TODO-Linux: Clipboard not supported in C++
//#ifdef WIN32
// StrUni stuIn = L"Te\x0301sting";
// StrUni stuNFC = L"T\x00e9sting";
// IDataObjectPtr qdobj;
// StringDataObject::Create(const_cast<OLECHAR *>(stuIn.Chars()), &qdobj);
// if (::OleSetClipboard(qdobj) == S_OK)
// {
// ModuleEntry::SetClipboard(qdobj);
// }
// qdobj.Clear(); // Let go of our connection to the clipboard; seems to make tests at least more reliable.
//
// GetClipboardFormat(CF_UNICODETEXT, stuNFC);
// GetClipboardFormat(CF_OEMTEXT, stuNFC);
// GetClipboardFormat(CF_TEXT, stuNFC);
//
// ::OleSetClipboard(NULL); // reset the clipboard {release the object}
//#endif
// }

public:
TestUtil();
};
Expand Down
35 changes: 29 additions & 6 deletions test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
Test output verbosity: q[uiet], m[inimal], n[ormal], d[etailed].
Default is 'normal'.

.PARAMETER NoNative
Skip running native C++ tests. Run only managed tests.

.PARAMETER NativeOnly
Run only native C++ tests, skipping managed tests.

.PARAMETER StartedBy
Optional actor label written to worktree lock metadata (for example: user or agent).
Defaults to FW_BUILD_STARTED_BY if set; otherwise 'unknown'.
Expand Down Expand Up @@ -62,7 +68,8 @@ param(
[switch]$ListTests,
[ValidateSet('quiet', 'minimal', 'normal', 'detailed', 'q', 'm', 'n', 'd')]
[string]$Verbosity = "normal",
[switch]$Native,
[switch]$NoNative,
[switch]$NativeOnly,
[switch]$SkipDependencyCheck,
[switch]$SkipWorktreeLock,
[ValidateSet('user', 'agent', 'unknown')]
Expand Down Expand Up @@ -140,7 +147,8 @@ try {
# Native Tests Dispatch
# =============================================================================

if ($Native) {
$script:nativeErrorMessages = @()
if (-not $NoNative) {
$cppScript = Join-Path $PSScriptRoot "Build/scripts/Invoke-CppTest.ps1"
if (-not (Test-Path $cppScript)) {
Write-Host "[ERROR] Native test script not found at $cppScript" -ForegroundColor Red
Expand Down Expand Up @@ -170,11 +178,16 @@ try {
& $cppScript -Action $action -TestProject $proj -Configuration $Configuration
if ($LASTEXITCODE -ne 0) {
$overallExitCode = $LASTEXITCODE
Write-Host "[ERROR] $proj failed with exit code $LASTEXITCODE" -ForegroundColor Red
$message = "[ERROR] $proj failed with exit code $LASTEXITCODE"
$script:nativeErrorMessages += $message
Write-Host $message -ForegroundColor Red
}
}
$script:testExitCode = $overallExitCode
return

if ($NativeOnly) {
return
}
}

# =============================================================================
Expand Down Expand Up @@ -445,7 +458,10 @@ try {
$ErrorActionPreference = 'Continue'
try {
& $vstestPath $vstestArgs 2>&1 | Tee-Object -Variable testOutput
$script:testExitCode = $LASTEXITCODE
# Don't overwrite a non-zero exit code from native tests with a zero exit code from these tests.
if ($LASTEXITCODE -ne 0) {
$script:testExitCode = $LASTEXITCODE
}
}
finally {
$ErrorActionPreference = $previousEap
Expand Down Expand Up @@ -536,6 +552,10 @@ if ($testExitCode -ne 0 -and (Test-Path $vstestLogPath)) {
Write-Host ""
Write-Host "========== FAILURE SUMMARY ==========" -ForegroundColor Red

foreach ($msg in $script:nativeErrorMessages) {
Write-Host $msg -ForegroundColor Red
}

$logLines = Get-Content $vstestLogPath
$failedTests = @()
for ($i = 0; $i -lt $logLines.Count; $i++) {
Expand Down Expand Up @@ -572,7 +592,10 @@ if ($testExitCode -ne 0 -and (Test-Path $vstestLogPath)) {
}

Write-Host "=====================================" -ForegroundColor Red
Write-Host " Full log: $vstestLogPath" -ForegroundColor Gray
Write-Host " Full log for managed tests: $vstestLogPath" -ForegroundColor Gray
if (-not $NoNative) {
Write-Host " Logs for each native test suite should be in the directory above (Output\$Configuration)." -ForegroundColor Gray
}
}

if ($testExitCode -eq 0) {
Expand Down
Loading