Skip to content

Commit 2c64f4a

Browse files
committed
add test to check for handling of different types of patches for an extension
1 parent 27d7c07 commit 2c64f4a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/framework/toy_build.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,33 @@ def test_toy_patches(self):
11321132
archived_patch_file = os.path.join(repositorypath, 'toy', 'toy-0.0_fix-silly-typo-in-printf-statement.patch')
11331133
self.assertTrue(os.path.isfile(archived_patch_file))
11341134

1135+
def test_toy_extension_patches(self):
1136+
"""Test install toy that includes extensions with patches."""
1137+
test_ecs = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'easyconfigs', 'test_ecs')
1138+
toy_ec = os.path.join(test_ecs, 't', 'toy', 'toy-0.0.eb')
1139+
toy_ec_txt = read_file(toy_ec)
1140+
1141+
# create file that we'll copy via 'patches'
1142+
write_file(os.path.join(self.test_prefix, 'test.txt'), 'test123')
1143+
1144+
test_ec = os.path.join(self.test_prefix, 'test.eb')
1145+
test_ec_txt = '\n'.join([
1146+
toy_ec_txt,
1147+
'exts_list = [',
1148+
' ("bar", "0.0", {',
1149+
' "buildopts": " && ls -l test.txt",',
1150+
' "patches": [',
1151+
' "bar-0.0_fix-silly-typo-in-printf-statement.patch",', # normal patch
1152+
' ("bar-0.0_fix-very-silly-typo-in-printf-statement.patch", 0),', # patch with patch level
1153+
' ("test.txt", "."),', # file to copy to build dir (not a real patch file)
1154+
' ],',
1155+
' }),',
1156+
']',
1157+
])
1158+
write_file(test_ec, test_ec_txt)
1159+
1160+
self.test_toy_build(ec_file=test_ec)
1161+
11351162
def test_toy_module_fulltxt(self):
11361163
"""Strict text comparison of generated module file."""
11371164
self.test_toy_tweaked()

0 commit comments

Comments
 (0)