Ejemplo n.º 1
0
        def test_01():
            _logger.info("Getting sources before adding the extra source")
            sources_pre = getSourcesFrom()

            _logger.info("Paths found:")
            for source in sources_pre.keys():
                _logger.info(" - %s", source)

            it.assertItemsEqual(
                sources_pre.keys(),
                [handlePathPlease('another_library', 'foo.vhd'),
                 handlePathPlease('basic_library', 'clock_divider.vhd')])

            _logger.info("Adding the extra source...")

            sources_post = getSourcesFrom(
                it.sources +
                [('work', p.join('basic_library', 'very_common_pkg.vhd'))])

            _logger.info("Paths found:")
            for source in sources_post.keys():
                _logger.info(" - %s", source)

            it.assertItemsEqual(
                sources_post.keys(),
                [handlePathPlease('another_library', 'foo.vhd'),
                 handlePathPlease('basic_library', 'clock_divider.vhd'),
                 handlePathPlease('basic_library', 'very_common_pkg.vhd')])

            # Check the files originally found weren't re-created
            for path, source in sources_pre.items():
                it.assertEqual(source, sources_post[path])
Ejemplo n.º 2
0
        def test_01():
            _logger.info("Getting sources before adding the extra source")
            sources_pre = getSourcesFrom()

            _logger.info("Paths found:")
            for source in sources_pre.keys():
                _logger.info(" - %s", source)

            it.assertItemsEqual(sources_pre.keys(), [
                handlePathPlease('another_library', 'foo.vhd'),
                handlePathPlease('basic_library', 'clock_divider.vhd')
            ])

            _logger.info("Adding the extra source...")

            sources_post = getSourcesFrom(it.sources + [(
                'work', p.join('basic_library', 'very_common_pkg.vhd'))])

            _logger.info("Paths found:")
            for source in sources_post.keys():
                _logger.info(" - %s", source)

            it.assertItemsEqual(sources_post.keys(), [
                handlePathPlease('another_library', 'foo.vhd'),
                handlePathPlease('basic_library', 'clock_divider.vhd'),
                handlePathPlease('basic_library', 'very_common_pkg.vhd')
            ])

            # Check the files originally found weren't re-created
            for path, source in sources_pre.items():
                it.assertEqual(source, sources_post[path])
Ejemplo n.º 3
0
        def test_03():
            sources_pre = getSourcesFrom(it.sources + [(
                'work', p.join('basic_library', 'very_common_pkg.vhd'))])

            it.assertItemsEqual(sources_pre.keys(), [
                handlePathPlease('another_library', 'foo.vhd'),
                handlePathPlease('basic_library', 'clock_divider.vhd'),
                handlePathPlease('basic_library', 'very_common_pkg.vhd')
            ])

            sources_post = getSourcesFrom()

            it.assertItemsEqual(sources_post.keys(), [
                handlePathPlease('another_library', 'foo.vhd'),
                handlePathPlease('basic_library', 'clock_divider.vhd')
            ])
Ejemplo n.º 4
0
        def test_03():
            sources_pre = getSourcesFrom(
                it.sources +
                [('work', p.join('basic_library', 'very_common_pkg.vhd'))])

            it.assertItemsEqual(
                sources_pre.keys(),
                [handlePathPlease('another_library', 'foo.vhd'),
                 handlePathPlease('basic_library', 'clock_divider.vhd'),
                 handlePathPlease('basic_library', 'very_common_pkg.vhd')])

            sources_post = getSourcesFrom()

            it.assertItemsEqual(
                sources_post.keys(),
                [handlePathPlease('another_library', 'foo.vhd'),
                 handlePathPlease('basic_library', 'clock_divider.vhd')])
Ejemplo n.º 5
0
        def test_02():
            sources_pre = getSourcesFrom(
                it.sources +
                [('work', p.join('basic_library', 'very_common_pkg.vhd'))])

            sources_post = getSourcesFrom(
                it.sources +
                [('foo_lib', p.join('basic_library', 'very_common_pkg.vhd'))])

            it.assertItemsEqual(
                sources_post.keys(),
                [handlePathPlease('another_library', 'foo.vhd'),
                 handlePathPlease('basic_library', 'clock_divider.vhd'),
                 handlePathPlease('basic_library', 'very_common_pkg.vhd')])

            added_path = handlePathPlease('basic_library', 'very_common_pkg.vhd')

            added_source = sources_post[added_path]

            # Check that the sources that have been previously added are
            # the same
            for path in [
                    handlePathPlease('another_library', 'foo.vhd'),
                    handlePathPlease('basic_library', 'clock_divider.vhd')]:
                it.assertEqual(sources_pre[path], sources_post[path])

            _logger.warning("added path: %s", added_path)
            _logger.warning("sources pre:\n%s", "\n".join(sources_pre.keys()))
            _logger.warning("sources post:\n%s", "\n".join(sources_post.keys()))
            # Check that the source we changed library has changed
            it.assertNotEqual(sources_pre[added_path], sources_post[added_path])
            it.assertEqual(added_source.library, 'foo_lib')

            # Also, check that there is no extra source left behind
            it.assertEqual(len(sources_pre), len(sources_post))
Ejemplo n.º 6
0
        def test_02():
            sources_pre = getSourcesFrom(it.sources + [(
                'work', p.join('basic_library', 'very_common_pkg.vhd'))])

            sources_post = getSourcesFrom(it.sources + [(
                'foo_lib', p.join('basic_library', 'very_common_pkg.vhd'))])

            it.assertItemsEqual(sources_post.keys(), [
                handlePathPlease('another_library', 'foo.vhd'),
                handlePathPlease('basic_library', 'clock_divider.vhd'),
                handlePathPlease('basic_library', 'very_common_pkg.vhd')
            ])

            added_path = handlePathPlease('basic_library',
                                          'very_common_pkg.vhd')

            added_source = sources_post[added_path]

            # Check that the sources that have been previously added are
            # the same
            for path in [
                    handlePathPlease('another_library', 'foo.vhd'),
                    handlePathPlease('basic_library', 'clock_divider.vhd')
            ]:
                it.assertEqual(sources_pre[path], sources_post[path])

            _logger.warning("added path: %s", added_path)
            _logger.warning("sources pre:\n%s", "\n".join(sources_pre.keys()))
            _logger.warning("sources post:\n%s",
                            "\n".join(sources_post.keys()))
            # Check that the source we changed library has changed
            it.assertNotEqual(sources_pre[added_path],
                              sources_post[added_path])
            it.assertEqual(added_source.library, 'foo_lib')

            # Also, check that there is no extra source left behind
            it.assertEqual(len(sources_pre), len(sources_post))