build-tests: The allowed method is used by default
The allowed method returns true when the feature is set to `enabled`
or `auto`.
The allowed method returns false when the feature is set to
`disabled`.
So we prefer to use the `allowed` method instead of `enabled`.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ie729807e5e08b904f8c677aead222d5965e13a04
diff --git a/meson.build b/meson.build
index 0fe0a6a..327d2d3 100644
--- a/meson.build
+++ b/meson.build
@@ -35,7 +35,7 @@
subdir('src/rde')
subdir('src')
-if not get_option('tests').disabled()
+if get_option('tests').allowed()
subdir('test')
endif
diff --git a/meson_options.txt b/meson_options.txt
index 77cee1f..ea8eb6b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,4 @@
-option('tests', type: 'feature', description: 'Build tests')
+option('tests', type: 'feature', value: 'enabled', description: 'Build tests')
# Timer constant
option('read-interval-ms', type: 'integer', value: 10, description: 'Read loop interval in millisecond (ms)')