summaryrefslogtreecommitdiff
path: root/ext/gmp
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gmp')
-rw-r--r--ext/gmp/tests/gmp_setbit_long.phpt17
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/gmp/tests/gmp_setbit_long.phpt b/ext/gmp/tests/gmp_setbit_long.phpt
index d0d0a3d989..e27c4e5942 100644
--- a/ext/gmp/tests/gmp_setbit_long.phpt
+++ b/ext/gmp/tests/gmp_setbit_long.phpt
@@ -4,6 +4,21 @@ gmp_setbit() with large index
<?php if (!extension_loaded("gmp")) print "skip"; ?>
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
<?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); ?>
+<?php
+ /* This test requires about 8G RAM which likely not to be present on an arbitrary CI. */
+ if (!file_exists("/proc/meminfo")) {
+ die("skip cannot determine free memory amount.");
+ }
+ $s = file_get_contents("/proc/meminfo");
+ $free = 0;
+ if (preg_match(",MemFree:\s+(\d+)\s+kB,", $s, $m)) {
+ /* Got amount in kb. */
+ $free = $m[1]/1024/1024;
+ }
+ if ($free < 8) {
+ die("skip not enough free RAM.");
+ }
+?>
--FILE--
<?php
@@ -23,4 +38,4 @@ FFFFFFFFF
3FFFFFFFFF
Warning: gmp_setbit(): Index must be less than %d * %d in %s/gmp_setbit_long.php on line %d
-Done \ No newline at end of file
+Done