1 // Copyright 2021 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 use test_rlib_crate::say_hello_from_crate;
6
main()7 fn main() {
8 assert_eq!(test_proc_macro_crate::calculate_using_proc_macro!(), 30);
9 assert_eq!(test_rust_static_library::add_two_ints_via_rust(3, 4), 7);
10 assert_eq!(test_rust_static_library_non_standard_arrangement::do_subtract(4, 3), 1);
11 say_hello_from_crate();
12 }
13
14 /// These tests are largely all to just test different permutations of builds,
15 /// e.g. calling into mixed_static_librarys, crates, proc macros, etc.
16 #[cfg(test)]
17 mod tests {
18 #[test]
test_call_to_rust()19 fn test_call_to_rust() {
20 assert_eq!(test_rust_static_library::add_two_ints_via_rust(3, 4), 7);
21 }
22
23 #[test]
test_call_to_rust_non_standard_arrangement()24 fn test_call_to_rust_non_standard_arrangement() {
25 assert_eq!(test_rust_static_library_non_standard_arrangement::do_subtract(8, 4), 4);
26 }
27
28 #[test]
test_proc_macro()29 fn test_proc_macro() {
30 assert_eq!(test_proc_macro_crate::calculate_using_proc_macro!(), 30)
31 }
32 }
33