Add unittest accepted/tizen_9.0_unified accepted/tizen_rust accepted/tizen_unified accepted/tizen_unified_dev accepted/tizen_unified_x tizen tizen_9.0 accepted/tizen/9.0/unified/20241030.233047 accepted/tizen/rust/20231016.021526 accepted/tizen/unified/20240328.122641 accepted/tizen/unified/dev/20240620.001936 accepted/tizen/unified/x/20240328.130747 tizen_9.0_m2_release
authorWoohyun Jung <wh0705.jung@samsung.com>
Tue, 25 Apr 2023 09:20:56 +0000 (18:20 +0900)
committerWoohyun Jung <wh0705.jung@samsung.com>
Tue, 25 Apr 2023 09:20:56 +0000 (18:20 +0900)
[   23s] + ./num_cpus
[   23s]
[   23s] running 15 tests
[   23s] test linux::tests::v1::test_cgroup_cpu_quota ... ok
[   23s] test linux::tests::v1::test_cgroup_cpu_quota_ceil ... ok
[   23s] test linux::tests::v1::test_cgroup_cpu_quota_divide_by_zero ... ok
[   23s] test linux::tests::v1::test_cgroup_mount ... ok
[   23s] test linux::tests::v1::test_load_mountinfo ... ok
[   23s] test linux::tests::v1::test_load_subsys ... ok
[   23s] test linux::tests::v2::test_cgroup_cpu_quota ... ok
[   23s] test linux::tests::v2::test_cgroup_cpu_quota_ceil ... ok
[   23s] test linux::tests::v2::test_cgroup_cpu_quota_divide_by_zero ... ok
[   23s] test linux::tests::v2::test_cgroup_mount ... ok
[   23s] test linux::tests::v2::test_load_mountinfo ... ok
[   23s] test linux::tests::v2::test_load_subsys ... ok
[   23s] test linux::tests::v2::test_load_subsys_multi ... ok
[   23s] test tests::test_get ... ok
[   23s] test tests::test_get_physical ... ok
[   23s]
[   23s] test result: ok. 15 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s

packaging/rust-num_cpus.spec

index 4ed1e81..508ee3b 100644 (file)
@@ -43,6 +43,17 @@ cp %{SOURCE1} .
         --extern libc=%{_rust_dylibdir}/liblibc.so \
         ./src/lib.rs
 
+%check
+%if 0%{?run_tests}
+%{rustc_std_build} --test --crate-type=dylib \
+        --crate-name=%{real_crate_name} \
+        %{?rustc_edition:--edition=%{rustc_edition}} \
+        --extern libc=%{_rust_dylibdir}/liblibc.so \
+        ./src/lib.rs
+
+./%{real_crate_name}
+%endif
+
 # ==========================================================
 # install section
 # ==========================================================