File: depend.py

package info (click to toggle)
gerris 20131206%2Bdfsg-21
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,252 kB
  • sloc: ansic: 66,595; sh: 15,922; f90: 1,513; makefile: 1,150; fortran: 696; python: 493; awk: 104; lisp: 89; xml: 27
file content (52 lines) | stat: -rw-r--r-- 1,500 bytes parent folder | download | duplicates (5)
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
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/python

import sys
import os
import os.path
sys.path.append("../doc/examples")
import gfs2tex

print "## File generated automatically by depend.py: do not modify by hand"
print ""

dists = ""
depends = ""
docs = ""
reps = ""
tests = ""
logs = ""
for start in sys.argv[1:]:
    tests += "\\\n\t" + start + ".sh"
    reps += " " + start
    logs += "\\\n\t" + start + ".log"
    f = open(start + ".sh", "w")
    f.write("python -u test.py " + start + "\n")
    f.close()
    os.chmod(start + ".sh",0755)
    for root, dirs, files in os.walk(start,topdown=True):
        if not ".xvpics" in root:
            test = gfs2tex.Example(root)
            name = test.path + "/" + test.name + ".gfs"
            
            docs += "\\\n\t" + name + ".html"
            dists += "\\\n\t" + name
            depends += "\\\n\t" + name
            for f in test.required:
                dists += "\\\n\t" + test.path + "/" + f
            for f in test.generated:
                depends += "\\\n\t" + test.path + "/" + f
                if f[-4:] == ".mpg" or f[-4:] == ".ogv" or f[-4:] == ".png" or f[-4:] == ".mp4":
                    docs += "\\\n\t" + test.path + "/" + f

print "DOCS = " + docs + dists
print ""
print "TESTS = " + tests + "\\\n\tsummary.sh"
os.chmod("summary.sh",0755)
print ""
print "EXTRA_DIST += $(TESTS)" + dists
print ""
print "TESTS_ENVIRONMENT = TESTS=\"" + reps + "\""
print "TEST_EXTENSIONS = .sh"
print "summary.log:" + logs
print ""
print "tests.tex: " + depends