engine.py 667 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. from __future__ import print_function
  2. #
  3. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  4. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  5. #
  6. import datetime
  7. import os
  8. import pprint
  9. import random
  10. import re
  11. import shlex
  12. import subprocess
  13. import signal
  14. import sys
  15. import time
  16. from .test_utils import *
  17. from .test_api import *
  18. def read_cases_from_file(file_path):
  19. if not os.path.exists(file_path):
  20. return False, None
  21. with open(file_path, 'r') as f:
  22. content = f.readlines()
  23. content = [x.strip() for x in content]
  24. print(content)
  25. if len(content) == 0:
  26. return False, None
  27. return True, content