multiple_run_test.py 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. ##################################################################
  4. #
  5. # Copyright (c) 2023 CICV, Inc. All Rights Reserved
  6. #
  7. ##################################################################
  8. """
  9. @Authors: yangzihao(yangzihao@china-icv.cn)
  10. @Data: 2024/01/30
  11. @Last Modified: 2024/01/30
  12. @Summary: Evaluateion functions
  13. """
  14. import os
  15. import sys
  16. import time
  17. from multiple_case_eval import multiple_cases_eval
  18. import log
  19. # logger = log.get_logger()
  20. if __name__ == "__main__":
  21. from warnings import simplefilter
  22. simplefilter(action="ignore")
  23. # if len(sys.argv) >= 5:
  24. # configPath = sys.argv[1]
  25. # singleReportPath = sys.argv[2]
  26. # reportPath = sys.argv[3]
  27. # logPath = sys.argv[4]
  28. # log.setup_logger(logPath)
  29. # logger = log.get_logger()
  30. #
  31. # if not os.path.exists(configPath):
  32. # print('Invalid configPath!')
  33. # logger.error("MULTIPLE_CASES_EVAL: Invalid configPath!")
  34. # sys.exit(-1)
  35. # elif not os.path.exists(singleReportPath):
  36. # print('Invalid singleReportPath!')
  37. # logger.error("MULTIPLE_CASES_EVAL: Invalid singleReportPath!")
  38. # sys.exit(-1)
  39. # else:
  40. # try:
  41. # logger.info("MULTIPLE_CASES_EVAL: Start evaluating:")
  42. # print("MULTIPLE_CASES_EVAL程序开始运行:")
  43. # print(f" configPath: {configPath},\n singleReportPath: {singleReportPath},\n reportPath: {reportPath}")
  44. # t1 = time.time()
  45. # multiple_cases_eval(configPath, singleReportPath, reportPath)
  46. # t2 = time.time()
  47. # print(f"程序结束,执行时间:{int(t2 - t1)} s")
  48. # logger.info("MULTIPLE_CASES_EVAL: End.")
  49. # sys.exit(0)
  50. # except Exception as e:
  51. # print("异常,退出...")
  52. # print(repr(e))
  53. # sys.exit(-1)
  54. # else:
  55. # print('No enough arguments!')
  56. # logPath = sys.argv[4]
  57. # log.setup_logger(logPath)
  58. # logger = log.get_logger()
  59. # logger.error("MULTIPLE_CASES_EVAL: No enough arguments!")
  60. # sys.exit(-1)
  61. configPath = r"./config/config0925.json"
  62. singleReportPath = r"./reportTest/cases-dict-0925.json"
  63. reportPath = r"./result/report_mul-0925.json"
  64. logPath = './log.log'
  65. log.setup_logger(logPath)
  66. logger = log.get_logger()
  67. if not os.path.exists(configPath):
  68. print('Invalid configPath!')
  69. logger.error("MULTIPLE_CASES_EVAL: Invalid configPath!")
  70. elif not os.path.exists(singleReportPath):
  71. print('Invalid singleReportPath!')
  72. logger.error("MULTIPLE_CASES_EVAL: Invalid singleReportPath!")
  73. else:
  74. # logger.info("MULTIPLE_CASES_EVAL: Start evaluating:")
  75. print("MULTIPLE_CASES_EVAL程序开始运行:")
  76. print(f" configPath: {configPath}, \n singleReportPath: {singleReportPath}, \n reportPath: {reportPath}")
  77. t1 = time.time()
  78. multiple_cases_eval(configPath, singleReportPath, reportPath)
  79. t2 = time.time()
  80. print(f"程序结束,执行时间:{int(t2 - t1)} s")
  81. logger.info("MULTIPLE_CASES_EVAL: End.")