Skip to content

Commit ec6917c

Browse files
Max CharlambCopilot
andcommitted
[cdac] Run unit tests + DataGenerator tests in runtime-diagnostics pipeline
Three pieces: 1. eng/Subsets.props: wire the DataGeneratorTests project (cdac/tests/DataGenerator/) under the existing tools.cdactests subset alongside the existing UnitTests project. No new subset -- one subset builds both managed-side cDAC test projects. 2. eng/pipelines/runtime-diagnostics.yml: new CdacUnitTests stage that runs tools.cdactests on linux_x64 Checked with -test. Independent of the dump/stress legs (no native runtime needed). Publishes xunit results. Now the cDAC unit tests + DataGenerator tests live in the cDAC-focused pipeline next to the dump/stress tests. 3. src/native/managed/cdac/tests/DataGenerator/TestTarget.cs: override the new Target.ReadNInt abstract method (added in e9e3c8d, #128784) so the DataGeneratorTests project compiles. Mirrors the existing ReadNUInt override. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 25bd04c commit ec6917c

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

eng/Subsets.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@
531531

532532
<ItemGroup Condition="$(_subset.Contains('+tools.cdactests+'))">
533533
<ProjectToBuild Include="$(SharedNativeRoot)managed\cdac\tests\UnitTests\Microsoft.Diagnostics.DataContractReader.Tests.csproj" Test="true" Category="tools"/>
534+
<ProjectToBuild Include="$(SharedNativeRoot)managed\cdac\tests\DataGenerator\Microsoft.Diagnostics.DataContractReader.DataGeneratorTests.csproj" Test="true" Category="tools"/>
534535
</ItemGroup>
535536

536537
<ItemGroup Condition="$(_subset.Contains('+tools.cdacdumptests+'))">

eng/pipelines/runtime-diagnostics.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,30 @@ extends:
278278
continueOnError: true
279279
condition: failed()
280280

281+
#
282+
# cDAC Unit Tests + DataGenerator Tests — managed-side tests that don't need a
283+
# real runtime. Independent stage; runs on linux_x64 Checked on every trigger
284+
# (PR/manual/schedule).
285+
#
286+
- stage: CdacUnitTests
287+
dependsOn: []
288+
jobs:
289+
- template: /eng/pipelines/common/platform-matrix.yml
290+
parameters:
291+
jobTemplate: /eng/pipelines/common/global-build-job.yml
292+
buildConfig: checked
293+
platforms:
294+
- linux_x64
295+
jobParameters:
296+
nameSuffix: CdacUnitTests
297+
# tools.cdactests builds + tests both the cDAC UnitTests project
298+
# and the DataGeneratorTests project (both wired under that subset
299+
# in eng/Subsets.props).
300+
buildArgs: -s clr.aot+clr.iltools+clr.corelib+clr.nativecorelib+libs.sfx+clr.toolstests+tools.cdac+tools.cdactests -c $(_BuildConfig) -test
301+
timeoutInMinutes: 120
302+
enablePublishTestResults: true
303+
testResultsFormat: 'xunit'
304+
281305
#
282306
# cDAC Dump Tests — Build, generate dumps, and run tests on Helix (single-leg mode)
283307
#

src/native/managed/cdac/tests/DataGenerator/TestTarget.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ public override TargetCodePointer ReadCodePointer(ulong address)
199199
public override TargetNUInt ReadNUInt(ulong address)
200200
=> new TargetNUInt(PointerSize == 8 ? Read<ulong>(address) : Read<uint>(address));
201201

202+
public override TargetNInt ReadNInt(ulong address)
203+
=> new TargetNInt(PointerSize == 8 ? Read<long>(address) : Read<int>(address));
204+
202205
public override void Write<T>(ulong address, T value)
203206
{
204207
Span<byte> span = GetSpan(address, System.Runtime.CompilerServices.Unsafe.SizeOf<T>());

0 commit comments

Comments
 (0)