tests: Skip >4GB file tests unless running tests in slow/thorough mode

They take too long to include in a normal test run. They’ll still be run
in CI once a week as part of our scheduled slow test job.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-06-17 12:59:34 +01:00
parent a8be45204e
commit 1f838b061b
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73

View File

@ -2938,6 +2938,15 @@ create_testfile_4gb_or_skip (char *filename)
int fd; int fd;
int ret; int ret;
/* Reading each 4GB test file takes about 5s on a fast machine, and another 7s
* to compare its contents once its been read. Thats too slow for a normal
* test run, and theres no way to speed it up. */
if (!g_test_slow ())
{
g_test_skip ("Skipping slow >4GB file test");
return FALSE;
}
fd = g_mkstemp (filename); fd = g_mkstemp (filename);
g_assert_cmpint (fd, !=, -1); g_assert_cmpint (fd, !=, -1);
ret = ftruncate (fd, testfile_4gb_size); ret = ftruncate (fd, testfile_4gb_size);