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

Update unit tests and fix bugs to make them pass again #32

Merged
merged 6 commits into from
Oct 7, 2023

Conversation

filipnavara
Copy link
Contributor

Tested on Windows with Ubuntu 22.04 installed in WSL.

@xoofx xoofx merged commit f516c4d into xoofx:master Oct 7, 2023
1 check passed
@xoofx
Copy link
Owner

xoofx commented Oct 7, 2023

Amazing, thanks a lot for this!

@xoofx xoofx added the bug Something isn't working label Oct 7, 2023
@filipnavara filipnavara deleted the unit_tests branch October 7, 2023 05:34
@am11
Copy link

am11 commented Oct 7, 2023

@filipnavara, in case this is not known, I ran tests (dotnet test src/LibObjectFile.Tests) on linux-arm64 (Ubuntu 22.04), four tests are failing. Here is the output http://sprunge.us/9szZoA. e.g.

  Failed TestDebugInfoSmall [32 ms]
  Error Message:
   System.NotImplementedException : The relocation for architecture EM_AARCH64 is not supported/implemented.
  Stack Trace:
     at LibObjectFile.Elf.ElfRelocationTableExtensions.Relocate(ElfRelocationTable relocTable, Stream stream, ElfRelocationContext& context) in /LibObjectFile/src/LibObjectFile/Elf/Sections/ElfRelocationTableExtensions.cs:line 45
   at LibObjectFile.Elf.ElfRelocationTableExtensions.Relocate(ElfRelocationTable relocTable, ElfRelocationContext& context) in /LibObjectFile/src/LibObjectFile/Elf/Sections/ElfRelocationTableExtensions.cs:line 28
   at LibObjectFile.Dwarf.DwarfElfContext..ctor(ElfObjectFile elf) in /LibObjectFile/src/LibObjectFile/Dwarf/DwarfElfContext.cs:line 102
   at LibObjectFile.Tests.Dwarf.DwarfTests.TestDebugInfoSmall() in /LibObjectFile/src/LibObjectFile.Tests/Dwarf/DwarfTests.cs:line 326
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

@filipnavara
Copy link
Contributor Author

Yeah, the tests kinda work only on x64 and specific Ubuntu version (or the same version under WSL). They are extremely fragile since they compare readelf output (which changes with Binutils versions), and gcc-compiled objects. In this case the gcc output is arm64 and not the x64 one that is expected, and since gcc is not naturally a cross-compiler it's not easy to fix with a single flag.

TL;DR: The tests are fixed only enough to pass on Ubuntu 22.04 on x64, or Windows x64 with Ubuntu 22.04 in WSL. Anything else is going to fail one way or another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants