cmake_parser/doc/command/ctest/
ctest_empty_binary_directory.rs1use cmake_parser_derive::CMake;
2
3use crate::{
4 doc::command_scope::{CommandScope, ToCommandScope},
5 Token,
6};
7
8#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
12#[cmake(pkg = "crate", positional)]
13pub struct CTestEmptyBinaryDirectory<'t> {
14 pub directory: Token<'t>,
15}
16
17impl<'t> ToCommandScope for CTestEmptyBinaryDirectory<'t> {
18 fn to_command_scope(&self) -> CommandScope {
19 CommandScope::CTest
20 }
21}
22
23#[cfg(test)]
24mod tests {
25 use super::*;
26 use crate::doc::cmake_parse::tests::token;
27 use crate::*;
28 use pretty_assertions::assert_eq;
29
30 #[test]
31 fn ctest_empty_binary_directory() {
32 let src =
33 include_bytes!("../../../../../fixture/commands/ctest/ctest_empty_binary_directory");
34 let cmakelists = parse_cmakelists(src).unwrap();
35 let doc = Doc::from(cmakelists);
36 assert_eq!(
37 doc.commands(),
38 Ok(vec![Command::CTestEmptyBinaryDirectory(Box::new(
39 CTestEmptyBinaryDirectory {
40 directory: token(b"directory1"),
41 }
42 )),])
43 )
44 }
45}