Skip to content
Snippets Groups Projects
Commit fc7ab1b9 authored by nibon7's avatar nibon7 Committed by Leo
Browse files

testing/nushell: new aport


Closes #12522

Signed-off-by: default avatarnibon7 <nibon7@163.com>
parent c527b902
No related branches found
No related tags found
1 merge request!19325testing/nushell: new aport
From 82b6300dcb0874cf1b9c85675107a56b5b732390 Mon Sep 17 00:00:00 2001
From: nibon7 <nibon7@163.com>
Date: Mon, 15 Mar 2021 11:59:04 +0800
Subject: [PATCH] fix: cargo test failed with --release (#3183) (#3184)
Signed-off-by: nibon7 <nibon7@163.com>
---
crates/nu-test-support/src/fs.rs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/crates/nu-test-support/src/fs.rs b/crates/nu-test-support/src/fs.rs
index c9ef2fa2..74ba94b9 100644
--- a/crates/nu-test-support/src/fs.rs
+++ b/crates/nu-test-support/src/fs.rs
@@ -246,10 +246,15 @@ pub fn root() -> PathBuf {
}
pub fn binaries() -> PathBuf {
+ let mut build_type = "debug";
+ if !cfg!(debug_assertions) {
+ build_type = "release"
+ }
+
std::env::var("CARGO_TARGET_DIR")
.ok()
- .map(|target_dir| PathBuf::from(target_dir).join("debug"))
- .unwrap_or_else(|| root().join("target/debug"))
+ .map(|target_dir| PathBuf::from(target_dir).join(&build_type))
+ .unwrap_or_else(|| root().join(format!("target/{}", &build_type)))
}
pub fn fixtures() -> PathBuf {
--
2.26.2
# Contributor: nibon7 <nibon7@163.com>
# Maintainer: nibon7 <nibon7@163.com>
pkgname=nushell
pkgver=0.28.0
pkgrel=0
pkgdesc="A new type of shell"
url="https://www.nushell.sh"
arch="all !s390x !mips !mips64 !ppc64le" # limited by cargo, crate ring failed to build on ppc64le
license="MIT"
makedepends="cargo pkgconf openssl-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/nushell/nushell/archive/$pkgver.tar.gz
0001-fix-cargo-test-failed-with-release-3183-3184.patch
"
build() {
cargo build --release --locked
}
check() {
cargo test --release --locked
}
package() {
cargo install --locked --path . --root="$pkgdir/usr"
rm "$pkgdir"/usr/.crates*
}
sha512sums="41c4a0d61c840ab55707479b80f2f16797f83af333ba2dfc91c3fa1fa345abfa98c8be4e7153da6f2d71e8a1fcbff512361fe24adcbd5e0ff7f5c08e8de0e0dd nushell-0.28.0.tar.gz
ba9422ddfa93a0c41c8056a43d035ca6caf6f59dfbf4b75e0541b74efcb6e51fb811f9650e9b1f7bb5a8e56d7531e21c645661b493cfee9bfcdd36a6fc31ccdd 0001-fix-cargo-test-failed-with-release-3183-3184.patch"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment