Skip to content

Commit c4b9026

Browse files
committed
612d87a ci: Run unit tests on Mac OS (Christian Lewe) 491a88d chore: Remove outdated tests (Christian Lewe) 5954df7 fix: uint_fast types on mac os (Christian Lewe) 6bdcca9 fix: fuzz CI (Christian Lewe) Pull request description: Fixes BlockstreamResearch#257 I added a CI job to check unit tests on Windows and Mac OS. ACKs for top commit: apoelstra: ACK 612d87a; successfully ran local tests Tree-SHA512: a2aa0a8ce6e5a32d4e43859fc7657a0878299ec1f24b1c1d6b0a67a7d91e99bccb219c83326832dcb5b745a2ae26afcd65ef946fd551393f3c4dd7f409378603
2 parents e41ca4c + 612d87a commit c4b9026

File tree

5 files changed

+25
-11
lines changed

5 files changed

+25
-11
lines changed

.github/workflows/fuzz.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ parse_human,
4343
components: "llvm-tools-preview"
4444

4545
- name: Install Dependencies
46-
run: cargo update && cargo update -p cc --precise 1.0.83 && cargo install cargo-fuzz
46+
run: cargo update && cargo update -p cc --precise 1.0.83 && cargo install --force cargo-fuzz
4747

4848
- name: Run Fuzz Target
4949
run: ./fuzz/fuzz.sh "${{ matrix.fuzz_target }}"

.github/workflows/main.yml

+16
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,19 @@ jobs:
101101
components: clippy
102102
- name: Running cargo clippy
103103
run: cargo clippy --all-targets -- --deny warnings
104+
105+
test-other-platforms:
106+
name: Test
107+
runs-on: ${{ matrix.os }}
108+
strategy:
109+
matrix:
110+
os: [macos-latest]
111+
steps:
112+
- name: Checkout Crate
113+
uses: actions/checkout@v4
114+
- name: Checkout Toolchain
115+
uses: dtolnay/rust-toolchain@stable
116+
- name: Set dependencies
117+
run: cp Cargo-recent.lock Cargo.lock
118+
- name: Run unit tests
119+
run: cargo test --locked --workspace --all-features

fuzz/generate-files.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ simplicity-lang = { path = "..", features = ["test-utils"] }
2626
2727
[dev-dependencies]
2828
base64 = "0.22.1"
29+
30+
[lints.rust]
31+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }
2932
EOF
3033

3134
for targetFile in $(listTargetFiles); do
@@ -85,7 +88,7 @@ $(for name in $(listTargetNames); do echo "$name,"; done)
8588
components: "llvm-tools-preview"
8689
8790
- name: Install Dependencies
88-
run: cargo update && cargo update -p cc --precise 1.0.83 && cargo install cargo-fuzz
91+
run: cargo update && cargo update -p cc --precise 1.0.83 && cargo install --force cargo-fuzz
8992
9093
- name: Run Fuzz Target
9194
run: ./fuzz/fuzz.sh "\${{ matrix.fuzz_target }}"

simplicity-sys/src/c_jets/c_env.rs

-5
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,10 @@ mod tests {
231231
use std::mem::{align_of, size_of};
232232

233233
use crate::c_jets::{c_env::*, frame_ffi::*};
234-
use crate::ffi::*;
235234

236235
#[test]
237236
fn test_sizes() {
238237
unsafe {
239-
assert_eq!(size_of::<u32>(), c_sizeof_ubounded);
240-
assert_eq!(size_of::<usize>(), c_sizeof_UWORD);
241238
assert_eq!(size_of::<CFrameItem>(), c_sizeof_frameItem);
242239
assert_eq!(size_of::<CRawBuffer>(), c_sizeof_rawBuffer);
243240
assert_eq!(size_of::<CRawInput>(), c_sizeof_rawInput);
@@ -251,8 +248,6 @@ mod tests {
251248
#[test]
252249
fn test_aligns() {
253250
unsafe {
254-
assert_eq!(align_of::<u32>(), c_alignof_ubounded);
255-
assert_eq!(align_of::<usize>(), c_alignof_UWORD);
256251
assert_eq!(align_of::<CFrameItem>(), c_alignof_frameItem);
257252
assert_eq!(align_of::<CRawBuffer>(), c_alignof_rawBuffer);
258253
assert_eq!(align_of::<CRawInput>(), c_alignof_rawInput);

simplicity-sys/src/ffi.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ pub type c_int = i32;
1919
pub type c_uint = u32;
2020
pub type c_size_t = usize;
2121
pub type c_uint_fast8_t = u8;
22-
#[cfg(target_arch = "wasm32")]
22+
#[cfg(any(target_arch = "wasm32", target_arch = "aarch64"))]
2323
pub type c_uint_fast16_t = u16;
24-
#[cfg(not(target_arch = "wasm32"))]
24+
#[cfg(not(any(target_arch = "wasm32", target_arch = "aarch64")))]
2525
pub type c_uint_fast16_t = usize;
26-
#[cfg(target_arch = "wasm32")]
26+
#[cfg(any(target_arch = "wasm32", target_arch = "aarch64"))]
2727
pub type c_uint_fast32_t = u32;
28-
#[cfg(not(target_arch = "wasm32"))]
28+
#[cfg(not(any(target_arch = "wasm32", target_arch = "aarch64")))]
2929
pub type c_uint_fast32_t = usize;
3030
#[cfg(target_arch = "wasm32")]
3131
pub type c_uint_fast64_t = u64;

0 commit comments

Comments
 (0)