diff options
| author | Jeff Gaston <jeffrygaston@google.com> | 2017-10-30 14:53:03 -0700 |
|---|---|---|
| committer | Jeff Gaston <jeffrygaston@google.com> | 2017-10-30 15:00:19 -0700 |
| commit | 4fc22f66c2fb8db2a8b727b0f24c53b24bc919c0 (patch) | |
| tree | 928cc630c208b5223b9061b82c86ea525b413c2a /tests | |
| parent | 3802ba9f18c3586efa8e141f5a895b1ea9d4ae20 (diff) | |
| download | platform_build_blueprint-4fc22f66c2fb8db2a8b727b0f24c53b24bc919c0.tar.gz platform_build_blueprint-4fc22f66c2fb8db2a8b727b0f24c53b24bc919c0.tar.bz2 platform_build_blueprint-4fc22f66c2fb8db2a8b727b0f24c53b24bc919c0.zip | |
Make test_tree_tests.sh slightly easier to read
Bug: 64363847
Test: ./tests/test_tree_tests.sh
Change-Id: I40c1bcebf176bf4d70d4bc6339f419881013e0a6
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/test_tree_tests.sh | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/test_tree_tests.sh b/tests/test_tree_tests.sh index 967cf3d..03d918f 100755 --- a/tests/test_tree_tests.sh +++ b/tests/test_tree_tests.sh @@ -12,6 +12,7 @@ export TEMPDIR=$(mktemp -d -t blueprint.test.XXX) function cleanup() { cd "${TOP}" + echo "cleaning up ${TEMPDIR}" rm -rf "${TEMPDIR}" } trap cleanup EXIT @@ -25,7 +26,10 @@ cp -r "${TOP}" "${SRCDIR}/blueprint" cd "${OUTDIR}" export BLUEPRINTDIR=${SRCDIR}/blueprint +#setup ${SRCDIR}/blueprint/bootstrap.bash $@ + +#confirm no build.ninja file is rebuilt when no change happens ./blueprint.bash OLDTIME_BOOTSTRAP=$(mtime .bootstrap/build.ninja) @@ -44,20 +48,22 @@ if [ ${OLDTIME_BOOTSTRAP} != $(mtime .bootstrap/build.ninja) ]; then exit 1 fi +#confirm no build.ninja file is rebuilt when a new directory is created mkdir ${SRCDIR}/newglob sleep 2 ./blueprint.bash if [ ${OLDTIME} != $(mtime build.ninja) ]; then - echo "unnecessary build.ninja regeneration for glob addition" >&2 + echo "unnecessary build.ninja regeneration for new empty directory" >&2 exit 1 fi if [ ${OLDTIME_BOOTSTRAP} != $(mtime .bootstrap/build.ninja) ]; then - echo "unnecessary .bootstrap/build.ninja regeneration for glob addition" >&2 + echo "unnecessary .bootstrap/build.ninja regeneration for new empty directory" >&2 exit 1 fi +#confirm that build.ninja is rebuilt when a new Blueprints file is added touch ${SRCDIR}/newglob/Blueprints sleep 2 @@ -72,6 +78,7 @@ if [ ${OLDTIME_BOOTSTRAP} = $(mtime .bootstrap/build.ninja) ]; then exit 1 fi +#confirm that build.ninja is rebuilt when a glob match is removed OLDTIME=$(mtime build.ninja) OLDTIME_BOOTSTRAP=$(mtime .bootstrap/build.ninja) rm ${SRCDIR}/newglob/Blueprints @@ -88,6 +95,7 @@ if [ ${OLDTIME_BOOTSTRAP} = $(mtime .bootstrap/build.ninja) ]; then exit 1 fi +#confirm that build.ninja is not rebuilt when a glob match is removed OLDTIME=$(mtime build.ninja) OLDTIME_BOOTSTRAP=$(mtime .bootstrap/build.ninja) rmdir ${SRCDIR}/newglob @@ -96,10 +104,13 @@ sleep 2 ./blueprint.bash if [ ${OLDTIME} != $(mtime build.ninja) ]; then - echo "unnecessary build.ninja regeneration for glob removal" >&2 + echo "unnecessary build.ninja regeneration for removal of empty directory" >&2 exit 1 fi + if [ ${OLDTIME_BOOTSTRAP} != $(mtime .bootstrap/build.ninja) ]; then - echo "unnecessary .bootstrap/build.ninja regeneration for glob removal" >&2 + echo "unnecessary .bootstrap/build.ninja regeneration for removal of empty directory" >&2 exit 1 fi + +echo tests passed |
