Check if git-daemon exists and execute tests then
This commit is contained in:
parent
888605dd22
commit
cc70aeb3f1
2 changed files with 20 additions and 0 deletions
11
test/dune
11
test/dune
|
@ -2,10 +2,21 @@
|
||||||
(package git-kv)
|
(package git-kv)
|
||||||
(applies_to simple)
|
(applies_to simple)
|
||||||
(locks p9418)
|
(locks p9418)
|
||||||
|
(enabled_if (= "true" {%read:git-daemon}))
|
||||||
(deps %{bin:mgit}))
|
(deps %{bin:mgit}))
|
||||||
|
|
||||||
(cram
|
(cram
|
||||||
(package git-kv)
|
(package git-kv)
|
||||||
(applies_to fold)
|
(applies_to fold)
|
||||||
(locks p9418)
|
(locks p9418)
|
||||||
|
(enabled_if (= "true" {%read:git-daemon}))
|
||||||
(deps %{bin:mgit}))
|
(deps %{bin:mgit}))
|
||||||
|
|
||||||
|
(executable
|
||||||
|
(name git_daemon_exists)
|
||||||
|
(libraries unix))
|
||||||
|
|
||||||
|
(rule
|
||||||
|
(with-stdout-to
|
||||||
|
git-daemon
|
||||||
|
(run ./git_daemon_exists.exe)))
|
||||||
|
|
9
test/git_daemon_exists.ml
Normal file
9
test/git_daemon_exists.ml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
let git_daemon_exists () =
|
||||||
|
match Unix.create_process "git" [| "git"; "daemon" |] Unix.stdin Unix.stdout Unix.stderr with
|
||||||
|
| pid ->
|
||||||
|
Unix.kill pid Sys.sigint ; true
|
||||||
|
| exception Unix.Unix_error _ -> false
|
||||||
|
|
||||||
|
let () =
|
||||||
|
let v = git_daemon_exists () in
|
||||||
|
Format.printf "%b" v
|
Loading…
Reference in a new issue