Пример #1
0
    def test_xctest(self):
        # Test: Project using XCTest
        path = os.path.join(REPOS_PATH, 'Sparkle')
        proportion = self.discoverer.__xctest__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using XCTest
        path = os.path.join(REPOS_PATH, 'WebScraper-iOS')
        proportion = self.discoverer.__xctest__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)

        # Bug Fix Tests

        # Bug: If relative file paths in the input to utilities.loc() contained
        #   spaces then cloc would fail causing loc() to return None.
        path = os.path.join(
            REPOS_PATH, 'UITableViewController-Challenge-Solution'
        )
        proportion = self.discoverer.__xctest__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)
Пример #2
0
    def test_rspec(self):
        # Test: Project using RSpec
        path = os.path.join(REPOS_PATH, "squib")
        proportion = self.discoverer.__rspec__(path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        # Test: Project not using RSpec
        path = os.path.join(REPOS_PATH, "ruby-git")
        proportion = self.discoverer.__rspec__(path, get_lsloc(path, self.discoverer.languages))
        self.assertEqual(0, proportion)
Пример #3
0
    def test_ruby_unit_testing(self):
        # Test: Project using Ruby Unit Testing
        path = os.path.join(REPOS_PATH, "janky")
        proportion = self.discoverer.__ruby_unit_testing__(path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        # Test: Project not using Ruby Unit Testing
        path = os.path.join(REPOS_PATH, "squib")
        proportion = self.discoverer.__ruby_unit_testing__(path, get_lsloc(path, self.discoverer.languages))
        self.assertEqual(0, proportion)
Пример #4
0
    def test_catch(self):
        # Test: Project using Catch
        path = os.path.join(REPOS_PATH, 'variant')
        proportion = self.discoverer.__catch__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        # Test: Project not using Catch
        path = os.path.join(REPOS_PATH, 'electron')
        proportion = self.discoverer.__catch__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertEqual(0, proportion)
Пример #5
0
    def test_boost(self):
        # Test: Project using Boost
        path = os.path.join(REPOS_PATH, 'externals-clasp')
        proportion = self.discoverer.__boost__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        # Test: Project not using Boost
        path = os.path.join(REPOS_PATH, 'openage')
        proportion = self.discoverer.__boost__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertEqual(0, proportion)
Пример #6
0
    def test_assert(self):
        # Test: Project using assert.h
        path = os.path.join(REPOS_PATH, 'IEDiagnosticsAdapter')
        proportion = self.discoverer.__assert__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        # Test: Project not using assert.h
        path = os.path.join(REPOS_PATH, 'electron')
        proportion = self.discoverer.__assert__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertEqual(0, proportion)
Пример #7
0
    def test_stout_gtest(self):
        # Test: Project using Stout Gtest
        path = os.path.join(REPOS_PATH, 'mesos')
        proportion = self.discoverer.__stout_gtest__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        # Test: Project not using Stout Gtest
        path = os.path.join(REPOS_PATH, 'electron')
        proportion = self.discoverer.__boost__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertEqual(0, proportion)
Пример #8
0
    def test_ruby_unit_testing(self):
        # Test: Project using Ruby Unit Testing
        path = os.path.join(REPOS_PATH, 'janky')
        proportion = self.discoverer.__ruby_unit_testing__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        # Test: Project not using Ruby Unit Testing
        path = os.path.join(REPOS_PATH, 'squib')
        proportion = self.discoverer.__ruby_unit_testing__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertEqual(0, proportion)
Пример #9
0
    def test_nose(self):
        # Test: Project using Nose Test
        path = os.path.join(REPOS_PATH, 'mbutil')
        proportion = self.discoverer.__nose__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        # Test: Project not using Nose Test
        path = os.path.join(REPOS_PATH, 'django-crispy-forms')
        proportion = self.discoverer.__nose__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertEqual(0, proportion)
Пример #10
0
    def test_unittest(self):
        # Test: Project using unittest
        path = os.path.join(REPOS_PATH, 'ansible')
        proportion = self.discoverer.__unittest__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        # Test: Project not using unittest
        path = os.path.join(REPOS_PATH, 'django-crispy-forms')
        proportion = self.discoverer.__unittest__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertEqual(0, proportion)
Пример #11
0
    def test_rspec(self):
        # Test: Project using RSpec
        path = os.path.join(REPOS_PATH, 'squib')
        proportion = self.discoverer.__rspec__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        # Test: Project not using RSpec
        path = os.path.join(REPOS_PATH, 'ruby-git')
        proportion = self.discoverer.__rspec__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertEqual(0, proportion)
Пример #12
0
    def test_clar(self):
        # Test: Project using clar.h
        path = os.path.join(REPOS_PATH, 'libgit2')
        proportion = self.discoverer.__clar__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using clar.h
        path = os.path.join(REPOS_PATH, 'lwan')
        proportion = self.discoverer.__clar__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
    def test_xunit(self):
        # Test: Project using XUnit
        path = os.path.join(REPOS_PATH, 'WebSockets')
        proportion = self.discoverer.__xunit__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using XUnit
        path = os.path.join(REPOS_PATH, 'choco')
        proportion = self.discoverer.__xunit__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
    def test_vs_unit_testing(self):
        # Test: Project using Visual Studio Unit Testing
        path = os.path.join(REPOS_PATH, 'aws-sdk-net')
        proportion = self.discoverer.__vs_unit_testing__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using Visual Studio Unit Testing
        path = os.path.join(REPOS_PATH, 'choco')
        proportion = self.discoverer.__vs_unit_testing__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
Пример #15
0
    def test_glib(self):
        # Test: Project using GLib
        path = os.path.join(REPOS_PATH, 'gnome-vfs')
        proportion = self.discoverer.__glib__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using GLib
        path = os.path.join(REPOS_PATH, 'grs')
        proportion = self.discoverer.__glib__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
    def test_mocha(self):
        # Test: Project using Mocha
        path = os.path.join(REPOS_PATH, 'superagent')
        proportion = self.discoverer.__mocha__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using Mocha
        path = os.path.join(REPOS_PATH, 'qunit')
        proportion = self.discoverer.__mocha__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
Пример #17
0
    def test_picotest(self):
        # Test: Project using Picotest
        path = os.path.join(REPOS_PATH, 'h2o')
        proportion = self.discoverer.__picotest__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using Picotest
        path = os.path.join(REPOS_PATH, 'grs')
        proportion = self.discoverer.__picotest__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
Пример #18
0
    def test_minitest(self):
        # Test: Project using Minitest
        path = os.path.join(REPOS_PATH, "linguist")
        proportion = self.discoverer.__minitest__(path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        path = os.path.join(REPOS_PATH, "docurium")
        proportion = self.discoverer.__minitest__(path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        # Test: Project not using Minitest
        path = os.path.join(REPOS_PATH, "ruby-git")
        proportion = self.discoverer.__minitest__(path, get_lsloc(path, self.discoverer.languages))
        self.assertEqual(0, proportion)
Пример #19
0
    def test_assert(self):
        # Test: Project using assert.h
        path = os.path.join(REPOS_PATH, 'http-parser')
        proportion = self.discoverer.__assert__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using assert.h
        path = os.path.join(REPOS_PATH, 'grs')
        proportion = self.discoverer.__assert__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
Пример #20
0
    def test_nose(self):
        # Test: Project using Nose Test
        path = os.path.join(REPOS_PATH, 'mbutil')
        proportion = self.discoverer.__nose__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using Nose Test
        path = os.path.join(REPOS_PATH, 'django-crispy-forms')
        proportion = self.discoverer.__nose__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
Пример #21
0
    def test_unittest(self):
        # Test: Project using unittest
        path = os.path.join(REPOS_PATH, 'ansible')
        proportion = self.discoverer.__unittest__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using unittest
        path = os.path.join(REPOS_PATH, 'django-crispy-forms')
        proportion = self.discoverer.__unittest__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
Пример #22
0
    def test_catch(self):
        # Test: Project using Catch
        path = os.path.join(REPOS_PATH, 'variant')
        proportion = self.discoverer.__catch__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using Catch
        path = os.path.join(REPOS_PATH, 'electron')
        proportion = self.discoverer.__catch__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
    def test_testng(self):
        # Test: Project using TestNG
        path = os.path.join(REPOS_PATH, 'SimianArmy')
        proportion = self.discoverer.__testng__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using TestNG
        path = os.path.join(REPOS_PATH, 'maven')
        proportion = self.discoverer.__testng__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
Пример #24
0
    def test_stout_gtest(self):
        # Test: Project using Stout Gtest
        path = os.path.join(REPOS_PATH, 'mesos')
        proportion = self.discoverer.__stout_gtest__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using Stout Gtest
        path = os.path.join(REPOS_PATH, 'electron')
        proportion = self.discoverer.__boost__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
Пример #25
0
    def test_boost(self):
        # Test: Project using Boost
        path = os.path.join(REPOS_PATH, 'externals-clasp')
        proportion = self.discoverer.__boost__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using Boost
        path = os.path.join(REPOS_PATH, 'openage')
        proportion = self.discoverer.__boost__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
Пример #26
0
    def test_assert(self):
        # Test: Project using assert.h
        path = os.path.join(REPOS_PATH, 'IEDiagnosticsAdapter')
        proportion = self.discoverer.__assert__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using assert.h
        path = os.path.join(REPOS_PATH, 'electron')
        proportion = self.discoverer.__assert__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
Пример #27
0
 def test_no_mocha(self):
     # Test: Project not using Mocha
     path = os.path.join(REPOS_PATH, 'jquery-mobile')
     proportion = self.discoverer.__mocha__(
         path, get_lsloc(path, self.discoverer.languages)
     )
     self.assertEqual(0, proportion)
Пример #28
0
 def test_qunit(self):
     # Test: Project using Mocha
     path = os.path.join(REPOS_PATH, 'jquery-mobile')
     proportion = self.discoverer.__qunit__(
         path, get_lsloc(path, self.discoverer.languages)
     )
     self.assertLess(0, proportion)
Пример #29
0
    def test_minitest(self):
        # Test: Project using Minitest
        path = os.path.join(REPOS_PATH, 'linguist')
        proportion = self.discoverer.__minitest__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        path = os.path.join(REPOS_PATH, 'docurium')
        proportion = self.discoverer.__minitest__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        # Test: Project not using Minitest
        path = os.path.join(REPOS_PATH, 'ruby-git')
        proportion = self.discoverer.__minitest__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertEqual(0, proportion)
    def test_junit(self):
        # Test: Project using JUnit
        path = os.path.join(REPOS_PATH, 'maven')
        proportion = self.discoverer.__junit__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project using JUnit without mention in pom.xml
        path = os.path.join(REPOS_PATH, 'cassandra')
        proportion = self.discoverer.__junit__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using JUnit
        path = os.path.join(REPOS_PATH, 'MPAndroidChart')
        proportion = self.discoverer.__junit__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
Пример #31
0
    def test_phpunit(self):
        # Test: Project using PHPUnit
        path = os.path.join(REPOS_PATH, 'composer')
        proportion = self.discoverer.__phpunit__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project using PHPUnit Database Extensions
        path = os.path.join(REPOS_PATH, 'microrest.php')
        proportion = self.discoverer.__phpunit__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertLess(0, proportion)

        # Test: Project not using PHPUnit
        path = os.path.join(REPOS_PATH, 'laravel')
        proportion = self.discoverer.__phpunit__(
            path, get_lsloc(path, self.discoverer.languages)
        )
        self.assertEqual(0, proportion)
Пример #32
0
    def test_xctest(self):
        # Test: Project using XCTest
        path = os.path.join(REPOS_PATH, 'Sparkle')
        proportion = self.discoverer.__xctest__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)

        # Test: Project not using XCTest
        path = os.path.join(REPOS_PATH, 'WebScraper-iOS')
        proportion = self.discoverer.__xctest__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertEqual(0, proportion)

        # Bug Fix Tests

        # Bug: If relative file paths in the input to utilities.loc() contained
        #   spaces then cloc would fail causing loc() to return None.
        path = os.path.join(REPOS_PATH,
                            'UITableViewController-Challenge-Solution')
        proportion = self.discoverer.__xctest__(
            path, get_lsloc(path, self.discoverer.languages))
        self.assertLess(0, proportion)