Overview
Comment: | [build] include tests in Python package |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | build |
Files: | files | file ages | folders |
SHA3-256: |
a80c08579795457830ebb4c41bf1d5c9 |
User & Date: | olr on 2017-05-01 09:35:28 |
Other Links: | manifest | tags |
Context
2017-05-01
| ||
10:46 | [build] useless conditions check-in: c4e9c97a0e user: olr tags: trunk, build | |
09:35 | [build] include tests in Python package check-in: a80c085797 user: olr tags: trunk, build | |
07:21 | [build] clarity + remove generated test file from repo check-in: d154fcd96b user: olr tags: trunk, build | |
Changes
Renamed and modified tests/fr_test.py [d8176c7c6e] to gc_lang/fr/modules/tests.py [5fc75f3fc6].
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | - + - - - + + - - - - - + - - - - + + - - - - + - - | #! python3 # coding: UTF-8 import unittest import os import re import time |
︙ | |||
135 136 137 138 139 140 141 | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + | def setUpClass (cls): gce.load() cls._zError = re.compile(r"\{\{.*?\}\}") cls._aRuleTested = set() def test_parse (self): zOption = re.compile("^__([a-zA-Z0-9]+)__ ") |
︙ | |||
229 230 231 232 233 234 235 236 237 238 239 240 241 242 | 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | + | with open("./tests/fr/perf.txt", "r", encoding="utf-8") as hSrc, \ open("./tests/fr/perf_memo.txt", "a", encoding="utf-8", newline="\n") as hDst: hDst.write("{:<12}{:<20}".format(sVersion, time.strftime("%Y.%m.%d %H:%M"))) for sText in ( s.strip() for s in hSrc if not s.startswith("#") and s.strip() ): with timeblock(sText[:sText.find(".")], hDst): aErrs = gce.parse(sText) hDst.write("\n") def main(): unittest.main() if __name__ == '__main__': main() |
Modified make.py from [9f8a0c4296] to [9a1c31726d].
︙ | |||
347 348 349 350 351 352 353 | 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | - - - - - | try: lRules = open(spLang + "/rules.grx", 'r', encoding="utf-8").readlines() except: print("Rules file in project [" + sLang + "] not found") return dVars.update(compile_rules.make(lRules, dVars['lang'], bJavaScript)) |
︙ | |||
376 377 378 379 380 381 382 383 384 385 386 387 388 389 | 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | + + + + + | print("+ Modules: ", end="") for sf in os.listdir(spLang+"/modules"): if not sf.endswith(".tpl.py") and not sf.startswith("gce_"): file_util.copy_file(spLang+"/modules/"+sf, spLangPack) print(sf, end=", ") print() # TEST FILES with open("grammalecte/"+sLang+"/gc_test.txt", "w", encoding="utf-8", newline="\n") as hDstPy: hDstPy.write("# TESTS FOR LANG [" + sLang + "]\n\n") hDstPy.write(dVars['gctests']) createOXT(spLang, dVars, xConfig._sections['oxt'], spLangPack, bInstallOXT) createServerOptions(sLang, dVars) createServerZip(sLang, dVars, spLangPack) #### JAVASCRIPT if bJavaScript: |
︙ | |||
486 487 488 489 490 491 492 | 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | - + | # make sVersion = create(sLang, xConfig, xArgs.install, xArgs.javascript, ) # tests if xArgs.tests or xArgs.perf: print("> Running tests") try: |
︙ |