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 #![feature(test)] 6 extern crate test; 7 8 chromium::import! { 9 "//build/rust/tests/test_rust_static_library"; 10 } 11 12 use test::Bencher; 13 use test_rust_static_library::add_two_ints_via_rust; 14 15 #[test] test_call_into_mixed_static_library()16fn test_call_into_mixed_static_library() { 17 assert_eq!(add_two_ints_via_rust(5, 7), 12) 18 } 19 20 #[allow(soft_unstable)] 21 #[bench] test_benchmark(b: &mut Bencher)22fn test_benchmark(b: &mut Bencher) { 23 b.iter(|| 2 + 2); 24 } 25