Runtime: Microsoft.VisualBasic tests fail on Android

Created on 27 May 2020  路  10Comments  路  Source: dotnet/runtime

Several tests from Microsoft.VisualBasic fail on Android

Microsoft.VisualBasic.Core.Tests:

List of test failures
XML of test failures

area-Microsoft.VisualBasic os-android

All 10 comments

Tagging subscribers to this area: @cston
Notify danmosemsft if you want to be subscribed.

I would like to do this, just need to know how to execute the tests.

Hi Edison, this is the workflow for running the library tests on Android. https://github.com/dotnet/runtime/blob/master/docs/workflow/testing/libraries/testing-android.md

Hello @mdh1418 I have managed to build the sources as those instructions, except that is failing to build the test. Here is the error message:
/home/henrique/source/repos/runtime/eng/testing/tests.mobile.targets(69,3): error MSB4019: The imported project "/home/henrique/source/repos/runtime/artifacts/bin/MonoAOTCompiler/Debug/net5.0/MonoAOTCompiler.props" was not found. Confirm that the expression in the Import declaration "/home/henrique/source/repos/runtime/artifacts/bin/MonoAOTCompiler/Debug/net5.0/MonoAOTCompiler.props" is correct, and that the file exists on disk. [/home/henrique/source/repos/runtime/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft.VisualBasic.Core.Tests.csproj]
Not sure to get this MonoAOTCompiler.

Nevermind, I cleared local repo and did a full build and worked.

I have a doubt in how to deal with this. Most of the tests are failing because of empty test data for [Theory] tests. Except in couple cases, all others seems "impossible" to test the conditions. For example, take this test:
```c#
[Theory]
[MemberData(nameof(Val_Char_ArgumentException_TestData))]
public void Val_ArgumentException_Char(char value)
{
Assert.Throws(() => Conversion.Val(value));
}

public static IEnumerable {
yield break; // Add more...
}

And now Val function:
```vb.net
Public Function Val(ByVal Expression As Char) As Integer
    'Val only handles Ascii decimal chars '0' to '9'
    Dim CharValue As Integer
    CharValue = AscW(Expression) 'CType(Expression, IConvertible).ToInt32(Nothing)
    If CharValue >= AscW("1"c) AndAlso CharValue <= AscW("9"c) Then
        Return CharValue - AscW("0")
    End If
    Return 0
End Function

There is no way to test ArgumentException (at least I could not find a way), so, should I delete this kind test or just disable for Android (Mono)?

@ehasis, thanks for investigating.

I agree, it looks like several of the empty test data and associated tests can be removed because the conditions being tested cannot be hit: Val_Char_ArgumentException_TestData, Val_Char_OverflowException_TestData.

Are there values for the other empty test data that would satisfy the conditions being tested? For instance:

public static IEnumerable<object[]> Val_Object_OverflowException_TestData()
{
    yield return "123456e789";
}

Are there values for the other empty test data that would satisfy the conditions being tested?

Yes, there are and I'm working on it.

Ok, I've managed to almost resolve this issue, except the test bellow. Is failing on Assert.False(string.IsNullOrEmpty(actual)). Any suggestion?
c# [Fact] public void Command() { var expected = Environment.CommandLine; var actual = Interaction.Command(); Assert.False(string.IsNullOrEmpty(actual)); Assert.EndsWith(actual, expected); }

Is failing on Assert.False(string.IsNullOrEmpty(actual)).

Perhaps Environment.CommandLine is returning null or "". We could log a specific bug and follow up on this test failure separately if that is blocking.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GitAntoinee picture GitAntoinee  路  3Comments

yahorsi picture yahorsi  路  3Comments

nalywa picture nalywa  路  3Comments

chunseoklee picture chunseoklee  路  3Comments

jzabroski picture jzabroski  路  3Comments