()
| 238 | |
| 239 | #[test] |
| 240 | fn test_deserialize_exec_target() { |
| 241 | let yaml = r#" |
| 242 | benchmarks: |
| 243 | - exec: ls -al /nix/store |
| 244 | - name: my exec benchmark |
| 245 | exec: ./my_binary |
| 246 | options: |
| 247 | warmup-time: 1s |
| 248 | "#; |
| 249 | let config: ProjectConfig = serde_yaml::from_str(yaml).unwrap(); |
| 250 | let benchmarks = config.benchmarks.unwrap(); |
| 251 | assert_eq!(benchmarks.len(), 2); |
| 252 | |
| 253 | assert_eq!( |
| 254 | benchmarks[0].command, |
| 255 | TargetCommand::Exec { |
| 256 | exec: "ls -al /nix/store".to_string() |
| 257 | } |
| 258 | ); |
| 259 | assert!(benchmarks[0].name.is_none()); |
| 260 | |
| 261 | assert_eq!( |
| 262 | benchmarks[1].command, |
| 263 | TargetCommand::Exec { |
| 264 | exec: "./my_binary".to_string() |
| 265 | } |
| 266 | ); |
| 267 | assert_eq!(benchmarks[1].name, Some("my exec benchmark".to_string())); |
| 268 | let walltime = benchmarks[1] |
| 269 | .options |
| 270 | .as_ref() |
| 271 | .unwrap() |
| 272 | .walltime |
| 273 | .as_ref() |
| 274 | .unwrap(); |
| 275 | assert_eq!(walltime.warmup_time, Some("1s".to_string())); |
| 276 | } |
| 277 | |
| 278 | #[test] |
| 279 | fn test_deserialize_entrypoint_target() { |
nothing calls this directly
no outgoing calls
no test coverage detected