2020-02-12 05:17:38 -05:00
|
|
|
# This file is Copyright (c) 2019-2020 Florent Kermarrec <florent@enjoy-digital.fr>
|
2019-11-24 05:23:13 -05:00
|
|
|
# License: BSD
|
|
|
|
|
|
|
|
import unittest
|
|
|
|
import os
|
|
|
|
|
2020-02-12 05:17:38 -05:00
|
|
|
def build_config(name):
|
|
|
|
errors = 0
|
|
|
|
os.system("rm -rf examples/build")
|
|
|
|
os.system("cd examples && python3 ../liteeth/gen.py {}.yml".format(name))
|
|
|
|
errors += not os.path.isfile("examples/build/gateware/liteeth_core.v")
|
|
|
|
os.system("rm -rf examples/build")
|
|
|
|
return errors
|
2019-11-24 05:23:13 -05:00
|
|
|
|
2020-02-12 05:17:38 -05:00
|
|
|
class TestExamples(unittest.TestCase):
|
|
|
|
def test_udp_s7phyrgmii(self):
|
|
|
|
errors = build_config("udp_s7phyrgmii")
|
|
|
|
self.assertEqual(errors, 0)
|
|
|
|
|
|
|
|
def test_wishbone_mii(self):
|
|
|
|
errors = build_config("wishbone_mii")
|
|
|
|
self.assertEqual(errors, 0)
|