def test_thirdparty_package_ignores_non_c_non_cpp(self): r = PackageResolver(P('r')/'g1') p = r.resolve('g1+p6', {}) assert('g1+p6' == p.name) assert([] == p.dependencies()) assert([str(P('r')/'g1'/'g1+p6')] == list(p.includes())) assert([] == list(p.sources()))
def test_thirdparty_package_with_header(self): r = PackageResolver(P('r')/'g1') p = r.resolve('g1+p7', {}) assert('g1+p7' == p.name) assert([] == p.dependencies()) assert([str(P('r')/'g1'/'g1+p7')] == list(p.includes())) assert([str(P('r')/'g1'/'g1+p7'/'a.h')] == list(p.headers()))
def test_empty_package(self): r = PackageResolver(P('r')/'g1') p = r.resolve('g1p1', {}) assert('g1p1' == p.name) assert([] == p.dependencies()) assert([str(P('r')/'g1'/'g1p1')] == list(p.includes())) assert([] == list(p.sources()))
def test_thirdparty_package_lists_cs(self): r = PackageResolver(P('r')/'g1') p = r.resolve('g1+p5', {}) assert('g1+p5' == p.name) assert([] == p.dependencies()) assert([str(P('r')/'g1'/'g1+p5')] == list(p.includes())) assert([str(P('r')/'g1'/'g1+p5'/'a.c')] == list(p.sources()))
def test_level_one_group_resolution_packages(self): ur = TargetResolver(self.config) pr = PackageResolver(P('r') / 'groups' / 'gr1') gr1 = ur.resolve('gr1', {}) assert ('gr1' == gr1) assert (resolve(pr, ['gr1p1', 'gr1p2']) == gr1._packages)
def test_one_non_driver_component(self): r = PackageResolver(P('r')/'g1') p = r.resolve('g1p2', {}) assert('g1p2' == p.name) assert([] == p.dependencies()) assert([str(P('r')/'g1'/'g1p2')] == list(p.includes())) assert([str(P('r')/'g1'/'g1p2'/'g1p2_c1.cpp')] == list(p.sources())) assert([] == list(p.drivers()))
def test_empty_package_with_dependency(self): r = PackageResolver(P('r')/'g2') p1 = r.resolve('g2p1', {}) assert('g2p1' == p1.name) assert([] == p1.dependencies()) p2 = r.resolve('g2p2', { 'g2p1': p1 }) assert('g2p2' == p2.name) assert([p1] == p2.dependencies())
def test_one_driver_component(self): r = PackageResolver(P('r') / 'g1') p = r.resolve('g1p3', {}) assert ('g1p3' == p) assert ([] == p.dependencies()) assert ([P('r') / 'g1' / 'g1p3'] == list(p.includes())) assert ([P('r') / 'g1' / 'g1p3' / 'g1p3_c1.h'] == list(p.headers())) assert ([P('r') / 'g1' / 'g1p3' / 'g1p3_c1.cpp'] == list(p.sources())) assert ([P('r') / 'g1' / 'g1p3' / 'g1p3_c1.t.cpp' ] == list(p.drivers()))
def test_thirdparty_package_lists_cpps(self): r = PackageResolver(P('r')/'g1') p = r.resolve('g1+p4', {}) assert('g1+p4' == p.name) assert([] == p.dependencies()) assert([str(P('r')/'g1'/'g1+p4')] == list(p.includes())) assert(2 == len(list(p.sources()))) assert(str(P('r')/'g1'/'g1+p4'/'a.cpp') in list(p.sources())) assert(str(P('r')/'g1'/'g1+p4'/'b.cpp') in list(p.sources()))
def test_level_two_package_has_dependency(self): r = PackageResolver(P('r')/'g2') p1 = r.resolve('g2p1', {}) assert('g2p1' == p1.name) assert([] == p1.dependencies()) assert([str(P('r')/'g2'/'g2p1')] == list(p1.includes())) assert(0 == len(list(p1.sources()))) p2 = r.resolve('g2p2', { 'g2p1': p1 }) assert('g2p2' == p2.name) assert([p1] == p2.dependencies()) assert([str(P('r')/'g2'/'g2p2')] == list(p2.includes())) assert([] == list(p2.sources()))
def test_non_empty_dependencies(self): r = PackageResolver(P('r')/'g2') assert(set(['g2p1']) == r.dependencies('g2p2'))
def test_empty_dependencies(self): r = PackageResolver(P('r')/'g1') assert(set() == r.dependencies('g1p1'))