|
263 | 263 | - EB_toytoy (easybuild.easyblocks.toytoy @ %(topdir)s/t/toytoy.py)
|
264 | 264 | - Toy_Extension (easybuild.easyblocks.generic.toy_extension @ %(topdir)s/generic/toy_extension.py)"""
|
265 | 265 |
|
| 266 | +LIST_SOFTWARE_SIMPLE_TXT = """ |
| 267 | +* GCC |
| 268 | +* gzip""" |
| 269 | + |
| 270 | +GCC_DESCR = "The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, " |
| 271 | +GCC_DESCR += "as well as libraries for these languages (libstdc++, libgcj,...)." |
| 272 | +GZIP_DESCR = "gzip (GNU zip) is a popular data compression program as a replacement for compress" |
| 273 | + |
| 274 | +LIST_SOFTWARE_DETAILED_TXT = """ |
| 275 | +* GCC |
| 276 | +
|
| 277 | +%(gcc_descr)s |
| 278 | +
|
| 279 | +homepage: http://gcc.gnu.org/ |
| 280 | +
|
| 281 | + * GCC v4.6.3: system |
| 282 | +
|
| 283 | +* gzip |
| 284 | +
|
| 285 | +%(gzip_descr)s |
| 286 | +
|
| 287 | +homepage: http://www.gzip.org/ |
| 288 | +
|
| 289 | + * gzip v1.4: GCC/4.6.3, system |
| 290 | + * gzip v1.5: foss/2018a, intel/2018a |
| 291 | +""" % {'gcc_descr': GCC_DESCR, 'gzip_descr': GZIP_DESCR} |
| 292 | + |
| 293 | +LIST_SOFTWARE_SIMPLE_RST = """List of supported software |
| 294 | +========================== |
| 295 | +
|
| 296 | +EasyBuild |version| supports 2 different software packages (incl. toolchains, bundles): |
| 297 | +
|
| 298 | +:ref:`list_software_letter_g` |
| 299 | +
|
| 300 | +
|
| 301 | +.. _list_software_letter_g: |
| 302 | +
|
| 303 | +*G* |
| 304 | +--- |
| 305 | +
|
| 306 | +* GCC |
| 307 | +* gzip""" |
| 308 | + |
| 309 | +LIST_SOFTWARE_DETAILED_RST = """List of supported software |
| 310 | +========================== |
| 311 | +
|
| 312 | +EasyBuild |version| supports 2 different software packages (incl. toolchains, bundles): |
| 313 | +
|
| 314 | +:ref:`list_software_letter_g` |
| 315 | +
|
| 316 | +
|
| 317 | +.. _list_software_letter_g: |
| 318 | +
|
| 319 | +*G* |
| 320 | +--- |
| 321 | +
|
| 322 | +
|
| 323 | +:ref:`list_software_GCC_205` - :ref:`list_software_gzip_442` |
| 324 | +
|
| 325 | +
|
| 326 | +.. _list_software_GCC_205: |
| 327 | +
|
| 328 | +*GCC* |
| 329 | ++++++ |
| 330 | +
|
| 331 | +%(gcc_descr)s |
| 332 | +
|
| 333 | +*homepage*: http://gcc.gnu.org/ |
| 334 | +
|
| 335 | +========= ========== |
| 336 | +version toolchain |
| 337 | +========= ========== |
| 338 | +``4.6.3`` ``system`` |
| 339 | +========= ========== |
| 340 | +
|
| 341 | +
|
| 342 | +.. _list_software_gzip_442: |
| 343 | +
|
| 344 | +*gzip* |
| 345 | +++++++ |
| 346 | +
|
| 347 | +%(gzip_descr)s |
| 348 | +
|
| 349 | +*homepage*: http://www.gzip.org/ |
| 350 | +
|
| 351 | +======= =============================== |
| 352 | +version toolchain |
| 353 | +======= =============================== |
| 354 | +``1.4`` ``GCC/4.6.3``, ``system`` |
| 355 | +``1.5`` ``foss/2018a``, ``intel/2018a`` |
| 356 | +======= =============================== |
| 357 | +""" % {'gcc_descr': GCC_DESCR, 'gzip_descr': GZIP_DESCR} |
| 358 | + |
| 359 | +LIST_SOFTWARE_SIMPLE_MD = """# List of supported software |
| 360 | +
|
| 361 | +EasyBuild supports 2 different software packages (incl. toolchains, bundles): |
| 362 | +
|
| 363 | +<a href="#g">g</a> |
| 364 | +
|
| 365 | +
|
| 366 | +<a anchor="g"/> |
| 367 | +### *G* |
| 368 | +
|
| 369 | +* GCC |
| 370 | +* gzip""" |
| 371 | + |
| 372 | +LIST_SOFTWARE_DETAILED_MD = """# List of supported software |
| 373 | +
|
| 374 | +EasyBuild supports 2 different software packages (incl. toolchains, bundles): |
| 375 | +
|
| 376 | +<a href="#g">g</a> |
| 377 | +
|
| 378 | +
|
| 379 | +<a anchor="g"/> |
| 380 | +### *G* |
| 381 | +
|
| 382 | +
|
| 383 | +<a href="#GCC">GCC</a> - <a href="#gzip">gzip</a> |
| 384 | +
|
| 385 | +
|
| 386 | +<a anchor="GCC"/> |
| 387 | +### *GCC* |
| 388 | +
|
| 389 | +%(gcc_descr)s |
| 390 | +
|
| 391 | +*homepage*: http://gcc.gnu.org/ |
| 392 | +
|
| 393 | +========= ========== |
| 394 | +version toolchain |
| 395 | +========= ========== |
| 396 | +``4.6.3`` ``system`` |
| 397 | +========= ========== |
| 398 | +
|
| 399 | +
|
| 400 | +<a anchor="gzip"/> |
| 401 | +### *gzip* |
| 402 | +
|
| 403 | +%(gzip_descr)s |
| 404 | +
|
| 405 | +*homepage*: http://www.gzip.org/ |
| 406 | +
|
| 407 | +======= =============================== |
| 408 | +version toolchain |
| 409 | +======= =============================== |
| 410 | +``1.4`` ``GCC/4.6.3``, ``system`` |
| 411 | +``1.5`` ``foss/2018a``, ``intel/2018a`` |
| 412 | +======= =============================== |
| 413 | +""" % {'gcc_descr': GCC_DESCR, 'gzip_descr': GZIP_DESCR} |
| 414 | + |
266 | 415 |
|
267 | 416 | class DocsTest(EnhancedTestCase):
|
268 | 417 |
|
@@ -376,107 +525,14 @@ def test_list_software(self):
|
376 | 525 | }
|
377 | 526 | init_config(build_options=build_options)
|
378 | 527 |
|
379 |
| - expected = '\n'.join([ |
380 |
| - '', |
381 |
| - '* GCC', |
382 |
| - '* gzip', |
383 |
| - ]) |
384 |
| - self.assertEqual(list_software(output_format='txt'), expected) |
385 |
| - |
386 |
| - expected = re.compile('\n'.join([ |
387 |
| - r'', |
388 |
| - r'\* GCC', |
389 |
| - r'', |
390 |
| - r"The GNU Compiler Collection .*", |
391 |
| - r'', |
392 |
| - r'homepage: http://gcc.gnu.org/', |
393 |
| - r'', |
394 |
| - r' \* GCC v4.6.3: system', |
395 |
| - r'', |
396 |
| - r'\* gzip', |
397 |
| - r'', |
398 |
| - r"gzip \(GNU zip\) is .*", |
399 |
| - r'', |
400 |
| - r'homepage: http://www.gzip.org/', |
401 |
| - r'', |
402 |
| - r" \* gzip v1.4: GCC/4.6.3, system", |
403 |
| - r" \* gzip v1.5: foss/2018a, intel/2018a", |
404 |
| - '', |
405 |
| - ])) |
406 |
| - txt = list_software(output_format='txt', detailed=True) |
407 |
| - self.assertTrue(expected.match(txt), "Pattern '%s' found in: %s" % (expected.pattern, txt)) |
| 528 | + self.assertEqual(list_software(output_format='txt'), LIST_SOFTWARE_SIMPLE_TXT) |
| 529 | + self.assertEqual(list_software(output_format='txt', detailed=True), LIST_SOFTWARE_DETAILED_TXT) |
408 | 530 |
|
409 |
| - expected = '\n'.join([ |
410 |
| - "List of supported software", |
411 |
| - "==========================", |
412 |
| - '', |
413 |
| - "EasyBuild |version| supports 2 different software packages (incl. toolchains, bundles):", |
414 |
| - '', |
415 |
| - ':ref:`list_software_letter_g`', |
416 |
| - '', |
417 |
| - '', |
418 |
| - '.. _list_software_letter_g:', |
419 |
| - '', |
420 |
| - '*G*', |
421 |
| - '---', |
422 |
| - '', |
423 |
| - '* GCC', |
424 |
| - '* gzip', |
425 |
| - ]) |
426 |
| - self.assertEqual(list_software(output_format='rst'), expected) |
427 |
| - |
428 |
| - expected = re.compile('\n'.join([ |
429 |
| - r"List of supported software", |
430 |
| - r"==========================", |
431 |
| - r'', |
432 |
| - r"EasyBuild \|version\| supports 2 different software packages \(incl. toolchains, bundles\):", |
433 |
| - r'', |
434 |
| - r':ref:`list_software_letter_g`', |
435 |
| - r'', |
436 |
| - r'', |
437 |
| - r'.. _list_software_letter_g:', |
438 |
| - r'', |
439 |
| - r'\*G\*', |
440 |
| - r'---', |
441 |
| - r'', |
442 |
| - r'', |
443 |
| - r':ref:`list_software_GCC_205` - :ref:`list_software_gzip_442`', |
444 |
| - r'', |
445 |
| - r'', |
446 |
| - r'\.\. _list_software_GCC_205:', |
447 |
| - r'', |
448 |
| - r'\*GCC\*', |
449 |
| - r'\+\+\+\+\+', |
450 |
| - r'', |
451 |
| - r'The GNU Compiler Collection .*', |
452 |
| - r'', |
453 |
| - r'\*homepage\*: http://gcc.gnu.org/', |
454 |
| - r'', |
455 |
| - r'========= ==========', |
456 |
| - r'version toolchain ', |
457 |
| - r'========= ==========', |
458 |
| - r'``4.6.3`` ``system``', |
459 |
| - r'========= ==========', |
460 |
| - r'', |
461 |
| - r'', |
462 |
| - r'\.\. _list_software_gzip_442:', |
463 |
| - r'', |
464 |
| - r'\*gzip\*', |
465 |
| - r'\+\+\+\+\+\+', |
466 |
| - r'', |
467 |
| - r'gzip \(GNU zip\) is a popular .*', |
468 |
| - r'', |
469 |
| - r'\*homepage\*: http://www.gzip.org/', |
470 |
| - r'', |
471 |
| - r'======= ===============================', |
472 |
| - r'version toolchain ', |
473 |
| - r'======= ===============================', |
474 |
| - r'``1.4`` ``GCC/4.6.3``, ``system`` ', |
475 |
| - r'``1.5`` ``foss/2018a``, ``intel/2018a``', |
476 |
| - r'======= ===============================', |
477 |
| - ])) |
478 |
| - txt = list_software(output_format='rst', detailed=True) |
479 |
| - self.assertTrue(expected.match(txt), "Pattern '%s' found in: %s" % (expected.pattern, txt)) |
| 531 | + self.assertEqual(list_software(output_format='rst'), LIST_SOFTWARE_SIMPLE_RST) |
| 532 | + self.assertEqual(list_software(output_format='rst', detailed=True), LIST_SOFTWARE_DETAILED_RST) |
| 533 | + |
| 534 | + self.assertEqual(list_software(output_format='md'), LIST_SOFTWARE_SIMPLE_MD) |
| 535 | + self.assertEqual(list_software(output_format='md', detailed=True), LIST_SOFTWARE_DETAILED_MD) |
480 | 536 |
|
481 | 537 | # GCC/4.6.3 is installed, no gzip module installed
|
482 | 538 | txt = list_software(output_format='txt', detailed=True, only_installed=True)
|
|
0 commit comments