Also adjust tests to run on 32 bit platforms.
Unified · Split
| @@ -79,6 +79,27 @@ jobs: · 78 unmodified lines | ||
| 79 | 79 | - name: "Test (nextest)" |
| 80 | 80 | 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 | 103 | installation: |
| 83 | 104 | strategy: |
| 84 | 105 | matrix: |
| @@ -183,10 +183,11 @@ mod tests { · 182 unmodified lines | ||
| 183 | 183 | |
| 184 | 184 | #[test] |
| 185 | 185 | fn size_of_oid() { |
| 186 | − assert_eq!( | |
| 187 | − std::mem::size_of::<Id<'_>>(), | |
| 188 | − 32, | |
| 189 | − "size of oid shouldn't change without notice" | |
| 186 | + let actual = std::mem::size_of::<Id<'_>>(); | |
| 187 | + let ceiling = 32; | |
| 188 | + assert!( | |
| 189 | + actual <= ceiling, | |
| 190 | + "size of oid shouldn't change without notice: {actual} <= {ceiling}" | |
| 190 | 191 | ) |
| 191 | 192 | } |
| 192 | 193 | } |