Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walf443/345839 to your computer and use it in GitHub Desktop.
Save walf443/345839 to your computer and use it in GitHub Desktop.
#
# vim: ft=python
import os
import re
import glob
ALLOW_NAMESPACE = re.compile("Proj", re.M)
USE_REGEX = re.compile(r"^\s*use\s+(\S+);", re.M)
def perl_scan(node, env, path):
contents = node.get_contents()
result = USE_REGEX.findall(contents)
baselibdir = env.GetLaunchDir() + "/lib/";
result = [ baselibdir + '/'.join(i.split('::')) + ".pm" for i in filter(lambda x: ALLOW_NAMESPACE.findall(x), result) ]
return result
def test_actions(source, target, env, for_signature):
return "prove ./%s > %s || ( cat %s && rm %s )" % (source[0], target[0], target[0], target[0])
bld = Builder(generator = test_actions,
suffix = '.tso')
environ = os.environ
env = Environment(ENV=environ, BUILDERS={'Test': bld})
scanner = Scanner(function = perl_scan ,skeys = ['.pm', '.t', '.pl'])
env.Append(SCANNERS = scanner)
for target in glob.glob('**/*.t'):
env.Test(target)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment