Exemple #1
0
  def test_get_compile_args(self):
    classpath = [os.path.join(self.build_root, 'foo.jar'),
                 '/outside-build-root/bar.jar']
    sources = ['X.scala']

    args = ZincUtils._get_compile_args([], classpath, sources, 'bogus output dir',
                                        'bogus analysis file', [])
    classpath_found = False
    classpath_correct = False
    for arg in args:
      if classpath_found:
        self.assertEquals('foo.jar:/outside-build-root/bar.jar', arg)
        classpath_correct = True
        break
      if arg == '-classpath':
        classpath_found = True
    self.assertTrue(classpath_correct)
Exemple #2
0
  def test_get_compile_args(self):
    jar_outside_build_root = os.path.join(os.path.sep, 'outside-build-root', 'bar.jar')
    classpath = [os.path.join(self.build_root, 'foo.jar'), jar_outside_build_root]
    sources = ['X.scala']

    args = ZincUtils._get_compile_args([], classpath, sources, 'bogus output dir',
                                        'bogus analysis file', [])
    classpath_found = False
    classpath_correct = False
    for arg in args:
      if classpath_found:
        # Classpath elements are always relative to the build root.
        jar_relpath = os.path.relpath(jar_outside_build_root, self.build_root)
        self.assertEquals('foo.jar:{0}'.format(jar_relpath), arg)
        classpath_correct = True
        break
      if arg == '-classpath':
        classpath_found = True
    self.assertTrue(classpath_correct)
Exemple #3
0
    def test_get_compile_args(self):
        jar_outside_build_root = os.path.join(os.path.sep,
                                              'outside-build-root', 'bar.jar')
        classpath = [
            os.path.join(self.build_root, 'foo.jar'), jar_outside_build_root
        ]
        sources = ['X.scala']

        args = ZincUtils._get_compile_args([], classpath, sources,
                                           'bogus output dir',
                                           'bogus analysis file', [])
        classpath_found = False
        classpath_correct = False
        for arg in args:
            if classpath_found:
                # Classpath elements are always relative to the build root.
                jar_relpath = os.path.relpath(jar_outside_build_root,
                                              self.build_root)
                self.assertEquals('foo.jar:{0}'.format(jar_relpath), arg)
                classpath_correct = True
                break
            if arg == '-classpath':
                classpath_found = True
        self.assertTrue(classpath_correct)