133d722a9Sopenharmony_ciconst EXPECTED: &str = "\ 233d722a9Sopenharmony_cicxxbridge $VERSION 333d722a9Sopenharmony_ciDavid Tolnay <dtolnay@gmail.com> 433d722a9Sopenharmony_cihttps://github.com/dtolnay/cxx 533d722a9Sopenharmony_ci 633d722a9Sopenharmony_ciUsage: 733d722a9Sopenharmony_ci cxxbridge <input>.rs Emit .cc file for bridge to stdout 833d722a9Sopenharmony_ci cxxbridge <input>.rs --header Emit .h file for bridge to stdout 933d722a9Sopenharmony_ci cxxbridge --header Emit \"rust/cxx.h\" header to stdout 1033d722a9Sopenharmony_ci 1133d722a9Sopenharmony_ciArguments: 1233d722a9Sopenharmony_ci [input] 1333d722a9Sopenharmony_ci Input Rust source file containing #[cxx::bridge]. 1433d722a9Sopenharmony_ci 1533d722a9Sopenharmony_ciOptions: 1633d722a9Sopenharmony_ci --cfg <name=\"value\" | name[=true] | name=false> 1733d722a9Sopenharmony_ci Compilation configuration matching what will be used to build 1833d722a9Sopenharmony_ci the Rust side of the bridge. 1933d722a9Sopenharmony_ci 2033d722a9Sopenharmony_ci --cxx-impl-annotations <annotation> 2133d722a9Sopenharmony_ci Optional annotation for implementations of C++ function wrappers 2233d722a9Sopenharmony_ci that may be exposed to Rust. You may for example need to provide 2333d722a9Sopenharmony_ci __declspec(dllexport) or __attribute__((visibility(\"default\"))) 2433d722a9Sopenharmony_ci if Rust code from one shared object or executable depends on 2533d722a9Sopenharmony_ci these C++ functions in another. 2633d722a9Sopenharmony_ci 2733d722a9Sopenharmony_ci --header 2833d722a9Sopenharmony_ci Emit header with declarations only. Optional if using `-o` with 2933d722a9Sopenharmony_ci a path ending in `.h`. 3033d722a9Sopenharmony_ci 3133d722a9Sopenharmony_ci --help 3233d722a9Sopenharmony_ci Print help information. 3333d722a9Sopenharmony_ci 3433d722a9Sopenharmony_ci -i, --include <include> 3533d722a9Sopenharmony_ci Any additional headers to #include. The cxxbridge tool does not 3633d722a9Sopenharmony_ci parse or even require the given paths to exist; they simply go 3733d722a9Sopenharmony_ci into the generated C++ code as #include lines. 3833d722a9Sopenharmony_ci 3933d722a9Sopenharmony_ci -o, --output <output> 4033d722a9Sopenharmony_ci Path of file to write as output. Output goes to stdout if -o is 4133d722a9Sopenharmony_ci not specified. 4233d722a9Sopenharmony_ci 4333d722a9Sopenharmony_ci --version 4433d722a9Sopenharmony_ci Print version information. 4533d722a9Sopenharmony_ci"; 4633d722a9Sopenharmony_ci 4733d722a9Sopenharmony_ci#[test] 4833d722a9Sopenharmony_cifn test_help() { 4933d722a9Sopenharmony_ci let mut app = super::app(); 5033d722a9Sopenharmony_ci let mut out = Vec::new(); 5133d722a9Sopenharmony_ci app.write_long_help(&mut out).unwrap(); 5233d722a9Sopenharmony_ci let help = String::from_utf8(out).unwrap(); 5333d722a9Sopenharmony_ci let version = option_env!("CARGO_PKG_VERSION").unwrap_or_default(); 5433d722a9Sopenharmony_ci let expected = EXPECTED.replace("$VERSION", version); 5533d722a9Sopenharmony_ci assert_eq!(help, expected); 5633d722a9Sopenharmony_ci} 5733d722a9Sopenharmony_ci 5833d722a9Sopenharmony_ci#[test] 5933d722a9Sopenharmony_cifn test_cli() { 6033d722a9Sopenharmony_ci let app = super::app(); 6133d722a9Sopenharmony_ci app.debug_assert(); 6233d722a9Sopenharmony_ci} 63