summaryrefslogtreecommitdiffstats
path: root/test/scripts/compress_failed.sh
blob: ff17d24462923202a67eadb12ed67a1c28985ad1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash

if [ "$(ls -A ${FAILED_DIR})" ]
then
    if [ "${COMPRESS_FAILED_TEST_LOGS}" == "yes" ]
    then
	echo -n "Compressing files in temporary directories from failed test runs... "
	cd ${FAILED_DIR}
	for d in *
	do
	    cd ${d}
	    find . ! -path . -print0 | xargs -0 -n1 gzip
	    cd ${FAILED_DIR}
	done
	echo "done."
        if [ -n "$WORKSPACE" ]
        then
            echo "Copying failed test logs into build log archive directory ($WORKSPACE/archives)... "
            for failed_test in $(ls $FAILED_DIR)
            do
                mkdir -p $WORKSPACE/archives/$failed_test
                cp -a $FAILED_DIR/$failed_test/* $WORKSPACE/archives/$failed_test
            done
	    echo "done."
        fi

    else
	echo "Not compressing files in temporary directories from failed test runs."
    fi
else
    echo "No symlinks to failed tests' temporary directories found in ${FAILED_DIR}."
fi

# This script gets run only if there was a 'make test' failure,
# so return failure error status so that the build results are
# recorded correctly.
exit 1
36' href='#n436'>436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549