diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2023-10-16 16:02:28 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2024-02-23 09:48:32 -0800 |
commit | e7f20efc8bd123bfc2c325198866850694612a23 (patch) | |
tree | f4c08b4bf94d9a429322f25a3ab9b1e1f39c539e /test cases/rust | |
parent | 9752b89100a9ffc42a6eb4a788f806958bda1107 (diff) | |
download | meson-e7f20efc8bd123bfc2c325198866850694612a23.zip meson-e7f20efc8bd123bfc2c325198866850694612a23.tar.gz meson-e7f20efc8bd123bfc2c325198866850694612a23.tar.bz2 |
modules/rust: allow setting a version constraint on bindgen
This allows us to ensure that the bindgen we're using is suitable for
our purpose.
Diffstat (limited to 'test cases/rust')
-rw-r--r-- | test cases/rust/12 bindgen/meson.build | 9 | ||||
-rw-r--r-- | test cases/rust/12 bindgen/test.json | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/test cases/rust/12 bindgen/meson.build b/test cases/rust/12 bindgen/meson.build index 0957581..a88ed81 100644 --- a/test cases/rust/12 bindgen/meson.build +++ b/test cases/rust/12 bindgen/meson.build @@ -32,13 +32,18 @@ if result.returncode() != 0 error('MESON_SKIP_TEST bindgen does not seem to work') endif +rust = import('unstable-rust') + +# Check version, this case is obviously impossible +testcase expect_error('Program \'bindgen\' not found or not executable') + rust.bindgen(input : 'include/other.h', output : 'other.rs', bindgen_version : ['< 0.1', '> 10000']) +endtestcase + # This is to test the include_directories argument to bindgen inc = include_directories('include') c_lib = static_library('clib', 'src/source.c', include_directories : inc) -rust = import('unstable-rust') - gen = rust.bindgen( input : 'src/header.h', output : 'header.rs', diff --git a/test cases/rust/12 bindgen/test.json b/test cases/rust/12 bindgen/test.json index 25fafd2..a3b7e29 100644 --- a/test cases/rust/12 bindgen/test.json +++ b/test cases/rust/12 bindgen/test.json @@ -4,7 +4,7 @@ }, "stdout": [ { - "line": "test cases/rust/12 bindgen/meson.build:42: WARNING: Project targets '>= 0.63' but uses feature introduced in '1.0.0': \"rust.bindgen\" keyword argument \"include_directories\" of type array[str]." + "line": "test cases/rust/12 bindgen/meson.build:47: WARNING: Project targets '>= 0.63' but uses feature introduced in '1.0.0': \"rust.bindgen\" keyword argument \"include_directories\" of type array[str]." } ] } |