Skip to content

Commit

Permalink
Build: change the conditions for handling tests
Browse files Browse the repository at this point in the history
* Debian builds no longer run the tests by default. If you want to run them, run `meson test` from the build directory.
* The option to enable or disable the tests is now removed as it's essentially pointless (since the test are only run when you run the test command).
* The tests currently use an option that's not available until meson 0.46 so the tests are not set up for previous versions. The only side effect to this is that trying to run the tests through `meson test` will do nothing on older versions.
  • Loading branch information
collinss authored and mtwebster committed Jan 13, 2020
1 parent b208dad commit d39327d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
4 changes: 0 additions & 4 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ override_dh_install:
sed 's@TYPELIBDIR@${TYPELIBDIR}@' debian/gir1.2-xreader.install.in > debian/gir1.2-xreader.install
dh_install --fail-missing

override_dh_auto_test:
ninja -C debian/build test

override_dh_auto_configure:
meson debian/build \
--prefix=/usr \
Expand All @@ -33,7 +30,6 @@ override_dh_auto_configure:
-D comics=true \
-D introspection=true \
-D help_files=true \
-D tests=false
# --disable-static \

override_dh_strip:
Expand Down
10 changes: 7 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,13 @@ subdir('shell')
subdir('po')
subdir('help')
subdir('install-scripts')
# tests are currently outdated and will not work with current xreader.
# to reenable tests, change "false" to "get_option('tests')"
if get_option('tests')

# The tests use an option that doesn't exist in meson before 0.46.
# Since they aren't strictly necessary, we'll just skip them for earlier versions
# rather than making 0.46 a hard requirement. This condition can be removed once we
# no longer need to worry about building on 0.45 or earlier
meson_version_parts = meson.version().split('.')
if meson_version_parts[0].to_int() > 0 or meson_version_parts[1].to_int() >= 46
subdir('test')
endif

Expand Down
5 changes: 0 additions & 5 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ option('thumbnailer',
value: true,
description: 'Build the thumbnailer program'
)
option('tests',
type: 'boolean',
value: true,
description: ''
)
option('docs',
type: 'boolean',
value: false,
Expand Down

0 comments on commit d39327d

Please sign in to comment.