diff --git a/test/blackbox-tests/test-cases/dune b/test/blackbox-tests/test-cases/dune index 5457f0c02ea6..9a7ee66b0d12 100644 --- a/test/blackbox-tests/test-cases/dune +++ b/test/blackbox-tests/test-cases/dune @@ -43,6 +43,13 @@ (applies_to fdo) (enabled_if false)) +; This test copies a large file, which is too slow to be enabled all the time. +; The source file is actually sparse, but sendfile seems to do a full copy +; nevertheless. +(cram + (applies_to sendfile-large-file) + (enabled_if false)) + ; This test is flaky (cram diff --git a/test/blackbox-tests/test-cases/sendfile-large-file.t b/test/blackbox-tests/test-cases/sendfile-large-file.t new file mode 100644 index 000000000000..ab6e766d6282 --- /dev/null +++ b/test/blackbox-tests/test-cases/sendfile-large-file.t @@ -0,0 +1,22 @@ +We create a large file and check that it is copied completely. + + $ cat > dune-project << EOF + > (lang dune 1.0) + > EOF + + $ cat > create.ml << EOF + > let () = Unix.truncate "file.dat" 0x1_00_00_00_03 + > EOF + $ touch file.dat + $ ocaml unix.cma create.ml + $ rm create.ml + + $ dune build file.dat + + $ dune_cmd stat size file.dat + 4294967299 + + $ dune_cmd stat size _build/default/file.dat + 3 + +(3 indicates that the file size is taken modulo 2**32)