Brian Silverman | cc09f18 | 2022-03-09 15:40:20 -0800 | [diff] [blame^] | 1 | #[test] |
| 2 | fn test() { |
| 3 | // our source file should be readable |
| 4 | let source_file = std::fs::read_to_string(env!("SOURCE_FILE")).unwrap(); |
| 5 | assert_eq!(source_file, "source\n"); |
| 6 | // our generated data file should be readable at run time and build time |
| 7 | let generated_data = std::fs::read_to_string(env!("GENERATED_DATA_ROOT")).unwrap(); |
| 8 | let generated_data2 = include_str!(env!("GENERATED_DATA_ABS")); |
| 9 | assert_eq!(generated_data, generated_data2); |
| 10 | // and we should be able to read (and thus execute) our tool |
| 11 | assert!(!std::fs::read(env!("SOME_TOOL")).unwrap().is_empty()); |
| 12 | } |