diff options
| author | Martin Nordholts <enselic@gmail.com> | 2023-08-03 18:40:35 +0200 |
|---|---|---|
| committer | Martin Nordholts <enselic@gmail.com> | 2023-08-03 20:04:18 +0200 |
| commit | ea3b49f2f1ec0a11a4d17572d5a9160eb2425851 (patch) | |
| tree | 4ea725b943a3f8ce9ead0280f9bf33d40f7e0c04 /compiler/rustc_codegen_ssa/src/back/rpath | |
| parent | fcf3006e0133365ecd26894689c086387edcbecb (diff) | |
| download | rust-ea3b49f2f1ec0a11a4d17572d5a9160eb2425851.tar.gz rust-ea3b49f2f1ec0a11a4d17572d5a9160eb2425851.zip | |
Handle non-utf8 rpaths (fix FIXME)
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back/rpath')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/rpath/tests.rs | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/rpath/tests.rs b/compiler/rustc_codegen_ssa/src/back/rpath/tests.rs index 604f19144a6..ac2e54072c4 100644 --- a/compiler/rustc_codegen_ssa/src/back/rpath/tests.rs +++ b/compiler/rustc_codegen_ssa/src/back/rpath/tests.rs @@ -1,32 +1,33 @@ use super::RPathConfig; use super::{get_rpath_relative_to_output, minimize_rpaths, rpaths_to_flags}; +use std::ffi::OsString; use std::path::{Path, PathBuf}; #[test] fn test_rpaths_to_flags() { - let flags = rpaths_to_flags(&["path1".to_string(), "path2".to_string()]); + let flags = rpaths_to_flags(vec!["path1".into(), "path2".into()]); assert_eq!(flags, ["-Wl,-rpath,path1", "-Wl,-rpath,path2"]); } #[test] fn test_minimize1() { - let res = minimize_rpaths(&["rpath1".to_string(), "rpath2".to_string(), "rpath1".to_string()]); + let res = minimize_rpaths(&["rpath1".into(), "rpath2".into(), "rpath1".into()]); assert!(res == ["rpath1", "rpath2",]); } #[test] fn test_minimize2() { let res = minimize_rpaths(&[ - "1a".to_string(), - "2".to_string(), - "2".to_string(), - "1a".to_string(), - "4a".to_string(), - "1a".to_string(), - "2".to_string(), - "3".to_string(), - "4a".to_string(), - "3".to_string(), + "1a".into(), + "2".into(), + "2".into(), + "1a".into(), + "4a".into(), + "1a".into(), + "2".into(), + "3".into(), + "4a".into(), + "3".into(), ]); assert!(res == ["1a", "2", "4a", "3",]); } @@ -58,15 +59,15 @@ fn test_rpath_relative() { #[test] fn test_xlinker() { - let args = rpaths_to_flags(&["a/normal/path".to_string(), "a,comma,path".to_string()]); + let args = rpaths_to_flags(vec!["a/normal/path".into(), "a,comma,path".into()]); assert_eq!( args, vec![ - "-Wl,-rpath,a/normal/path".to_string(), - "-Wl,-rpath".to_string(), - "-Xlinker".to_string(), - "a,comma,path".to_string() + OsString::from("-Wl,-rpath,a/normal/path"), + OsString::from("-Wl,-rpath"), + OsString::from("-Xlinker"), + OsString::from("a,comma,path") ] ); } |
