コード例 #1
0
ファイル: run_all_tests.py プロジェクト: XelaRellum/RapidGIT
from subprocess import Popen, PIPE
import os.path
import os
import sys
import platform

from tests import run, findQtProjects

if platform.system() == "Windows":
    exe_suffix = ".exe"
else:
    exe_suffix = ""


test_dirs=[]
for project in findQtProjects():
    test_dirs.append(os.path.split(project)[0])

log_file=open("run_all_tests.log", "w")

for test_dir in test_dirs:
    test_name = os.path.split(test_dir)[1]
    exename = "%s/debug/%s%s" % (test_dir, test_name, exe_suffix)
    test_logname = "%s/%s.log" % (test_dir, test_name)
    
    print "Running test '%s'..." % test_dir,
    
    if not os.path.isfile(exename):
        # probably a compilation error
        print "NOT FOUND"
        continue
コード例 #2
0
#!/usr/bin/python

import os.path
from tests import run, findQtProjects
import platform

if platform.system() == "Windows":
    MAKE="mingw32-make"
else:
    MAKE="make"

projects = findQtProjects()

topdir=os.path.abspath(".")
print "Build tests...",
for project in projects:
    print project,
    project_dir, project_name = os.path.split(project)
    
    os.chdir(topdir)
    os.chdir(project_dir)
    
    if 0 != run("qmake", [project_name]):
        print "qmake failed",
        continue
	
    if 0 != run(MAKE, ["debug", "-j4"]):
        print "make failed",
        # TODO maybe output a warning
        continue