Exemple #1
0
 def test_case_13(self):
     outputfile = analysis.Analysis(
         os.path.join(properties["TEST_DIR"], "test_case_13.dl")).run()
     self._compare_files(
         outputfile, os.path.join(properties["TEST_DIR"],
                                  "test_case_13.csv"))
Exemple #2
0
if __name__ == "__main__":
    import os, sys
    import subprocess
    import logging

    from assets.lib import utils
    from assets.lib.commons import *
    from assets.lib import analysis

    utils.setup_parser()
    utils.setup_logger()
    logger = utils.get_logger("taint_analysis")

    if properties["args"].command == "run":
        for source in properties["args"].source:
            analysis.Analysis(source).run()

    if properties["args"].command == "compile":
        logger.info("Launching compiler")
        try:
            process = subprocess.run([
                "souffle",
                "--dl-program=" +
                os.path.join(properties["BIN_DIR"], "taint_analyser"),
                "--jobs=2",
                "--output-dir=" + properties["OUTPUT_DIR"],
                "--fact-dir=" + properties["FACTS_DIR"],
                properties["DL_FILE"],
            ],
                                     stdout=subprocess.PIPE,
                                     stderr=subprocess.PIPE,