History

Add test to run tests on 32 bit systems

Also adjust tests to run on 32 bit platforms.

Sebastian Thiel committed 3 years ago

Commit fb31ee81 parent c862d152 files · +26 −4Browse files

Unified · Split

2 files
  1. .github/workflows/ci.yml +21 −0
  2. gix/src/id.rs +5 −4
.github/workflows/ci.yml+21−0
@@ -79,6 +79,27 @@ jobs: · 78 unmodified lines
79 - name: "Test (nextest)"79 - name: "Test (nextest)"
80 run: cargo nextest run --all --no-fail-fast80 run: cargo nextest run --all --no-fail-fast
81 81
82 test-32bit:
83 runs-on: ubuntu-latest
84 env:
85 TARGET: i686-unknown-linux-gnu
86 steps:
87 - uses: actions/checkout@v3
88 - uses: dtolnay/rust-toolchain@stable
89 - uses: Swatinem/rust-cache@v2
90 - name: Install Rust
91 uses: dtolnay/rust-toolchain@master
92 with:
93 toolchain: stable
94 targets: ${{ env.TARGET }}
95 - uses: taiki-e/install-action@v1
96 with:
97 tool: cross
98 - name: "Test (unit)"
99 # run high-level unit tests that exercise a lot of code while being pure Rust to ease building test binaries.
100 # TODO: figure out why `git` doesn't pick up environment configuration so build scripts fail when using `-p gix`.
101 run: cross test -p gix-hashtable --target ${{ env.TARGET }}
102
82 installation:103 installation:
83 strategy:104 strategy:
84 matrix:105 matrix:
gix/src/id.rs+5−4
@@ -183,10 +183,11 @@ mod tests { · 182 unmodified lines
183 183
184 #[test]184 #[test]
185 fn size_of_oid() {185 fn size_of_oid() {
186 assert_eq!(186 let actual = std::mem::size_of::<Id<'_>>();
187 std::mem::size_of::<Id<'_>>(),187 let ceiling = 32;
188 32,188 assert!(
189 "size of oid shouldn't change without notice"189 actual <= ceiling,
190 "size of oid shouldn't change without notice: {actual} <= {ceiling}"
190 )191 )
191 }192 }
192}193}