From 29db677a9e88494cea5f93201f8ece63d51b050a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Arroyo=20Calle?= Date: Sat, 16 Jan 2021 19:10:50 +0100 Subject: [PATCH 1/5] GitHub Actions --- .github/workflows/test.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..a8392bd3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +name: Test +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, windows-2019, macos-11.0] + rust-version: [stable, beta] + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust-version }} + override: true + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + args: --verbose -- -D warnings + - name: Test + uses: actions-rs/cargo@v1 + with: + command: test + args: --verbose --all + - name: Num tests + uses: actions-rs/cargo@v1 + continue-on-error: true + with: + command: test + args: --verbose --all --no-default-features --features num From def33a77dac63bf14e8fca37b03ce0546c112a78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Arroyo=20Calle?= Date: Sat, 16 Jan 2021 19:11:07 +0100 Subject: [PATCH 2/5] Delete Travis CI --- .travis.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 001bb6b6..00000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: rust -cache: cargo -os: linux -dist: xenial - -before_script: - - cargo fetch - -jobs: - allow_failures: - env: - - CAN_FAIL=true - include: - - stage: "Stable: Build" - rust: stable - script: cargo rustc --verbose -- -D warnings - name: "Build Stable" - - stage: "Stable: Tests" - rust: stable - script: cargo test --verbose --all - name: "Tests Stable" - - stage: "Features" - rust: stable - script: cargo test --verbose --all --no-default-features --features num - name: "num Tests" - env: CAN_FAIL=true - - stage: "Beta: Build" - # - # - rust: beta - script: cargo rustc --verbose -- -D warnings - name: "Build Beta" From aea0570d2b7e832c37ddeefa09c0c96ca892ae34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Arroyo=20Calle?= Date: Sat, 16 Jan 2021 19:12:53 +0100 Subject: [PATCH 3/5] Minor fix --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8392bd3..c9567cb9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: - name: Build uses: actions-rs/cargo@v1 with: - command: build + command: rustc args: --verbose -- -D warnings - name: Test uses: actions-rs/cargo@v1 From 2ed2e6d62f425389f8e597e2ef267a9f4b259883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Arroyo=20Calle?= Date: Sat, 16 Jan 2021 22:00:05 +0100 Subject: [PATCH 4/5] Disable Windows --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c9567cb9..07af5629 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, windows-2019, macos-11.0] + os: [ubuntu-20.04, macos-11.0] rust-version: [stable, beta] steps: - name: Checkout sources From 1d538ee70c67fdb9b77b7a0d9d236dbebdcbd346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Arroyo=20Calle?= Date: Sat, 16 Jan 2021 22:32:50 +0100 Subject: [PATCH 5/5] Fix Beta --- src/machine/machine_state_impl.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/machine/machine_state_impl.rs b/src/machine/machine_state_impl.rs index 0e4a4e1c..5de07140 100644 --- a/src/machine/machine_state_impl.rs +++ b/src/machine/machine_state_impl.rs @@ -3130,9 +3130,14 @@ impl MachineState { ) { let interrupted = INTERRUPT.load(std::sync::atomic::Ordering::Relaxed); - if INTERRUPT.compare_and_swap(interrupted, false, std::sync::atomic::Ordering::Relaxed) { - self.throw_interrupt_exception(); - return; + match INTERRUPT.compare_exchange(interrupted, false, std::sync::atomic::Ordering::Relaxed, std::sync::atomic::Ordering::Relaxed) { + Ok(interruption) => { + if interruption { + self.throw_interrupt_exception(); + return; + } + }, + Err(_) => unreachable!() } let mut default_call_policy: Box = Box::new(DefaultCallPolicy {});