Cesium icon indicating copy to clipboard operation
Cesium copied to clipboard

Something is off during tests

Open kant2002 opened this issue 1 year ago • 4 comments

I cannot explain better, but Code does not terminate does not increase my confidence.

kant@gentoo ~/d/Cesium $ dotnet test
  Determining projects to restore...
  All projects are up-to-date for restore.
  Cesium.Runtime -> /home/kant/d/Cesium/Cesium.Runtime/bin/Debug/net6.0/Cesium.Runtime.dll
  Cesium.Runtime -> /home/kant/d/Cesium/Cesium.Runtime/bin/Debug/netstandard2.0/Cesium.Runtime.dll
  Cesium.IntegrationTests -> /home/kant/d/Cesium/Cesium.IntegrationTests/bin/Debug/net7.0/Cesium.IntegrationTests.dll
Test run for /home/kant/d/Cesium/Cesium.IntegrationTests/bin/Debug/net7.0/Cesium.IntegrationTests.dll (.NETCoreApp,Version=v7.0)
  Cesium.Ast -> /home/kant/d/Cesium/Cesium.Ast/bin/Debug/net7.0/Cesium.Ast.dll
  Cesium.Core -> /home/kant/d/Cesium/Cesium.Core/bin/Debug/net7.0/Cesium.Core.dll
Microsoft (R) Test Execution Command Line Tool Version 17.5.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

  Cesium.Preprocessor -> /home/kant/d/Cesium/Cesium.Preprocessor/bin/Debug/net7.0/Cesium.Preprocessor.dll
  Cesium.Parser -> /home/kant/d/Cesium/Cesium.Parser/bin/Debug/net7.0/Cesium.Parser.dll
  Cesium.Runtime.Tests -> /home/kant/d/Cesium/Cesium.Runtime.Tests/bin/Debug/net7.0/Cesium.Runtime.Tests.dll
Test run for /home/kant/d/Cesium/Cesium.Runtime.Tests/bin/Debug/net7.0/Cesium.Runtime.Tests.dll (.NETCoreApp,Version=v7.0)
Starting test execution, please wait...
Microsoft (R) Test Execution Command Line Tool Version 17.5.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

A total of 1 test files matched the specified pattern.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:     1, Skipped:     0, Total:     1, Duration: < 1 ms - Cesium.Runtime.Tests.dll (net7.0)

Passed!  - Failed:     0, Passed:   142, Skipped:     0, Total:   142, Duration: 1 m 8 s - Cesium.IntegrationTests.dll (net7.0)
  Cesium.Test.Framework -> /home/kant/d/Cesium/Cesium.Test.Framework/bin/Debug/net7.0/Cesium.Test.Framework.dll
  Cesium.CodeGen -> /home/kant/d/Cesium/Cesium.CodeGen/bin/Debug/net7.0/Cesium.CodeGen.dll
  Cesium.Parser.Tests -> /home/kant/d/Cesium/Cesium.Parser.Tests/bin/Debug/net7.0/Cesium.Parser.Tests.dll
  Cesium.CodeGen.Tests -> /home/kant/d/Cesium/Cesium.CodeGen.Tests/bin/Debug/net7.0/Cesium.CodeGen.Tests.dll
Test run for /home/kant/d/Cesium/Cesium.Parser.Tests/bin/Debug/net7.0/Cesium.Parser.Tests.dll (.NETCoreApp,Version=v7.0)
Test run for /home/kant/d/Cesium/Cesium.CodeGen.Tests/bin/Debug/net7.0/Cesium.CodeGen.Tests.dll (.NETCoreApp,Version=v7.0)
Microsoft (R) Test Execution Command Line Tool Version 17.5.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.
Microsoft (R) Test Execution Command Line Tool Version 17.5.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.


Starting test execution, please wait...
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:   137, Skipped:     0, Total:   137, Duration: 1 s - Cesium.Parser.Tests.dll (net7.0)
Code does not terminate

Passed!  - Failed:     0, Passed:   222, Skipped:     0, Total:   222, Duration: 4 s - Cesium.CodeGen.Tests.dll (net7.0)

