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

Add tests: round-trip with object, and compare to llvm-ar #10

Merged
merged 1 commit into from
Apr 6, 2024

Conversation

dpaoliello
Copy link
Contributor

@dpaoliello dpaoliello commented Apr 5, 2024

Adds tests based on the round-trip tests from object.

Verifies:

  • Archives can be read with object and original object exactly matches what object read.
  • Archive exactly matches what llvm-ar generates.

There were two interesting issues:

Fixes #3

Cargo.toml Outdated Show resolved Hide resolved
tests/round_trip.rs Outdated Show resolved Hide resolved
@dpaoliello dpaoliello force-pushed the basictests branch 3 times, most recently from 2c50bfc to 663d148 Compare April 5, 2024 23:01
@dpaoliello dpaoliello changed the title Add basic tests that round-trip object generated archive members Add tests: round-trip with object, and compare to llvm-ar Apr 5, 2024
@dpaoliello
Copy link
Contributor Author

@bjorn3 I've also implemented tests that verify the output versus llvm-ar

@bjorn3
Copy link
Member

bjorn3 commented Apr 6, 2024

32-bit Darwin objects have an extra 4 bytes at the end (all 0x0F) but only when read with object.

Looks like those extra bytes are real and intententional:

https://github.com/llvm/llvm-project/blob/3d3ef9d073e1e27ea57480b371b7f5a9f5642ed2/llvm/lib/Object/ArchiveWriter.cpp#L560-L565

Copy link
Member

@bjorn3 bjorn3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the extra newline. Thanks!

rust-toolchain.toml Outdated Show resolved Hide resolved
@dpaoliello dpaoliello requested a review from bjorn3 April 6, 2024 18:33
@bjorn3 bjorn3 merged commit 0bd52bf into rust-lang:master Apr 6, 2024
2 checks passed
@dpaoliello dpaoliello deleted the basictests branch April 8, 2024 17:02
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

Successfully merging this pull request may close these issues.

Add testing infrastructure
2 participants