summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/data.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/tests/data.py')
-rw-r--r--bitbake/lib/bb/tests/data.py52
1 files changed, 26 insertions, 26 deletions
diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py
index 1d4a64b109..add1b13600 100644
--- a/bitbake/lib/bb/tests/data.py
+++ b/bitbake/lib/bb/tests/data.py
@@ -245,35 +245,35 @@ class TestConcatOverride(unittest.TestCase):
245 245
246 def test_prepend(self): 246 def test_prepend(self):
247 self.d.setVar("TEST", "${VAL}") 247 self.d.setVar("TEST", "${VAL}")
248 self.d.setVar("TEST_prepend", "${FOO}:") 248 self.d.setVar("TEST:prepend", "${FOO}:")
249 self.assertEqual(self.d.getVar("TEST"), "foo:val") 249 self.assertEqual(self.d.getVar("TEST"), "foo:val")
250 250
251 def test_append(self): 251 def test_append(self):
252 self.d.setVar("TEST", "${VAL}") 252 self.d.setVar("TEST", "${VAL}")
253 self.d.setVar("TEST_append", ":${BAR}") 253 self.d.setVar("TEST:append", ":${BAR}")
254 self.assertEqual(self.d.getVar("TEST"), "val:bar") 254 self.assertEqual(self.d.getVar("TEST"), "val:bar")
255 255
256 def test_multiple_append(self): 256 def test_multiple_append(self):
257 self.d.setVar("TEST", "${VAL}") 257 self.d.setVar("TEST", "${VAL}")
258 self.d.setVar("TEST_prepend", "${FOO}:") 258 self.d.setVar("TEST:prepend", "${FOO}:")
259 self.d.setVar("TEST_append", ":val2") 259 self.d.setVar("TEST:append", ":val2")
260 self.d.setVar("TEST_append", ":${BAR}") 260 self.d.setVar("TEST:append", ":${BAR}")
261 self.assertEqual(self.d.getVar("TEST"), "foo:val:val2:bar") 261 self.assertEqual(self.d.getVar("TEST"), "foo:val:val2:bar")
262 262
263 def test_append_unset(self): 263 def test_append_unset(self):
264 self.d.setVar("TEST_prepend", "${FOO}:") 264 self.d.setVar("TEST:prepend", "${FOO}:")
265 self.d.setVar("TEST_append", ":val2") 265 self.d.setVar("TEST:append", ":val2")
266 self.d.setVar("TEST_append", ":${BAR}") 266 self.d.setVar("TEST:append", ":${BAR}")
267 self.assertEqual(self.d.getVar("TEST"), "foo::val2:bar") 267 self.assertEqual(self.d.getVar("TEST"), "foo::val2:bar")
268 268
269 def test_remove(self): 269 def test_remove(self):
270 self.d.setVar("TEST", "${VAL} ${BAR}") 270 self.d.setVar("TEST", "${VAL} ${BAR}")
271 self.d.setVar("TEST_remove", "val") 271 self.d.setVar("TEST:remove", "val")
272 self.assertEqual(self.d.getVar("TEST"), " bar") 272 self.assertEqual(self.d.getVar("TEST"), " bar")
273 273
274 def test_remove_cleared(self): 274 def test_remove_cleared(self):
275 self.d.setVar("TEST", "${VAL} ${BAR}") 275 self.d.setVar("TEST", "${VAL} ${BAR}")
276 self.d.setVar("TEST_remove", "val") 276 self.d.setVar("TEST:remove", "val")
277 self.d.setVar("TEST", "${VAL} ${BAR}") 277 self.d.setVar("TEST", "${VAL} ${BAR}")
278 self.assertEqual(self.d.getVar("TEST"), "val bar") 278 self.assertEqual(self.d.getVar("TEST"), "val bar")
279 279
@@ -281,42 +281,42 @@ class TestConcatOverride(unittest.TestCase):
281 # (including that whitespace is preserved) 281 # (including that whitespace is preserved)
282 def test_remove_inactive_override(self): 282 def test_remove_inactive_override(self):
283 self.d.setVar("TEST", "${VAL} ${BAR} 123") 283 self.d.setVar("TEST", "${VAL} ${BAR} 123")
284 self.d.setVar("TEST_remove_inactiveoverride", "val") 284 self.d.setVar("TEST:remove_inactiveoverride", "val")
285 self.assertEqual(self.d.getVar("TEST"), "val bar 123") 285 self.assertEqual(self.d.getVar("TEST"), "val bar 123")
286 286
287 def test_doubleref_remove(self): 287 def test_doubleref_remove(self):
288 self.d.setVar("TEST", "${VAL} ${BAR}") 288 self.d.setVar("TEST", "${VAL} ${BAR}")
289 self.d.setVar("TEST_remove", "val") 289 self.d.setVar("TEST:remove", "val")
290 self.d.setVar("TEST_TEST", "${TEST} ${TEST}") 290 self.d.setVar("TEST_TEST", "${TEST} ${TEST}")
291 self.assertEqual(self.d.getVar("TEST_TEST"), " bar bar") 291 self.assertEqual(self.d.getVar("TEST_TEST"), " bar bar")
292 292
293 def test_empty_remove(self): 293 def test_empty_remove(self):
294 self.d.setVar("TEST", "") 294 self.d.setVar("TEST", "")
295 self.d.setVar("TEST_remove", "val") 295 self.d.setVar("TEST:remove", "val")
296 self.assertEqual(self.d.getVar("TEST"), "") 296 self.assertEqual(self.d.getVar("TEST"), "")
297 297
298 def test_remove_expansion(self): 298 def test_remove_expansion(self):
299 self.d.setVar("BAR", "Z") 299 self.d.setVar("BAR", "Z")
300 self.d.setVar("TEST", "${BAR}/X Y") 300 self.d.setVar("TEST", "${BAR}/X Y")
301 self.d.setVar("TEST_remove", "${BAR}/X") 301 self.d.setVar("TEST:remove", "${BAR}/X")
302 self.assertEqual(self.d.getVar("TEST"), " Y") 302 self.assertEqual(self.d.getVar("TEST"), " Y")
303 303
304 def test_remove_expansion_items(self): 304 def test_remove_expansion_items(self):
305 self.d.setVar("TEST", "A B C D") 305 self.d.setVar("TEST", "A B C D")
306 self.d.setVar("BAR", "B D") 306 self.d.setVar("BAR", "B D")
307 self.d.setVar("TEST_remove", "${BAR}") 307 self.d.setVar("TEST:remove", "${BAR}")
308 self.assertEqual(self.d.getVar("TEST"), "A C ") 308 self.assertEqual(self.d.getVar("TEST"), "A C ")
309 309
310 def test_remove_preserve_whitespace(self): 310 def test_remove_preserve_whitespace(self):
311 # When the removal isn't active, the original value should be preserved 311 # When the removal isn't active, the original value should be preserved
312 self.d.setVar("TEST", " A B") 312 self.d.setVar("TEST", " A B")
313 self.d.setVar("TEST_remove", "C") 313 self.d.setVar("TEST:remove", "C")
314 self.assertEqual(self.d.getVar("TEST"), " A B") 314 self.assertEqual(self.d.getVar("TEST"), " A B")
315 315
316 def test_remove_preserve_whitespace2(self): 316 def test_remove_preserve_whitespace2(self):
317 # When the removal is active preserve the whitespace 317 # When the removal is active preserve the whitespace
318 self.d.setVar("TEST", " A B") 318 self.d.setVar("TEST", " A B")
319 self.d.setVar("TEST_remove", "B") 319 self.d.setVar("TEST:remove", "B")
320 self.assertEqual(self.d.getVar("TEST"), " A ") 320 self.assertEqual(self.d.getVar("TEST"), " A ")
321 321
322class TestOverrides(unittest.TestCase): 322class TestOverrides(unittest.TestCase):
@@ -362,10 +362,10 @@ class TestOverrides(unittest.TestCase):
362 self.assertEqual(self.d.getVar("TEST"), "testvalue3") 362 self.assertEqual(self.d.getVar("TEST"), "testvalue3")
363 363
364 def test_rename_override(self): 364 def test_rename_override(self):
365 self.d.setVar("ALTERNATIVE_ncurses-tools_class-target", "a") 365 self.d.setVar("ALTERNATIVE:ncurses-tools:class-target", "a")
366 self.d.setVar("OVERRIDES", "class-target") 366 self.d.setVar("OVERRIDES", "class-target")
367 self.d.renameVar("ALTERNATIVE_ncurses-tools", "ALTERNATIVE_lib32-ncurses-tools") 367 self.d.renameVar("ALTERNATIVE:ncurses-tools", "ALTERNATIVE:lib32-ncurses-tools")
368 self.assertEqual(self.d.getVar("ALTERNATIVE_lib32-ncurses-tools"), "a") 368 self.assertEqual(self.d.getVar("ALTERNATIVE:lib32-ncurses-tools"), "a")
369 369
370 def test_underscore_override(self): 370 def test_underscore_override(self):
371 self.d.setVar("TEST_bar", "testvalue2") 371 self.d.setVar("TEST_bar", "testvalue2")
@@ -377,22 +377,22 @@ class TestOverrides(unittest.TestCase):
377 def test_remove_with_override(self): 377 def test_remove_with_override(self):
378 self.d.setVar("TEST_bar", "testvalue2") 378 self.d.setVar("TEST_bar", "testvalue2")
379 self.d.setVar("TEST_some_val", "testvalue3 testvalue5") 379 self.d.setVar("TEST_some_val", "testvalue3 testvalue5")
380 self.d.setVar("TEST_some_val_remove", "testvalue3") 380 self.d.setVar("TEST_some_val:remove", "testvalue3")
381 self.d.setVar("TEST_foo", "testvalue4") 381 self.d.setVar("TEST_foo", "testvalue4")
382 self.d.setVar("OVERRIDES", "foo:bar:some_val") 382 self.d.setVar("OVERRIDES", "foo:bar:some_val")
383 self.assertEqual(self.d.getVar("TEST"), " testvalue5") 383 self.assertEqual(self.d.getVar("TEST"), " testvalue5")
384 384
385 def test_append_and_override_1(self): 385 def test_append_and_override_1(self):
386 self.d.setVar("TEST_append", "testvalue2") 386 self.d.setVar("TEST:append", "testvalue2")
387 self.d.setVar("TEST_bar", "testvalue3") 387 self.d.setVar("TEST_bar", "testvalue3")
388 self.assertEqual(self.d.getVar("TEST"), "testvalue3testvalue2") 388 self.assertEqual(self.d.getVar("TEST"), "testvalue3testvalue2")
389 389
390 def test_append_and_override_2(self): 390 def test_append_and_override_2(self):
391 self.d.setVar("TEST_append_bar", "testvalue2") 391 self.d.setVar("TEST:append_bar", "testvalue2")
392 self.assertEqual(self.d.getVar("TEST"), "testvaluetestvalue2") 392 self.assertEqual(self.d.getVar("TEST"), "testvaluetestvalue2")
393 393
394 def test_append_and_override_3(self): 394 def test_append_and_override_3(self):
395 self.d.setVar("TEST_bar_append", "testvalue2") 395 self.d.setVar("TEST_bar:append", "testvalue2")
396 self.assertEqual(self.d.getVar("TEST"), "testvalue2") 396 self.assertEqual(self.d.getVar("TEST"), "testvalue2")
397 397
398 # Test an override with _<numeric> in it based on a real world OE issue 398 # Test an override with _<numeric> in it based on a real world OE issue
@@ -400,7 +400,7 @@ class TestOverrides(unittest.TestCase):
400 self.d.setVar("TARGET_ARCH", "x86_64") 400 self.d.setVar("TARGET_ARCH", "x86_64")
401 self.d.setVar("PN", "test-${TARGET_ARCH}") 401 self.d.setVar("PN", "test-${TARGET_ARCH}")
402 self.d.setVar("VERSION", "1") 402 self.d.setVar("VERSION", "1")
403 self.d.setVar("VERSION_pn-test-${TARGET_ARCH}", "2") 403 self.d.setVar("VERSION:pn-test-${TARGET_ARCH}", "2")
404 self.d.setVar("OVERRIDES", "pn-${PN}") 404 self.d.setVar("OVERRIDES", "pn-${PN}")
405 bb.data.expandKeys(self.d) 405 bb.data.expandKeys(self.d)
406 self.assertEqual(self.d.getVar("VERSION"), "2") 406 self.assertEqual(self.d.getVar("VERSION"), "2")
@@ -498,7 +498,7 @@ class TaskHash(unittest.TestCase):
498 d.setVar("VAR", "val") 498 d.setVar("VAR", "val")
499 # Adding an inactive removal shouldn't change the hash 499 # Adding an inactive removal shouldn't change the hash
500 d.setVar("BAR", "notbar") 500 d.setVar("BAR", "notbar")
501 d.setVar("MYCOMMAND_remove", "${BAR}") 501 d.setVar("MYCOMMAND:remove", "${BAR}")
502 nexthash = gettask_bashhash("mytask", d) 502 nexthash = gettask_bashhash("mytask", d)
503 self.assertEqual(orighash, nexthash) 503 self.assertEqual(orighash, nexthash)
504 504