blob: b0474d6f9e15e55060690709e01be4c05ace831b [file] [log] [blame]
Brian Silverman4e662aa2022-05-11 23:10:19 -07001// Copyright 2020 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9use autocxx_parser::UnsafePolicy;
10#[allow(unused_imports)]
11use syn::parse_quote;
12use syn::ItemMod;
13
14use crate::CppCodegenOptions;
15
16use super::BridgeConverter;
17
18// This mod is for tests which take bindgen output directly.
19// This should be avoided where possible, since these tests will
20// become obsolete or have to change if and when we update
21// bindgen. Instead, please add tests working directly from
22// the original C++ in integration_tests.rs if possible.
23// Also, if you're pasting in code from github issues, it's
24// important to make sure that the underlying code has an
25// acceptable license. That's why this file is currently blank.
26
27#[allow(dead_code)]
28fn do_test(input: ItemMod) {
29 let tc = parse_quote! {};
30 let bc = BridgeConverter::new(&[], &tc);
31 let inclusions = "".into();
32 bc.convert(
33 input,
34 UnsafePolicy::AllFunctionsSafe,
35 inclusions,
36 &CppCodegenOptions::default(),
37 )
38 .unwrap();
39}
40
41// How to add a test here
42//
43// #[test]
44// fn test_xyz() {
45// do_test(parse_quote!{ /* paste bindgen output here */})
46// }