(jbuild_version 1)

(executables
 ((names (test_endorsement
          test_michelson_parser
          test_origination
          test_transaction
          test_vote))
  (libraries (tezos-base
              tezos-rpc-http
              tezos-client-base
              tezos-client-genesis
              tezos-client-alpha
              tezos-test-helpers))
  (flags (:standard -w -9-32 -safe-string
                    -open Tezos_base__TzPervasives
                    -open Tezos_test_helpers
                    -open Tezos_rpc_http
                    -open Tezos_client_base
                    -open Tezos_client_genesis
                    -open Tezos_client_alpha))))

(alias
 ((name buildtest)
  (deps (test_endorsement.exe
         test_michelson_parser.exe
         test_origination.exe
         test_transaction.exe
         test_vote.exe))))

(alias
 ((name runtest_endorsement)
  (locks  (/tcp-port/18100))
  (action (chdir ${ROOT} (run ${exe:test_endorsement.exe} ${bin:tezos-node} ${path:sandbox.json} 18100)))))

(alias
 ((name runtest_michelson_parser)
  (action (run ${exe:test_michelson_parser.exe}))))

(alias
 ((name runtest_origination)
  (locks  (/tcp-port/18200))
  (action (chdir ${ROOT} (run ${exe:test_origination.exe} ${bin:tezos-node} ${path:sandbox.json} 18200)))))

(alias
 ((name runtest_transaction)
  (locks  (/tcp-port/18300))
  (action (chdir ${ROOT} (run ${exe:test_transaction.exe} ${bin:tezos-node} ${path:sandbox.json} 18300)))))

(alias
 ((name runtest_vote)
  (locks  (/tcp-port/18400))
  (action (chdir ${ROOT} (run ${exe:test_vote.exe} ${bin:tezos-node} ${path:sandbox-vote.json} 18400)))))

(alias
 ((name runtest)
  (deps ((alias runtest_endorsement)
         (alias runtest_michelson_parser)
         (alias runtest_origination)
         (alias runtest_transaction)
         (alias runtest_vote)))))

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