get the build static library linked with coverage
(deopt: &Deopt, use_shared: bool)
| 770 | |
| 771 | /// get the build static library linked with coverage |
| 772 | pub fn get_cov_lib_path(deopt: &Deopt, use_shared: bool) -> &'static PathBuf { |
| 773 | static SHARE_PATH: OnceCell<PathBuf> = OnceCell::new(); |
| 774 | if use_shared { |
| 775 | return SHARE_PATH.get_or_init(|| { |
| 776 | let lib_name = deopt.config.dyn_lib_name.clone(); |
| 777 | let lib_name = lib_name.strip_suffix(".so").unwrap(); |
| 778 | let cov_lib = format!("{}_cov.so", lib_name); |
| 779 | let lib_path: PathBuf = |
| 780 | [deopt.get_library_build_lib_path().unwrap(), cov_lib.into()] |
| 781 | .iter() |
| 782 | .collect(); |
| 783 | lib_path |
| 784 | }); |
| 785 | } |
| 786 | static STATIC_PATH: OnceCell<PathBuf> = OnceCell::new(); |
| 787 | STATIC_PATH.get_or_init(|| { |
| 788 | let lib_name = deopt.config.static_lib_name.clone(); |
| 789 | let lib_name = lib_name.strip_suffix(".a").unwrap(); |
| 790 | let cov_lib = format!("{}_cov.a", lib_name); |
| 791 | let lib_path: PathBuf = [deopt.get_library_build_lib_path().unwrap(), cov_lib.into()] |
| 792 | .iter() |
| 793 | .collect(); |
| 794 | lib_path |
| 795 | }) |
| 796 | } |
| 797 | |
| 798 | pub fn get_file_dirname(path: &Path) -> PathBuf { |
| 799 | if path.is_dir() { |
no test coverage detected