(executable
 (name fuzz_eio)
 (libraries
  happy_eyeballs_eio
  eio
  eio.mock
  eio-net.addr
  eio-net.chaos
  eio-net.mem
  alcobar
  ipaddr
  domain-name
  duration))

(rule
 (alias runtest)
 (package nox-happy-eyeballs-eio)
 (enabled_if
  (<> %{profile} afl))
 (deps fuzz_eio.exe)
 (action
  (run %{exe:fuzz_eio.exe})))

(rule
 (alias fuzz)
 (package nox-happy-eyeballs-eio)
 (enabled_if
  (= %{profile} afl))
 (deps fuzz_eio.exe)
 (action
  (progn
   (run %{exe:fuzz_eio.exe} --gen-corpus corpus)
   (run afl-fuzz -V 60 -i corpus -o _fuzz -- %{exe:fuzz_eio.exe} @@))))