kant2002 avatar Aug 09 '23 05:08 kant2002

Running separately each test project does not produce this magic words.

$ dotnet test Cesium.IntegrationTests
  Determining projects to restore...
  All projects are up-to-date for restore.
  Cesium.IntegrationTests -> /home/kant/d/Cesium/Cesium.IntegrationTests/bin/Debug/net7.0/Cesium.IntegrationTests.dll
Test run for /home/kant/d/Cesium/Cesium.IntegrationTests/bin/Debug/net7.0/Cesium.IntegrationTests.dll (.NETCoreApp,Version=v7.0)
Microsoft (R) Test Execution Command Line Tool Version 17.5.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:   142, Skipped:     0, Total:   142, Duration: 1 m 17 s - Cesium.IntegrationTests.dll (net7.0)
kant@gentoo ~/d/Cesium $ dotnet test Cesium.Parser.Tests
  Determining projects to restore...
  All projects are up-to-date for restore.
  Cesium.Ast -> /home/kant/d/Cesium/Cesium.Ast/bin/Debug/net7.0/Cesium.Ast.dll
  Cesium.Core -> /home/kant/d/Cesium/Cesium.Core/bin/Debug/net7.0/Cesium.Core.dll
  Cesium.Parser -> /home/kant/d/Cesium/Cesium.Parser/bin/Debug/net7.0/Cesium.Parser.dll
  Cesium.Preprocessor -> /home/kant/d/Cesium/Cesium.Preprocessor/bin/Debug/net7.0/Cesium.Preprocessor.dll
  Cesium.Test.Framework -> /home/kant/d/Cesium/Cesium.Test.Framework/bin/Debug/net7.0/Cesium.Test.Framework.dll
  Cesium.Parser.Tests -> /home/kant/d/Cesium/Cesium.Parser.Tests/bin/Debug/net7.0/Cesium.Parser.Tests.dll
Test run for /home/kant/d/Cesium/Cesium.Parser.Tests/bin/Debug/net7.0/Cesium.Parser.Tests.dll (.NETCoreApp,Version=v7.0)
Microsoft (R) Test Execution Command Line Tool Version 17.5.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:   137, Skipped:     0, Total:   137, Duration: 1 s - Cesium.Parser.Tests.dll (net7.0)
kant@gentoo ~/d/Cesium $ dotnet test Cesium.Runtime.Tests
  Determining projects to restore...
  All projects are up-to-date for restore.
  Cesium.Runtime -> /home/kant/d/Cesium/Cesium.Runtime/bin/Debug/net6.0/Cesium.Runtime.dll
  Cesium.Runtime.Tests -> /home/kant/d/Cesium/Cesium.Runtime.Tests/bin/Debug/net7.0/Cesium.Runtime.Tests.dll
Test run for /home/kant/d/Cesium/Cesium.Runtime.Tests/bin/Debug/net7.0/Cesium.Runtime.Tests.dll (.NETCoreApp,Version=v7.0)
Microsoft (R) Test Execution Command Line Tool Version 17.5.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:     1, Skipped:     0, Total:     1, Duration: < 1 ms - Cesium.Runtime.Tests.dll (net7.0)

kant2002 avatar Aug 09 '23 05:08 kant2002

Ooh, that's us. I prefer that we blow-up here https://github.com/ForNeVeR/Cesium/blob/29dcd88c86f63df25eb4863a0f45dee8eb7835e1/Cesium.CodeGen/Ir/ControlFlow/ControlFlowChecker.cs#L292

kant2002 avatar Aug 09 '23 05:08 kant2002

Well, is that an actual problem? Maybe just remove that log statement?

But let's investigate if it occurs on a really non-terminating program, or if that's an error.

I'm not sure if the actual C standard allows for non-terminating programs without UB, but they do exist and I think that Cesium should support them without any bogus error statements.

ForNeVeR avatar Aug 09 '23 09:08 ForNeVeR

Also yeah, we shouldn't just Console.WriteLine in there 😅

ForNeVeR avatar Aug 09 '23 09:08 ForNeVeR