-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ff5ba8
commit a76f22f
Showing
4 changed files
with
239 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
# pylint: disable=missing-docstring | ||
import unittest | ||
import io | ||
|
||
from collections import OrderedDict as OD | ||
from utils_test import parse_param_val as ppv | ||
from bashi.globals import * # pylint: disable=wildcard-import,unused-wildcard-import | ||
from bashi.filter_software_dependency import software_dependency_filter_typechecked | ||
|
||
|
||
class TestOldGCCVersionInUbuntu2004(unittest.TestCase): | ||
def test_valid_gcc_is_in_ubuntu_2004_d1(self): | ||
for gcc_version in [7, 13, 99]: | ||
self.assertTrue( | ||
software_dependency_filter_typechecked( | ||
OD({HOST_COMPILER: ppv((GCC, gcc_version)), UBUNTU: ppv((UBUNTU, "22.04"))}), | ||
) | ||
) | ||
|
||
self.assertTrue( | ||
software_dependency_filter_typechecked( | ||
OD( | ||
{ | ||
HOST_COMPILER: ppv((GCC, gcc_version)), | ||
DEVICE_COMPILER: ppv((GCC, gcc_version)), | ||
UBUNTU: ppv((UBUNTU, "22.04")), | ||
} | ||
), | ||
) | ||
) | ||
for gcc_version in [7, 13, 99]: | ||
self.assertTrue( | ||
software_dependency_filter_typechecked( | ||
OD({HOST_COMPILER: ppv((GCC, gcc_version)), UBUNTU: ppv((UBUNTU, "20.04"))}), | ||
) | ||
) | ||
|
||
self.assertTrue( | ||
software_dependency_filter_typechecked( | ||
OD( | ||
{ | ||
HOST_COMPILER: ppv((GCC, gcc_version)), | ||
DEVICE_COMPILER: ppv((GCC, gcc_version)), | ||
UBUNTU: ppv((UBUNTU, "20.04")), | ||
} | ||
), | ||
) | ||
) | ||
for gcc_version in [1, 3, 6, 7, 13, 99]: | ||
self.assertTrue( | ||
software_dependency_filter_typechecked( | ||
OD({HOST_COMPILER: ppv((GCC, gcc_version)), UBUNTU: ppv((UBUNTU, "18.04"))}), | ||
) | ||
) | ||
for gcc_version in [1, 3, 6, 7, 13, 99]: | ||
self.assertTrue( | ||
software_dependency_filter_typechecked( | ||
OD({DEVICE_COMPILER: ppv((GCC, gcc_version)), UBUNTU: ppv((UBUNTU, "18.04"))}), | ||
) | ||
) | ||
for gcc_version in [1, 3, 6, 7, 13, 99]: | ||
self.assertTrue( | ||
software_dependency_filter_typechecked( | ||
OD( | ||
{ | ||
DEVICE_COMPILER: ppv((GCC, gcc_version)), | ||
UBUNTU: ppv((UBUNTU, "18.04")), | ||
} | ||
), | ||
) | ||
) | ||
for gcc_version in [1, 3, 6, 7, 13, 99]: | ||
self.assertTrue( | ||
software_dependency_filter_typechecked( | ||
OD( | ||
{ | ||
HOST_COMPILER: ppv((GCC, gcc_version)), | ||
UBUNTU: ppv((UBUNTU, "18.04")), | ||
} | ||
), | ||
) | ||
) | ||
|
||
def test_not_valid_gcc_is_in_ubuntu_2004_d1(self): | ||
for gcc_version in [6, 3, 1]: | ||
reason_msg = io.StringIO() | ||
self.assertFalse( | ||
software_dependency_filter_typechecked( | ||
OD({HOST_COMPILER: ppv((GCC, gcc_version)), UBUNTU: ppv((UBUNTU, "20.04"))}), | ||
reason_msg, | ||
), | ||
f"Host compiler GCC {gcc_version} + Ubuntu 20.4", | ||
) | ||
self.assertEqual( | ||
reason_msg.getvalue(), | ||
f"Host compiler GCC {gcc_version} is not available in Ubuntu 20.4", | ||
) | ||
for gcc_version in [6, 3, 1]: | ||
reason_msg = io.StringIO() | ||
self.assertFalse( | ||
software_dependency_filter_typechecked( | ||
OD({HOST_COMPILER: ppv((GCC, gcc_version)), UBUNTU: ppv((UBUNTU, "22.04"))}), | ||
reason_msg, | ||
), | ||
f"Host compiler GCC {gcc_version} + Ubuntu 22.4", | ||
) | ||
self.assertEqual( | ||
reason_msg.getvalue(), | ||
f"Host compiler GCC {gcc_version} is not available in Ubuntu 22.4", | ||
) | ||
|
||
for gcc_version in [6, 3, 1]: | ||
reason_msg = io.StringIO() | ||
self.assertFalse( | ||
software_dependency_filter_typechecked( | ||
OD({DEVICE_COMPILER: ppv((GCC, gcc_version)), UBUNTU: ppv((UBUNTU, "20.04"))}), | ||
reason_msg, | ||
), | ||
f"Device compiler GCC {gcc_version} + Ubuntu 20.4", | ||
) | ||
self.assertEqual( | ||
reason_msg.getvalue(), | ||
f"Device compiler GCC {gcc_version} is not available in Ubuntu 20.4", | ||
) | ||
for gcc_version in [6, 3, 1]: | ||
reason_msg = io.StringIO() | ||
self.assertFalse( | ||
software_dependency_filter_typechecked( | ||
OD({DEVICE_COMPILER: ppv((GCC, gcc_version)), UBUNTU: ppv((UBUNTU, "22.04"))}), | ||
reason_msg, | ||
), | ||
f"Device compiler GCC {gcc_version} + Ubuntu 22.4", | ||
) | ||
self.assertEqual( | ||
reason_msg.getvalue(), | ||
f"Device compiler GCC {gcc_version} is not available in Ubuntu 22.4", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters