suite.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. '''
  2. /*#############################################################################
  3. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. ############################################################################ */
  14. '''
  15. import os
  16. from ..util.ecl.file import ECLFile
  17. class Suite:
  18. def __init__(self, name, dir_ec, dir_a, dir_ex, dir_r):
  19. self.name = name
  20. self.suite = []
  21. self.dir_ec = dir_ec
  22. self.dir_a = dir_a
  23. self.dir_ex = dir_ex
  24. self.dir_r = dir_r
  25. self.buildSuite()
  26. def buildSuite(self):
  27. if not os.path.isdir(self.dir_ec):
  28. raise Exception("ECL Directory does not exist.")
  29. for files in os.listdir(self.dir_ec):
  30. if files.endswith(".ecl"):
  31. ecl = os.path.join(self.dir_ec, files)
  32. eclfile = ECLFile(ecl, self.dir_a, self.dir_ex,
  33. self.dir_r)
  34. if not eclfile.testSkip(self.name)['skip']:
  35. self.suite.append(eclfile)
  36. self.suite.reverse()
  37. def getSuite(self):
  38. return self.suite