about summary refs log tree commit homepage
path: root/t/test-lib.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 655f36b..be654d6 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -198,6 +198,33 @@ req_curl_chunked_upload_err_check () {
         fi
 }
 
+check_splice () {
+        case $(uname -s) in
+        Linux) ;;
+        *)
+                t_info "skipping $T since it's not Linux"
+                exit 0
+                ;;
+        esac
+
+        # we only allow splice on 2.6.32+
+        min=32 uname_r=$(uname -r)
+        case $uname_r in
+        2.6.*)
+                sub=$(expr "$uname_r" : '2\.6\.\(.*\)$')
+                if test $sub -lt $min
+                then
+                        t_info "skipping $T (Linux $(uname_r < 2.6.$min)"
+                        exit 0
+                fi
+                ;;
+        *)
+                t_info "skipping $T (Linux $uname_r < 2.6.$min)"
+                exit 0
+                ;;
+        esac
+}
+
 case $model in
 Rev) require_check rev Rev::VERSION ;;
 Coolio) require_check coolio Coolio::VERSION ;;