* tests/test-dprintf-posix2.c: Skip the test on macOS.
(main): Return a different exit code at each point. Allow 100 KB extra
memory consumption.
* tests/test-dprintf-posix2.sh: Update.
+2024-06-03 Bruno Haible <bruno@clisp.org>
+
+ dprintf-posix tests: Skip the memory leak test on macOS.
+ * tests/test-dprintf-posix2.c: Skip the test on macOS.
+ (main): Return a different exit code at each point. Allow 100 KB extra
+ memory consumption.
+ * tests/test-dprintf-posix2.sh: Update.
+
2024-06-03 Bruno Haible <bruno@clisp.org>
pthread-* tests, regex tests: Prepare for use of 'alarm'.
#include <stdio.h>
+#if defined __APPLE__ && defined __MACH__ /* macOS */
+
+/* On macOS 11, 12, 13, 14, this test sometimes fails. Probably for the same
+ reason as mentioned in the comment in test-fprintf-posix3.c. */
+
+int
+main ()
+{
+ fprintf (stderr, "Skipping test: cannot trust address space size on this platform\n");
+ return 78;
+}
+
+#else
+
/* Skip this test when an address sanitizer is in use, since it would fail. */
#ifndef __has_feature
# define __has_feature(a) 0
but should not result in a permanent memory allocation. */
if (dprintf (STDOUT_FILENO, "%011000d\n", 17) == -1
&& errno == ENOMEM)
- return 1;
+ return 2;
}
result = 0;
}
- if (get_rusage_as () > initial_rusage_as + MAX_ALLOC_TOTAL)
- return 1;
+ if (get_rusage_as () > initial_rusage_as + MAX_ALLOC_TOTAL + 100000)
+ return 3;
return result;
}
#endif /* ! address sanitizer enabled */
+#endif /* !macOS */
(${CHECKER} ./test-dprintf-posix2${EXEEXT} 0
result=$?
- if test $result != 77 && test $result != 79 && test $result != 80 && test $result != 81; then result=1; fi
+ if test $result != 77 && test $result != 78 && test $result != 79 && test $result != 80 && test $result != 81; then result=1; fi
exit $result
) 2>/dev/null
malloc_result=$?
echo "Skipping test: no way to determine address space size"
exit 77
fi
+if test $malloc_result = 78; then
+ echo "Skipping test: cannot trust address space size on this platform"
+ exit 77
+fi
if test $malloc_result = 79; then
echo "Skipping test: cannot trust address space size when running under QEMU"
exit 77