mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
tests: Split macOS stat() mocking logic
On macOS, most of the symbols and declarations that we look at to determine which versions of stat() we need to mock are not present; on the other hand, there are some specific wrinkles that are introduced with Apple Silicon which we will need to take care of. To avoid making the logic even more of an opaque mess than it currently is, move the macOS part to a separate branch. This commit is better viewed with 'git show -w'. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
02ffd9909c
commit
7314546f73
@ -74,10 +74,10 @@
|
||||
* The same all applies to lstat()
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__APPLE__)
|
||||
# if !defined(WITH___XSTAT_DECL)
|
||||
# if defined(WITH_STAT)
|
||||
# if !defined(WITH___XSTAT) && !defined(WITH_STAT64) || defined(__APPLE__)
|
||||
# if !defined(WITH___XSTAT) && !defined(WITH_STAT64)
|
||||
# define MOCK_STAT
|
||||
# endif
|
||||
# endif
|
||||
@ -92,10 +92,9 @@
|
||||
# define MOCK___XSTAT64
|
||||
# endif
|
||||
# endif /* WITH___XSTAT_DECL */
|
||||
|
||||
# if !defined(WITH___LXSTAT_DECL)
|
||||
# if defined(WITH_LSTAT)
|
||||
# if !defined(WITH___LXSTAT) && !defined(WITH_LSTAT64) || defined(__APPLE__)
|
||||
# if !defined(WITH___LXSTAT) && !defined(WITH_LSTAT64)
|
||||
# define MOCK_LSTAT
|
||||
# endif
|
||||
# endif
|
||||
@ -110,6 +109,12 @@
|
||||
# define MOCK___LXSTAT64
|
||||
# endif
|
||||
# endif /* WITH___LXSTAT_DECL */
|
||||
#else /* __APPLE__ */
|
||||
# define MOCK_STAT
|
||||
# define MOCK_STAT64
|
||||
# define MOCK_LSTAT
|
||||
# define MOCK_LSTAT64
|
||||
#endif
|
||||
|
||||
#ifdef MOCK_STAT
|
||||
static int (*real_stat)(const char *path, struct stat *sb);
|
||||
|
Loading…
x
Reference in New Issue
Block a user