diff options
| author | Mark Schulte <mark@mjs.pw> | 2017-04-12 23:04:13 -0700 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-03-15 11:42:36 +0100 |
| commit | 647bd2839e83267bf92fc5909f1b86e630bf395f (patch) | |
| tree | 20b7224d00bbe161ee245c88e4db47628654feab /test cases | |
| parent | 66db1af4dd4905426cc7e11e335e1e4788d267d4 (diff) | |
| download | meson-647bd2839e83267bf92fc5909f1b86e630bf395f.tar.gz | |
[modules] Add kconfig module
Add a kconfig module to allow meson to integrate with existing projects
that use kconfig.
Diffstat (limited to 'test cases')
| -rw-r--r-- | test cases/kconfig/1 basic/.config | 3 | ||||
| -rw-r--r-- | test cases/kconfig/1 basic/meson.build | 16 | ||||
| -rw-r--r-- | test cases/kconfig/2 subdir/.config | 2 | ||||
| -rw-r--r-- | test cases/kconfig/2 subdir/dir/meson.build | 13 | ||||
| -rw-r--r-- | test cases/kconfig/2 subdir/meson.build | 4 | ||||
| -rw-r--r-- | test cases/kconfig/3 load_config files/dir/config | 2 | ||||
| -rw-r--r-- | test cases/kconfig/3 load_config files/dir/meson.build | 13 | ||||
| -rw-r--r-- | test cases/kconfig/3 load_config files/meson.build | 4 |
8 files changed, 57 insertions, 0 deletions
diff --git a/test cases/kconfig/1 basic/.config b/test cases/kconfig/1 basic/.config new file mode 100644 index 000000000..071d1854d --- /dev/null +++ b/test cases/kconfig/1 basic/.config @@ -0,0 +1,3 @@ +CONFIG_VAL1=y +# CONFIG_VAL2 is not set +CONFIG_VAL_VAL=4 diff --git a/test cases/kconfig/1 basic/meson.build b/test cases/kconfig/1 basic/meson.build new file mode 100644 index 000000000..5dc8d194a --- /dev/null +++ b/test cases/kconfig/1 basic/meson.build @@ -0,0 +1,16 @@ +project('kconfig basic test') + +k = import('unstable-kconfig') +conf = k.load('.config') + +if not conf.has_key('CONFIG_VAL1') + error('Expected CONFIG_VAL1 to be set, but it wasn\'t') +endif + +if conf.has_key('CONFIG_VAL2') + error('Expected CONFIG_VAL2 not be set, but it was') +endif + +if conf.get('CONFIG_VAL_VAL').to_int() != 4 + error('Expected CONFIG_VAL_VAL to be 4') +endif diff --git a/test cases/kconfig/2 subdir/.config b/test cases/kconfig/2 subdir/.config new file mode 100644 index 000000000..0599d4616 --- /dev/null +++ b/test cases/kconfig/2 subdir/.config @@ -0,0 +1,2 @@ +CONFIG_IS_SET=y +# CONFIG_NOT_IS_SET is not set diff --git a/test cases/kconfig/2 subdir/dir/meson.build b/test cases/kconfig/2 subdir/dir/meson.build new file mode 100644 index 000000000..12f150297 --- /dev/null +++ b/test cases/kconfig/2 subdir/dir/meson.build @@ -0,0 +1,13 @@ + +k = import('unstable-kconfig') + +conf = k.load(meson.source_root() / '.config') + +if not conf.has_key('CONFIG_IS_SET') + error('Expected CONFIG_IS_SET to be set, but it wasn\'t') +endif + +if conf.has_key('CONFIG_NOT_IS_SET') + error('Expected CONFIG_NOT_IS_SET not be set, but it was') +endif + diff --git a/test cases/kconfig/2 subdir/meson.build b/test cases/kconfig/2 subdir/meson.build new file mode 100644 index 000000000..1245b1802 --- /dev/null +++ b/test cases/kconfig/2 subdir/meson.build @@ -0,0 +1,4 @@ +project('kconfig subdir test') + +# Test into sub directory +subdir('dir') diff --git a/test cases/kconfig/3 load_config files/dir/config b/test cases/kconfig/3 load_config files/dir/config new file mode 100644 index 000000000..0599d4616 --- /dev/null +++ b/test cases/kconfig/3 load_config files/dir/config @@ -0,0 +1,2 @@ +CONFIG_IS_SET=y +# CONFIG_NOT_IS_SET is not set diff --git a/test cases/kconfig/3 load_config files/dir/meson.build b/test cases/kconfig/3 load_config files/dir/meson.build new file mode 100644 index 000000000..d7b8d4477 --- /dev/null +++ b/test cases/kconfig/3 load_config files/dir/meson.build @@ -0,0 +1,13 @@ + +k = import('unstable-kconfig') + +conf = k.load(files('config')) + +if not conf.has_key('CONFIG_IS_SET') + error('Expected CONFIG_IS_SET to be set, but it wasn\'t') +endif + +if conf.has_key('CONFIG_NOT_IS_SET') + error('Expected CONFIG_NOT_IS_SET not be set, but it was') +endif + diff --git a/test cases/kconfig/3 load_config files/meson.build b/test cases/kconfig/3 load_config files/meson.build new file mode 100644 index 000000000..1245b1802 --- /dev/null +++ b/test cases/kconfig/3 load_config files/meson.build @@ -0,0 +1,4 @@ +project('kconfig subdir test') + +# Test into sub directory +subdir('dir') |
