summaryrefslogtreecommitdiff
path: root/tools/exercise_compare_builds
blob: 38e84058c769b539c688083f3a46ba48b6df0bd3 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# Tests for compare_builds.py
# usage (from root of source tree):
#   build/make/tools/exercise_compare_builds

HIDE_BUILD_OUTPUT=--hide-build-output

function run()
{
    echo
    echo
    echo ============================================================
    echo $1
    shift
    echo ./build/make/tools/compare_builds.py $HIDE_BUILD_OUTPUT --target incidentd $@
    echo ============================================================
    time ./build/make/tools/compare_builds.py $HIDE_BUILD_OUTPUT --target incidentd $@
}

function run_tests()
{
    # These should error out

    run "Incremental build,  Separate work dirs  (invalid flag combo, should error out)" \
        --incremental --detect-embedded-paths
    run "Use out/ as work dir, Separate work dirs  (invalid flag combo, should error out)" \
        --no-check-out-dir --detect-embedded-paths

    # Each grouping starts with a build, and the following ones use --no-build to save time

    run "REBUILD: Full builds,  Same work dir,  Whole out dir"
    run "Full builds,  Same work dir,  Default subdirs" \
        --no-build --subdirs
    run "Full builds,  Same work dir,  Only $PRODUCT_OUT/system" \
        --no-build --subdirs system

    run "REBUILD: Full builds,  Use out/ as work dir,  Whole out dir" \
        --no-check-out-dir
    run "Full builds,  Use out/ as work dir,  Default subdirs" \
        --no-build --no-check-out-dir --subdirs
    run "Full builds,  Use out/ as work dir,  Only $PRODUCT_OUT/system" \
        --no-build --no-check-out-dir --subdirs system

    run "REBUILD: Full builds,  Separate work dirs,  Whole out dir" \
        --detect-embedded-paths
    run "Full builds,  Separate work dirs,  Default subdirs" \
        --no-build --detect-embedded-paths --subdirs
    run "Full builds,  Separate work dirs,  Only $PRODUCT_OUT/system" \
        --no-build --detect-embedded-paths --subdirs system

    run "REBUILD: Incremental build,  Same work dir,  Whole out dir" \
        --incremental
    run "Incremental build,  Same work dir,  Default subdirs" \
        --no-build --incremental --subdirs
    run "Incremental build,  Same work dir,  Only $PRODUCT_OUT/system" \
        --no-build --incremental --subdirs system

    run "REBUILD: Incremental build,  Use out/ as work dir,  Whole out dir" \
        --incremental --no-check-out-dir
    run "Incremental build,  Use out/ as work dir,  Default subdirs" \
        --no-build --incremental --no-check-out-dir --subdirs
    run "Incremental build,  Use out/ as work dir,  Only $PRODUCT_OUT/system" \
        --no-build --incremental --no-check-out-dir --subdirs system
}

time run_tests 2>&1 | tee exercise_compare_builds.txt