コード例 #1
0
def handle_unit(args):
    cwd = os.path.join(os.path.abspath(os.curdir), 'test', 'unit')
    file_name = os.path.join(cwd, 'gtest-1.6.0.zip')
    util.download_to('http://googletest.googlecode.com/files/gtest-1.6.0.zip',
                     file_name,
                     '4577b49f2973c90bf9ba69aa8166b786',
                     verbose=True)
    if not os.path.exists(os.path.join(cwd, 'gtest-1.6.0')):
        subprocess.check_call(['unzip', file_name, '-d', cwd])

    util.make(cwd)
    bin = os.path.join(cwd, 'gtest_proto')

    subprocess.check_call([bin] + args,
                          stdin=sys.stdin,
                          stdout=sys.stdout,
                          stderr=sys.stderr)
コード例 #2
0
 def clean(self, level):
   if level == CACHE_CLEAN or level == DIST_CLEAN:
     if os.path.exists(self.local_tar):
       os.remove(self.local_tar)
     if level == CACHE_CLEAN:
       return
   for arch in self.arches:
     for opt,debug in self.opts:
       if level == CLEAN:
         if os.path.exists(self.ref_dir(arch, opt, self.make_dir)):
           util.make(self.ref_dir(arch, opt, make_dir), 'clean')
         if os.path.exists(self.proto_dir(arch, opt, self.make_dir)):
           util.make(self.proto_dir(arch, opt, make_dir), 'clean')
       else:
         if os.path.exists(self.ref_dir(arch, opt)):
           shutil.rmtree(self.ref_dir(arch, opt))
         if os.path.exists(self.proto_dir(arch, opt)):
           shutil.rmtree(self.proto_dir(arch, opt))
コード例 #3
0
ファイル: runner.py プロジェクト: plasma-umass/proto
def handle_unit(args):
  cwd = os.path.join(os.path.abspath(os.curdir),
                     'test',
                     'unit')
  file_name = os.path.join(cwd, 'gtest-1.6.0.zip')
  util.download_to('http://googletest.googlecode.com/files/gtest-1.6.0.zip',
                   file_name,
                   '4577b49f2973c90bf9ba69aa8166b786',
                   verbose=True)
  if not os.path.exists(os.path.join(cwd, 'gtest-1.6.0')):
    subprocess.check_call(['unzip', file_name, '-d', cwd])

  util.make(cwd)
  bin = os.path.join(cwd, 'gtest_proto')

  subprocess.check_call([bin] + args,
                        stdin = sys.stdin,
                        stdout = sys.stdout,
                        stderr = sys.stderr)
コード例 #4
0
def clean(tests, continue_failure, verbose, level):
    for test_suite in test_generator(tests, util.get_arches(), verbose):
        try:
            test_suite.clean(level)
        except Exception as e:
            handle_failure(test_suite, e)
            if not continue_failure:
                break
    if level != test.CACHE_CLEAN:
        # clean up pyc files, if they are there and the .py file is also there.
        for dir in clean_pyc_dirs:
            for file in dir:
                abs_file = os.path.join(os.path.abspath(os.curdir), dir, file)
                if os.path.isfile(abs_file):
                    (root, ext) = os.path.splitext(abs_file)
                    if ext == 'pyc':
                        py_file = root + '.py'
                        if os.path.exists(py_file) and os.path.isfile(py_file):
                            os.remove(abs_file)
    # finally make clean in the sub directory.
    util.make(os.path.join(os.path.abspath(os.curdir), 'test', 'unit'),
              'clean')
コード例 #5
0
ファイル: runner.py プロジェクト: plasma-umass/proto
def clean(tests,
          continue_failure,
          verbose,
          level):
  for test_suite in test_generator(tests, util.get_arches(), verbose):
    try:
      test_suite.clean(level)
    except Exception as e:
      handle_failure(test_suite, e)
      if not continue_failure:
        break
  if level != test.CACHE_CLEAN:
# clean up pyc files, if they are there and the .py file is also there.
    for dir in clean_pyc_dirs:
      for file in dir:
        abs_file = os.path.join(os.path.abspath(os.curdir), dir, file)
        if os.path.isfile(abs_file):
          (root, ext) = os.path.splitext(abs_file)
          if ext == 'pyc':
            py_file = root + '.py'
            if os.path.exists(py_file) and os.path.isfile(py_file):
              os.remove(abs_file)
  # finally make clean in the sub directory.
  util.make(os.path.join(os.path.abspath(os.curdir), 'test', 'unit'), 'clean')
コード例 #6
0
 def build_dir(self, build_dir, force_build=False):
   bin_file = os.path.join(build_dir, self.bin_name)
   if force_build or not os.path.exists(bin_file):
     util.make(build_dir, *self.make_args)