Skip to content

Cannot run tests outside of nativeaot folder #68394

@kant2002

Description

@kant2002

I did try to build test using this command

src\tests\build.cmd nativeaot Debug dir Interop\LayoutClass

This command produce following warnings

    Generating compatible native code. To optimize for size or speed, visit https://aka.ms/OptimizeNativeAOT
    ILC: Method '[LayoutClassTest]PInvokeTests.StructureTests.ValidateSealedBlittableClassInOut(Func`2<SealedBlittable,bool>)' will always throw because: Failed to load assembly 'xunit.assert'
    ILC: Method '[LayoutClassTest]PInvokeTests.StructureTests.NestedLayoutClass()' will always throw because: Failed to load assembly 'xunit.assert'
    ILC: Method '[LayoutClassTest]PInvokeTests.StructureTests.BlittablePinned()' will always throw because: Failed to load assembly 'xunit.assert'
    ILC: Method '[LayoutClassTest]PInvokeTests.StructureTests.SealedBlittablePinned()' will always throw because: Failed to load assembly 'xunit.assert'
    ILC: Method '[LayoutClassTest]PInvokeTests.StructureTests.BlittableClassNull()' will always throw because: Failed to load assembly 'xunit.assert'
    ILC: Method '[LayoutClassTest]PInvokeTests.StructureTests.ValidateBlittableClassInOut(Func`2<Blittable,bool>)' will always throw because: Failed to load assembly 'xunit.assert'
    ILC: Method '[LayoutClassTest]PInvokeTests.StructureTests.ExplicitClass()' will always throw because: Failed to load assembly 'xunit.assert'
    ILC: Method '[LayoutClassTest]PInvokeTests.StructureTests.DerivedClassWithEmptyBase()' will always throw because: Failed to load assembly 'xunit.assert'
    ILC: Method '[LayoutClassTest]PInvokeTests.StructureTests.SequentialClassNull()' will always throw because: Failed to load assembly 'xunit.assert'

When I run tests using src\tests\run.cmd runnativeaottests Debug tests fails with missing xunit.assert.
What I'm doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions