From a4b19de0fdf43fdb70579c4c10d96894a995e6ba Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 1 Sep 2021 23:15:07 +0200 Subject: [PATCH] Fix CI for exception and verify_message features --- .github/workflows/ci.yml | 12 +++++++++--- objc/src/message/mod.rs | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dce6d46f..ffd2a29d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,10 +116,16 @@ jobs: echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV echo "CPATH=/usr/local/include:$CPATH" >> $GITHUB_ENV - - name: Build and run tests + - name: Test uses: actions-rs/cargo@v1 with: command: test - # TODO: `objc/exception` feature is broken in objc_foundation - # TODO: `objc_foundation/block` feature doesn't work on GNUStep + # TODO: `objc_foundation/block` feature doesn't work args: --verbose --no-fail-fast --no-default-features + + - name: Test w. exception and verify_message features + uses: actions-rs/cargo@v1 + with: + command: test + # TODO: `objc_foundation/block` feature doesn't work + args: --verbose --no-fail-fast --no-default-features --features exception,verify_message diff --git a/objc/src/message/mod.rs b/objc/src/message/mod.rs index cd4ee710b..29660d8dc 100644 --- a/objc/src/message/mod.rs +++ b/objc/src/message/mod.rs @@ -11,10 +11,11 @@ use crate::{Encode, EncodeArguments, RefEncode}; macro_rules! objc_try { ($b:block) => { $crate::exception::catch_exception(|| $b).map_err(|exception| { + use alloc::borrow::ToOwned; if exception.is_null() { MessageError("Uncaught exception nil".to_owned()) } else { - MessageError(format!("Uncaught exception {:?}", &**exception)) + MessageError(alloc::format!("Uncaught exception {:?}", &**exception)) } }) };