localization_executor.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. """
  2. # Part of localization phase
  3. """
  4. import os
  5. import sys
  6. import configparser
  7. from datetime import datetime
  8. config_name = sys.argv[1]
  9. lemon_cfg = configparser.ConfigParser()
  10. lemon_cfg.read(f"./config/{config_name}")
  11. parameters = lemon_cfg['parameters']
  12. python_prefix = parameters['python_prefix'].rstrip("/")
  13. # 1. get unique inconsistency
  14. start_time = datetime.now()
  15. print("Localization Starts!")
  16. print("\n\nPhase1: Get Unique Inconsistency")
  17. get_unique_inconsistency = f"{python_prefix}\lemon\python -u -m scripts.localization.get_unique_inconsistency {config_name}"
  18. os.system(get_unique_inconsistency)
  19. # 2. localization
  20. print("\n\nPhase2: Localize")
  21. localize = f"{python_prefix}\lemon\python -u -m run.localize_lemon {config_name}"
  22. os.system(localize)
  23. # 3. get suspected bugs
  24. print("\n\nPhase3: Suspected bugs analysis")
  25. get_suspecte_bugs = f"{python_prefix}\lemon\python -u -m scripts.localization.suspected_bugs_detector {config_name}"
  26. os.system(get_suspecte_bugs)
  27. print("Localization finishes!")
  28. print(f"Localization time cost: {datetime.now() - start_time}")