File: testhooks

package info (click to toggle)
monotone 1.1-9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,984 kB
  • ctags: 8,622
  • sloc: cpp: 86,450; sh: 6,906; perl: 924; makefile: 813; python: 517; lisp: 379; sql: 118; exp: 91; ansic: 52
file content (42 lines) | stat: -rw-r--r-- 871 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function ignore_file (name)
  ok = true

  mytext = "text from lua1"

  result = "ok"

  if ok then
    if existsonpath("cat") == 0 then
      procfin, procfout, pid = spawn_pipe("cat")
      if pid == -1 then
        result = "no pid"
        ok = false
      else
        procfin:write(mytext)
        procfin:close()
        line, errstr = procfout:read()
        if line == nil then
          result = "no line"
          ok = false
        elseif line ~= mytext then
          result = "Expected: " .. mytext .. "\nRead: " .. line
          ok = false
        end
        procfout:close()
        ret, pid = wait(pid)
      end
    else
      result = "Lacking cat"
      x = io.open("skipfile", "w")
      x:close()
    end
  end
  
  if ok then
    x = io.open("outfile", "w")
    x:close()
  end

  ignore_file = function (name) return true end
  return true
end