(jbuild_version 1)

(executables
 ((names (test_p2p_socket
          test_p2p_pool
          test_p2p_io_scheduler))
  (libraries (tezos-base
              tezos-p2p
              tezos-test-helpers))
  (flags (:standard -w -9-32
                    -linkall
                    -safe-string
                    -open Tezos_base__TzPervasives
                    -open Tezos_test_helpers
                    -open Tezos_p2p))))

(alias
 ((name buildtest)
  (deps (test_p2p_socket.exe
         test_p2p_pool.exe
         test_p2p_io_scheduler.exe))))

(alias
 ((name runtest_p2p_socket)
  (action (run ${exe:test_p2p_socket.exe} -v))))

(alias
 ((name runtest_p2p_pool)
  (action (run ${exe:test_p2p_pool.exe} --clients 10 --repeat 5 -v))))

(alias
 ((name runtest_p2p_io_scheduler)
  (action (run ${exe:test_p2p_io_scheduler.exe}
               	   --delay 5 --clients 8
                   --max-upload-speed 262144 ;; 1 << 18 = 256kB
                   --max-download-speed 1048576 ;; 1 << 20 = 1MB
                   ))))

(alias
 ((name runtest)
  (deps ((alias runtest_p2p_socket)
         (alias runtest_p2p_pool)
         (alias runtest_p2p_io_scheduler)))))

(alias
 ((name runtest_indent)
  (deps ((glob_files *.ml*)))
  (action (run bash ${libexec:tezos-stdlib:test-ocp-indent.sh} ${^}))))
