Skip to content

Make the test of jemalloc optional #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

statiolake
Copy link
Contributor

Jemalloc は Windows (MSVC) ではサポートされていないため、現状 Windows でこれらのテストを実行するには一々 jemalloc 系の依存とテストを削除しなければなりません。これは面倒ですし、編集した Cargo.toml やテストの削除を誤ってコミットに含んでしまう危険性もあります。

本来ならば Unix 環境でだけこのテストを有効化できればよかったのですが、おそらくこのあたりで議論はされているものの現状の解決はないように見えます。とりあえず jemalloc 関連の機能をフィーチャー jemalloc でまとめ、このフィーチャーが有効なときだけテストを実行することにしました。とはいえ実行を忘れてしまっても困るのでこれはデフォルトフィーチャーにしておきます。 Windows でテストする方がいらっしゃれば cargo test --no-default-features とすれば jemalloc を無視してテストをします。

より良い方法があればぜひお教えください。

Jemalloc is not supported on Windows (MSVC).  There's no way to run
tests of other crates without manually removing jemalloc dependencies
and integration tests.  This may lead some mistake (e.g. including
jemalloc removed `Cargo.toml` to the commit mistakenly) so I want to
make easier to ignore the test on Windows.

Now, the test will be run only when `jemalloc` feature is enabled.

Note that the feature is default feature, since completely ignoring the
test by default will forget running the test forever.  So `cargo test`
will run the test usually.  To ignore the test, run `cargo test
--no-default-features` to disable `jemalloc` feature.
@statiolake statiolake merged commit a1c1635 into rust-lang-ja:ja-all-enabled Sep 3, 2019
@statiolake statiolake deleted the windows-jemallocator branch September 3, 2019 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant