-
Notifications
You must be signed in to change notification settings - Fork 277
Allow platform-dependent snapshot test results #1270
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* empty file until we have multiple tests; if we glob only one test, insta | ||
omits the `@file.c` suffix from snapshots */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#![allow( | ||
dead_code, | ||
mutable_transmutes, | ||
non_camel_case_types, | ||
non_snake_case, | ||
non_upper_case_globals, | ||
unused_assignments, | ||
unused_mut | ||
)] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
source: c2rust-transpile/tests/snapshots.rs | ||
assertion_line: 69 | ||
expression: cat tests/snapshots/platform-specific/dummy.rs | ||
input_file: c2rust-transpile/tests/snapshots/platform-specific/dummy.c | ||
--- | ||
#![allow( | ||
dead_code, | ||
mutable_transmutes, | ||
non_camel_case_types, | ||
non_snake_case, | ||
non_upper_case_globals, | ||
unused_assignments, | ||
unused_mut | ||
)] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
source: c2rust-transpile/tests/snapshots.rs | ||
assertion_line: 69 | ||
expression: cat tests/snapshots/platform-specific/dummy.rs | ||
input_file: c2rust-transpile/tests/snapshots/platform-specific/dummy.c | ||
--- | ||
#![allow( | ||
dead_code, | ||
mutable_transmutes, | ||
non_camel_case_types, | ||
non_snake_case, | ||
non_upper_case_globals, | ||
unused_assignments, | ||
unused_mut | ||
)] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we generate the macOS snapshots on Linux easily? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no way to do so from Linux without a macOS VM; we need to compile against Apple's proprietary (though nominally open-source) headers. If we want to support macOS, this is the price we pay. We could improve the workflow by having snapshot .new files produced as an artifact from our macOS CI pipeline. |
||
source: c2rust-transpile/tests/snapshots.rs | ||
assertion_line: 67 | ||
expression: cat tests/snapshots/platform-specific/rotate.rs | ||
input_file: c2rust-transpile/tests/snapshots/platform-specific/rotate.c | ||
--- | ||
#![allow( | ||
dead_code, | ||
mutable_transmutes, | ||
non_camel_case_types, | ||
non_snake_case, | ||
non_upper_case_globals, | ||
unused_assignments, | ||
unused_mut | ||
)] | ||
#[no_mangle] | ||
pub unsafe extern "C" fn rotate_left_64( | ||
mut x: std::ffi::c_ulonglong, | ||
) -> std::ffi::c_ulonglong { | ||
return x.rotate_left(4 as std::ffi::c_int as std::ffi::c_ulonglong as u32); | ||
} | ||
#[no_mangle] | ||
pub unsafe extern "C" fn rotate_right_64( | ||
mut x: std::ffi::c_ulonglong, | ||
) -> std::ffi::c_ulonglong { | ||
return x.rotate_right(4 as std::ffi::c_int as std::ffi::c_ulonglong as u32); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this is a lot simpler way of doing this. This writes to stout? How does that work vs
/dev/null
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/dev/null
would be a more obvious bit-bucket, but rustc attempts to create temporary files in the output directory and can't for/dev
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What gets printed to stdout with
-
?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
--emit=link
contents, whatever they are. In this case the output is not captured, so it doesn't really matter what it is.