Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project doesn't build/test on macOS #577

Open
Bouke opened this issue Dec 4, 2024 · 0 comments
Open

Project doesn't build/test on macOS #577

Bouke opened this issue Dec 4, 2024 · 0 comments

Comments

@Bouke
Copy link
Contributor

Bouke commented Dec 4, 2024

I'm thinking about working on a PR (see #576), but the project currently doesn't build/test on my machine (macOS). I have a few patches that I apply locally to get the project to build. Most of those are around disabling WPF integration, and targeting .net 8 now that .net 6 is out of support.

However the next hurdle I'm facing is getting the tests to succeed. Most tests fail with unrelated warnings being reported. Take for example NewDisposableSplitDeclarationAndAssignment that fails with the output below. It looks like the compilation doesn't bring the required assemblies, although I'd need some pointers to address those.

Gu.Roslyn.Asserts.AssertException : Expected and actual diagnostics do not match.
Expected:
  IDISP001 
    at line 10 and character 12 in file C.cs | 
Actual:
  CS8019 Unnecessary using directive.
    at line 3 and character 4 in file Disposable.cs | ↓using System;
  CS8019 Unnecessary using directive.
    at line 3 and character 4 in file C.cs | ↓using System;
  CS0246 The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
    at line 3 and character 10 in file Disposable.cs | using ↓System;
  CS0246 The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
    at line 3 and character 10 in file C.cs | using ↓System;
  CS0518 Predefined type 'System.Object' is not defined or imported
    at line 5 and character 17 in file C.cs | public class ↓C
  CS0246 The type or namespace name 'IDisposable' could not be found (are you missing a using directive or an assembly reference?)
    at line 5 and character 30 in file Disposable.cs | public class Disposable : ↓IDisposable
  CS0518 Predefined type 'System.Void' is not defined or imported
    at line 7 and character 8 in file C.cs | ↓public C()
  CS1729 'object' does not contain a constructor that takes 0 arguments
    at line 7 and character 15 in file C.cs | public ↓C()
  CS0518 Predefined type 'System.Void' is not defined or imported
    at line 7 and character 15 in file Disposable.cs | public ↓void Dispose()
  CS0518 Predefined type 'System.Object' is not defined or imported
    at line 9 and character 12 in file C.cs | ↓IDisposable disposable;
  CS0246 The type or namespace name 'IDisposable' could not be found (are you missing a using directive or an assembly reference?)
    at line 9 and character 12 in file C.cs | ↓IDisposable disposable;
  CS0518 Predefined type 'System.Object' is not defined or imported
    at line 10 and character 29 in file C.cs | disposable = new ↓Disposable();
  CS0518 Predefined type 'System.Void' is not defined or imported
    at line 10 and character 29 in file C.cs | disposable = new ↓Disposable();

   at Gu.Roslyn.Asserts.RoslynAssert.VerifyDiagnostics(DiagnosticsAndSources diagnosticsAndSources, IReadOnlyList`1 selectedDiagnostics, IReadOnlyList`1 allDiagnostics)
   at Gu.Roslyn.Asserts.RoslynAssert.VerifyDiagnostics(DiagnosticsAndSources diagnosticsAndSources, IReadOnlyList`1 diagnostics)
   at Gu.Roslyn.Asserts.RoslynAssert.CodeFix(DiagnosticAnalyzer analyzer, CodeFixProvider fix, DiagnosticsAndSources diagnosticsAndSources, IReadOnlyList`1 after, String fixTitle, Settings settings)
   at Gu.Roslyn.Asserts.RoslynAssert.CodeFix(DiagnosticAnalyzer analyzer, CodeFixProvider fix, ExpectedDiagnostic expectedDiagnostic, IReadOnlyList`1 before, String after, String fixTitle, Settings settings)
   at IDisposableAnalyzers.Test.IDISP001DisposeCreatedTests.CodeFix.AddUsingAssignment.NewDisposableSplitDeclarationAndAssignment() in .../IDisposableAnalyzers/IDisposableAnalyzers.Test/IDISP001DisposeCreatedTests/CodeFix.AddUsingAssignment.cs:line 61
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)



-----

One or more child tests had errors
  Exception doesn't have a stacktrace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant