Support Wasi as target (#216)

* Improve features
* Add wasm32-wasi as a target
* Update .github/workflows/ci.yml
Co-authored-by: morenol <22335041+morenol@users.noreply.github.com>
This commit is contained in:
Lorenzo
2022-11-02 15:22:38 +00:00
committed by GitHub
parent b60329ca5d
commit cfbd45bfc0
64 changed files with 583 additions and 150 deletions
+12 -3
View File
@@ -102,7 +102,10 @@ pub fn mutual_info_score(contingency: &[Vec<usize>]) -> f64 {
mod tests {
use super::*;
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
#[cfg_attr(
all(target_arch = "wasm32", not(target_os = "wasi")),
wasm_bindgen_test::wasm_bindgen_test
)]
#[test]
fn contingency_matrix_test() {
let v1 = vec![0, 0, 1, 1, 2, 0, 4];
@@ -114,7 +117,10 @@ mod tests {
);
}
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
#[cfg_attr(
all(target_arch = "wasm32", not(target_os = "wasi")),
wasm_bindgen_test::wasm_bindgen_test
)]
#[test]
fn entropy_test() {
let v1 = vec![0, 0, 1, 1, 2, 0, 4];
@@ -122,7 +128,10 @@ mod tests {
assert!((1.2770 - entropy(&v1).unwrap() as f64).abs() < 1e-4);
}
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
#[cfg_attr(
all(target_arch = "wasm32", not(target_os = "wasi")),
wasm_bindgen_test::wasm_bindgen_test
)]
#[test]
fn mutual_info_score_test() {
let v1 = vec![0, 0, 1, 1, 2, 0, 4];