Grammalecte  Check-in [2f381bc79f]

Overview
Comment:[build] rework JS tests building
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | build
Files: files | file ages | folders
SHA3-256: 2f381bc79f3cfc09d9cab38e86ff7983a6ec0c40f09f045342eb5162c7fd38ff
User & Date: olr on 2017-05-01 06:40:04
Other Links: manifest | tags
Context
2017-05-01
07:21
[build] clarity + remove generated test file from repo check-in: d154fcd96b user: olr tags: trunk, build
06:40
[build] rework JS tests building check-in: 2f381bc79f user: olr tags: trunk, build
2017-04-30
18:48
[fr] tri des tests check-in: 298c1d4783 user: olr tags: trunk, fr
Changes

Modified compile_rules.py from [7ac4ebe558] to [ca8edd4d44].

575
576
577
578
579
580
581
582

583
584
585
586




587

588
589
590
591
592
593
594
575
576
577
578
579
580
581

582

583
584
585
586
587
588
589

590
591
592
593
594
595
596
597







-
+
-



+
+
+
+
-
+







        dOptions, dOptPriority = prepareOptions(lOpt)
    except:
        traceback.print_exc()
        exit()

    # generating test files
    print("  generating test files...")
    with open("tests/"+sLang+"/gc_test.txt", "w", encoding="utf-8", newline="\n") as hDstPy, \
    with open("tests/"+sLang+"/gc_test.txt", "w", encoding="utf-8", newline="\n") as hDstPy:
         open("gc_lang/"+sLang+"/modules-js/tests_data.json", "w", encoding="utf-8", newline="\n") as hDstJS:
        hDstPy.write("# TESTS FOR LANG ["+sLang+"]\n\n")
        for sLine in lTest:
            hDstPy.write(sLine)

    # tests
    print("  list tests...")
    sGCTests = "\n".join(lTest)
        hDstJS.write('{ "aData": ' + json.dumps(lTest, ensure_ascii=False) + " }\n")
    sGCTestsJS = '{ "aData": ' + json.dumps(lTest, ensure_ascii=False) + " }\n"

    # processing
    print("  preparing rules...")
    bParagraph = True
    lParagraphRules = []
    lSentenceRules = []
    lParagraphRulesJS = []
634
635
636
637
638
639
640


641
642
643
644
645
646
647
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652







+
+







        sJSCallables += "    },\n"
    sJSCallables += "}\n"

    displayStats(lParagraphRules, lSentenceRules)

    d = { "callables": sPyCallables,
          "callablesJS": sJSCallables,
          "gctests": sGCTests,
          "gctestsJS": sGCTestsJS,
          "paragraph_rules": mergeRulesByOption(lParagraphRules),
          "sentence_rules": mergeRulesByOption(lSentenceRules),
          "paragraph_rules_JS": writeRulesToJSArray(mergeRulesByOption(lParagraphRulesJS)),
          "sentence_rules_JS": writeRulesToJSArray(mergeRulesByOption(lSentenceRulesJS)) }
    d.update(dOptions)

    return d

Modified gc_lang/fr/modules-js/tests_data.json from [4fa21ca394] to [f05e835c66].

cannot compute difference between binary files