diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bb72a84 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/nu-test-support-0.74.0.crate diff --git a/nu-test-support-test-gating.diff b/nu-test-support-test-gating.diff new file mode 100644 index 0000000..b074a02 --- /dev/null +++ b/nu-test-support-test-gating.diff @@ -0,0 +1,8 @@ +--- a/tests/get_system_locale.rs ++++ b/tests/get_system_locale.rs +@@ -1,3 +1,5 @@ ++#![cfg(debug_assertions)] ++ + use nu_test_support::locale_override::with_locale_override; + use nu_utils::get_system_locale; + use num_format::Grouping; diff --git a/rust-nu-test-support.spec b/rust-nu-test-support.spec new file mode 100644 index 0000000..2eb39b8 --- /dev/null +++ b/rust-nu-test-support.spec @@ -0,0 +1,73 @@ +# Generated by rust2rpm 23 +%bcond_without check +%global debug_package %{nil} + +%global crate nu-test-support + +Name: rust-nu-test-support +Version: 0.74.0 +Release: %autorelease +Summary: Support for writing Nushell tests + +License: MIT +URL: https://crates.io/crates/nu-test-support +Source: %{crates_source} +# fix for test code not gated identically to the implementation +# https://github.com/nushell/nushell/pull/7824 +Patch: nu-test-support-test-gating.diff + +BuildRequires: rust-packaging >= 21 + +%global _description %{expand: +Support for writing Nushell tests.} + +%description %{_description} + +%package devel +Summary: %{summary} +BuildArch: noarch + +%description devel %{_description} + +This package contains library source intended for building other packages which +use the "%{crate}" crate. + +%files devel +%license %{crate_instdir}/LICENSE +%{crate_instdir}/ + +%package -n %{name}+default-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+default-devel %{_description} + +This package contains library source intended for building other packages which +use the "default" feature of the "%{crate}" crate. + +%files -n %{name}+default-devel +%ghost %{crate_instdir}/Cargo.toml + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +# test fixtures are not shipped +%cargo_test -- -- \ + --skip playground::tests::current_working_directory_back_to_root_from_anywhere \ + --skip playground::tests::current_working_directory_in_sandbox_directory_created +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..b3a8626 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (nu-test-support-0.74.0.crate) = 28ac2934215bcf20f1fd6c4568719ce2e24b956b1e06301036683c3bbf395fdab2c8415aa65f5b01b145343e658fbefef7186bdf9687f67ecd2165d9c71597cb