| 771 | |
| 772 | #[test] |
| 773 | fn smoke_checks_every_case() { |
| 774 | let dir = tempfile::tempdir().unwrap(); |
| 775 | let output = dir.path().join("report.json"); |
| 776 | run(Config { |
| 777 | output: output.clone(), |
| 778 | files_east: 2, |
| 779 | files_west: 2, |
| 780 | lines: 8, |
| 781 | edits: 1, |
| 782 | iterations: 1, |
| 783 | warmups: 0, |
| 784 | allow_debug: true, |
| 785 | keep_fixtures: false, |
| 786 | span: true, |
| 787 | }) |
| 788 | .unwrap(); |
| 789 | let report: serde_json::Value = serde_json::from_slice(&fs::read(output).unwrap()).unwrap(); |
| 790 | let samples = report["samples"].as_array().unwrap(); |
| 791 | assert_eq!(samples.len(), CASES.len()); |
| 792 | for sample in samples { |
| 793 | assert!(sample["total_ns"].as_u64().unwrap() > 0); |
| 794 | assert!(sample["verified_files"].as_u64().unwrap() > 0); |
| 795 | } |
| 796 | let partial: Vec<_> = samples |
| 797 | .iter() |
| 798 | .filter(|s| s["case"].as_str().unwrap().contains("partial")) |
| 799 | .collect(); |
| 800 | assert_eq!(partial.len(), 1); |
| 801 | assert_eq!(partial[0]["case"].as_str().unwrap(), "atomic_rpc_partial"); |
| 802 | assert_eq!(partial[0]["verified_files"].as_u64().unwrap(), 2); |
| 803 | } |
| 804 | } |