diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2023-06-22 09:56:11 -0700 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2023-06-27 11:53:18 -0700 |
| commit | 5d16bd5308f0edd9d53b82ff6a961241c7188423 (patch) | |
| tree | 7f10cb909d47e18479dd824d25c3c62cb4668cd0 /test cases | |
| parent | c5b16ab8b957d53b75c73bb24144a4f61c86234d (diff) | |
| download | meson-5d16bd5308f0edd9d53b82ff6a961241c7188423.tar.gz | |
modules/rust: Add a keyword argument to pass extra args to the rust compiler
This may be necessary to, for example, stop rustc complaining about
unused functions
Diffstat (limited to 'test cases')
| -rw-r--r-- | test cases/rust/9 unit tests/meson.build | 10 | ||||
| -rw-r--r-- | test cases/rust/9 unit tests/test3.rs | 7 |
2 files changed, 12 insertions, 5 deletions
diff --git a/test cases/rust/9 unit tests/meson.build b/test cases/rust/9 unit tests/meson.build index 909601430..94cc400d4 100644 --- a/test cases/rust/9 unit tests/meson.build +++ b/test cases/rust/9 unit tests/meson.build @@ -31,17 +31,17 @@ test( suite : ['foo'], ) -exe = executable('rust_exe', ['test2.rs', 'test.rs']) +exe = executable('rust_exe', ['test2.rs', 'test.rs'], build_by_default : false) rust = import('unstable-rust') rust.test('rust_test_from_exe', exe, should_fail : true) -lib = static_library('rust_static', ['test.rs']) +lib = static_library('rust_static', ['test.rs'], build_by_default : false) rust.test('rust_test_from_static', lib, args: ['--skip', 'test_add_intentional_fail']) -lib = shared_library('rust_shared', ['test.rs']) +lib = shared_library('rust_shared', ['test.rs'], build_by_default : false) rust.test('rust_test_from_shared', lib, args: ['--skip', 'test_add_intentional_fail']) helper = static_library('helper', 'helper.rs') -lib = static_library('rust_link_with', 'test3.rs') -rust.test('rust_test_link_with', lib, link_with : helper) +lib = static_library('rust_link_with', 'test3.rs', build_by_default : false) +rust.test('rust_test_link_with', lib, link_with : helper, rust_args : ['--cfg', 'broken="false"']) diff --git a/test cases/rust/9 unit tests/test3.rs b/test cases/rust/9 unit tests/test3.rs index ccb5f9800..6d538a059 100644 --- a/test cases/rust/9 unit tests/test3.rs +++ b/test cases/rust/9 unit tests/test3.rs @@ -8,6 +8,13 @@ mod tests { use super::*; + // This is an intentinally broken test that should be turned off by extra rust arguments + #[cfg(not(broken = "false"))] + #[test] + fn test_broken() { + assert_eq!(0, 5); + } + #[test] fn test_add_sub() { let x = helper::subtract(6, 5); |
