def execute(self): if self._clean: try: clean() except: raise return if self._type != 'default': module = __import__('grace-' + self._type + '.plugin') try: plugin = getattr(module.plugin, self._type.title())() plugin.pass_config(self._global_config, self._config) except: raise else: plugin = None if self._build: try: self.exec_build(plugin) if self._deploy: self.exec_deploy(plugin, None) if self._zip: self.exec_zip(plugin, None) except: raise if self._test: testnames = self._config['test_cases'] if testnames is None: testnames = [] for testname in os.listdir(os.path.join(os.getcwd(), 'test', 'tests')): testnames.append(testname[5:-3]) for testname in testnames: try: self.exec_test(plugin, testname) if self._deploy: self.exec_deploy(plugin, testname) if self._zip: self.exec_zip(plugin, testname) except: raise if self._jsdoc: try: self.exec_jsdoc(plugin) except: raise if self._update: try: self.exec_update(plugin, self._update_target) except: raise
def build_conf(title, defs): print("") print("") print("============================================") print(title) print("============================================") print("", flush=True) build.clean() build.build(defs)
def execute(self): if self._clean: clean() return if self._build: self.exec_build() self._config['build'] = True if self._deploy: self.exec_deploy(None) if self._zip: self.exec_zip(None) if self._upload: self.exec_upload() if self._test: if self._test_cases is None: self._test_cases = self._config['test_cases'] if self._test_cases is None: self._test_cases = [] for test_case in os.listdir(os.path.join(os.getcwd(), 'test', 'tests')): self._test_cases.append(test_case[5:-3]) for test_case in self._test_cases: self.exec_test(test_case) self._config['test'] = True if self._deploy: self.exec_deploy(test_case) if self._zip: self.exec_zip(test_case) if self._jsdoc: self.exec_jsdoc() if self._update: self.exec_update(self._update_target)
def test_comment(comment, pop, unpop): comment = clean(comment) score = 0 for word in comment.split(): try: score += pop[word] except KeyError: score += pop['__unknown__'] try: score -= unpop[word] except KeyError: score -= unpop['__unknown__'] return score
import sys sys.path.append(normpath(dirname(abspath(__file__)) + "/src")) if True: from build import clean from build import copy from build import lib from build import src from build import wipe def dist(subpath=None): return "dist/linux/sqink" + (subpath or "") clean(dist()) copy("README.md", dist()) copy(src("/crossknight"), dist("/lib/crossknight")) copy(src("/resources/images"), dist("/resources/images")) copy(src("/resources/js"), dist("/resources/js")) copy(src("/resources/notes/DESCRIPTION.txt"), dist("/resources/notes")) copy(src("/resources/styles"), dist("/resources/styles")) copy(src("/sqink.ico"), dist()) copy(src("/sqink.py"), dist()) copy(lib("/apiclient"), dist("/lib/apiclient")) copy(lib("/certifi"), dist("/lib/certifi")) copy(lib("/chardet"), dist("/lib/chardet")) copy(lib("/dropbox"), dist("/lib/dropbox")) copy(lib("/googleapiclient"), dist("/lib/googleapiclient"))
def clean_modules(self, base_dpath, code_type): clean(code_type, base_dpath)
test_report = False test_noclean = False if "test" in sys.argv: test_only = True if "report" in sys.argv: test_report = True if "noclean" in sys.argv: test_noclean = True if not test_only: build_conf("Minimal config monochrome", defines.minimal_monochrome) build_conf("Minimal config, 16 bit color depth", defines.minimal_16bit) build_conf("Normal config, 16 bit color depth swapped", defines.normal_16bit_swap) build_conf("Full config, 32 bit color depth", defines.full_32bit) files = test.prepare() if test_noclean == False: build.clean() for f in files: name = f[:-2] #test_foo.c -> test_foo build.build_test(defines.test, name) if test_report: print("") print("Generating report") print("-----------------------", flush=True) os.system("rm -r report") os.system("mkdir report") os.system( "gcovr -r ../ --html-details -o report/index.html --exclude-directories '\.\./examples' --exclude-directories 'src/.*' --exclude-directories 'unity' --exclude 'lv_test_.*\.c'" ) os.system(
def handle(self, *test_labels, **options): skip_zip = options.get('skip_zip', False) build.clean(skip_zip=skip_zip)