Skip to content

Commit

Permalink
bins: Fix static tests
Browse files Browse the repository at this point in the history
This ony fixes the static issue for the binaries built in this repo, you
will need to define these yourself if using backhand as a library!

See:
- #150
- alexcrichton/xz2-rs#105
- alexcrichton/xz2-rs#111
  • Loading branch information
wcampbell0x2a committed May 31, 2023
1 parent 53950b7 commit d088d07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
[env]
# 1. Always remove debug asserts
#
# 2. Enable decoder/endocder
# TODO: This should be done upstream! See the following issues:
# - https://github.com/wcampbell0x2a/backhand/issues/150
# - https://github.com/alexcrichton/xz2-rs/issues/105
# - https://github.com/alexcrichton/xz2-rs/pull/111
CFLAGS = "-D NDEBUG=1 -D HAVE_DECODER_ARM=1 -D HAVE_ENCODER_ARM=1 -D HAVE_DECODER_ARM64=1 -D HAVE_ENCODER_ARM64=1 -D HAVE_DECODER_ARMTHUMB=1 -D HAVE_ENCODER_ARMTHUMB=1"

[target."x86_64-unknown-linux-musl"]
rustflags = ["-C", "target-feature=+crt-static"]
2 changes: 0 additions & 2 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ fn test_openwrt_tplink_archera7v5() {

#[test]
#[cfg(feature = "xz")]
#[cfg(not(feature = "xz-static"))]
fn test_openwrt_netgear_ex6100v2() {
const FILE_NAME: &str = "openwrt-22.03.2-ipq40xx-generic-netgear_ex6100v2-squashfs-factory.img";

Expand Down Expand Up @@ -296,7 +295,6 @@ fn test_appimage_firefox() {
/// (after ubi_extract_image)
#[test]
#[cfg(feature = "xz")]
#[cfg(not(feature = "xz-static"))]
fn test_tplink_ax1800() {
const FILE_NAME: &str = "img-1571203182_vol-ubi_rootfs.ubifs";
let asset_defs = [TestAssetDef {
Expand Down

0 comments on commit d088d07

Please sign in to comment.