summaryrefslogtreecommitdiff
path: root/libgweather/tests
Commit message (Collapse)AuthorAgeFilesLines
* build: Move shared variables in the top level build fileEmmanuele Bassi2022-09-101-3/+0
| | | | | We use the locations of the schemas directory in two places, so we might as well share the same variables everywhere.
* build: Remove deprecated Meson functionsEmmanuele Bassi2022-09-101-2/+5
| | | | | Use project_source_root() and project_build_root() instead of the deprecated source_root() and build_root(), respectively.
* metar test: Don't use "known" duplicatesPierre Labastie2022-04-261-12/+3
| | | | | | | | | | | | | | The metar list provided by NOAA contains duplicate ICAO codes. Those duplicates may change over time, so it does not make sense to use an array of known duplicates. Presently a duplicate is rejected when it is known, and inserted if it is not, leading to a difference in the number of insertions and the number of keys, so that the test fails. If any duplicate is rejected, the number of insertions is always equal to the number of keys (unless something goes wrong in g_hash_table_insert). And this is the default behavior for known duplicates anyway. Closes: https://gitlab.gnome.org/GNOME/libgweather/-/issues/168
* Remove GWeatherTimezoneEmmanuele Bassi2021-11-231-6/+6
| | | | | GWeatherTimezone can be replaced by GTimeZone, which has been available since GLib 2.26.
* build: Ensure tests depend on generated enum schemasEmmanuele Bassi2021-11-191-1/+1
| | | | | Otherwise they are going to break if we run the tests before the schemas have been built, or if the enums change.
* tests: Use private API to access the locations databaseEmmanuele Bassi2021-11-191-3/+2
| | | | Instead of accessing the internals of GWeatherLocation.
* tests: Replace a warning with a test messageEmmanuele Bassi2021-11-191-3/+1
|
* tests: Remove unnecessary include directivesEmmanuele Bassi2021-11-191-8/+0
|
* tests: Hide the glib/gstdio.h includeEmmanuele Bassi2021-11-192-1/+2
| | | | We only need it inside the test utilities.
* tests: Move METAR test to its own suiteEmmanuele Bassi2021-11-194-163/+192
| | | | | This allows us to remove the libsoup include from the shared test utilities header.
* build: Remove unnecessary symbolEmmanuele Bassi2021-11-191-1/+0
| | | | | We use the environment to specify the location of the locations database file, instead of hard coding it into the binary.
* tests: Split off the timezone testsEmmanuele Bassi2021-11-193-188/+218
|
* tests: Move shared API into a separate fileEmmanuele Bassi2021-11-195-163/+140
| | | | This way we don't have to copy stuff around.
* tests: Move duplicate units into their own suiteEmmanuele Bassi2021-11-193-157/+284
| | | | | | | | | The duplicate tests modify the environment, and impose ordering on the general test suite. Instead of modifying the environment inside the tests—which comes with its own set of threading issues—we can split the tests into a separate binary, and set up the environment when executing the test.
* tests: Make sure we don't leave around temporary directoriesEmmanuele Bassi2021-11-192-11/+51
| | | | | | We set up a separate directory for the GSettings schemas, to avoid polluting the system one, but we should also take care of removing it at the end, so we don't create a bunch of random directories in TMPDIR.
* tests: Turn random output into test messagesEmmanuele Bassi2021-11-171-33/+25
| | | | | | | The g_test_message() function ensures that the output does not break any TAP harness. Replacing the random g_print/g_debug/g_message with g_test_message() has the additional benefit of not requiring a custom log handler.
* Turn GWeatherLocation into a proper GObjectEmmanuele Bassi2021-11-171-34/+33
| | | | | | We want to make it easier to use GWeatherLocation inside data structures like GListModel implementations. It's also easier to use from language bindings, as now objects will have a clear life time.
* Run the code base through the style formatterEmmanuele Bassi2021-11-101-3/+3
| | | | Ensure that the changes are consistent.
* tests: Use g_assert_no_error()Patrick Griffis2021-11-101-1/+1
|
* tests: Fix double freePatrick Griffis2021-11-101-2/+0
|
* Port to libsoup3Daniel Kolesa2021-11-101-2/+21
|
* Reformat the code using clang-formatEmmanuele Bassi2021-10-171-167/+170
| | | | | | | | | | | While it would be very nice to keep our artisanal, locally sourced, hand-crafted coding style, our time is better spent trying to fix issues and implement features, instead of doing coding style reviews. In order to have our CI pipeline in charge of keeping and checking the coding style of this project, we need to have a consistent baseline. This consistency pass also gets rid of all the tabs, so we have that going for us.
* tests: Avoid an invalid read caused by a double unrefEmmanuele Bassi2021-10-151-1/+0
|
* Remove GWEATHER_PROVIDER_YAHOOEmmanuele Bassi2021-10-151-1/+0
| | | | | The code has long since gone, we can finally remove the enumeration member from GWeatherProvider.
* tests: Drop use of GWeather.Location.get_childrenEmmanuele Bassi2021-10-151-70/+47
| | | | | | | | It's deprecated, and replaced by GWeather.Location.next_child. The tricky bit is to take into account that next_child() will consume the passed location, which means we need to add a reference if we're keeping the GWeatherLocation around.
* Bump up the API version of libgweatherEmmanuele Bassi2021-10-131-6/+6
| | | | | | | | | | | | We're now at 4.0. The version bump requires some additional changes: - the project version is 3.90, while we are in a development cycle - the main gettext domain has been changed to libgweather-4.0 - the gettext domain for the locations has been changed to libgweather-4.0-locations - the settings schemas have been changed to org.gnome.GWeather4 - the soname of the shared library has been changed to match the versioning scheme used by GLib and GTK
* Move tests and tools out of the wayEmmanuele Bassi2021-10-132-0/+919
We should write tests and tools that look like tests in the same way we'd write code that depends on the library, instead of assuming that everything works out because it sits in the same directory.