summaryrefslogtreecommitdiffstats
path: root/amend/tests/one-test
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-04 03:28:14 +0100
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-04 03:28:14 +0100
commitffb48f64fec674c6dd923eb8b1eb3f743e05a8ba (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /amend/tests/one-test
parentauto import from //depot/cupcake/@132589 (diff)
downloadandroid_bootable_recovery-ffb48f64fec674c6dd923eb8b1eb3f743e05a8ba.tar
android_bootable_recovery-ffb48f64fec674c6dd923eb8b1eb3f743e05a8ba.tar.gz
android_bootable_recovery-ffb48f64fec674c6dd923eb8b1eb3f743e05a8ba.tar.bz2
android_bootable_recovery-ffb48f64fec674c6dd923eb8b1eb3f743e05a8ba.tar.lz
android_bootable_recovery-ffb48f64fec674c6dd923eb8b1eb3f743e05a8ba.tar.xz
android_bootable_recovery-ffb48f64fec674c6dd923eb8b1eb3f743e05a8ba.tar.zst
android_bootable_recovery-ffb48f64fec674c6dd923eb8b1eb3f743e05a8ba.zip
Diffstat (limited to 'amend/tests/one-test')
-rwxr-xr-xamend/tests/one-test150
1 files changed, 0 insertions, 150 deletions
diff --git a/amend/tests/one-test b/amend/tests/one-test
deleted file mode 100755
index 9cebd3f47..000000000
--- a/amend/tests/one-test
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2007 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-while [ -h "${prog}" ]; do
- newProg=`/bin/ls -ld "${prog}"`
- newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
- if expr "x${newProg}" : 'x/' >/dev/null; then
- prog="${newProg}"
- else
- progdir=`dirname "${prog}"`
- prog="${progdir}/${newProg}"
- fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/`basename "${prog}"`
-
-info="info.txt"
-run="run"
-expected="expected.txt"
-output="out.txt"
-skip="SKIP"
-
-dev_mode="no"
-if [ "x$1" = "x--dev" ]; then
- dev_mode="yes"
- shift
-fi
-
-update_mode="no"
-if [ "x$1" = "x--update" ]; then
- update_mode="yes"
- shift
-fi
-
-usage="no"
-if [ "x$1" = "x--help" ]; then
- usage="yes"
-else
- if [ "x$1" = "x" ]; then
- testdir=`basename "$oldwd"`
- else
- testdir="$1"
- fi
-
- if [ '!' -d "$testdir" ]; then
- td2=`echo ${testdir}-*`
- if [ '!' -d "$td2" ]; then
- echo "${testdir}: no such test directory" 1>&2
- usage="yes"
- fi
- testdir="$td2"
- fi
-fi
-
-if [ "$usage" = "yes" ]; then
- prog=`basename $prog`
- (
- echo "usage:"
- echo " $prog --help Print this message."
- echo " $prog testname Run test normally."
- echo " $prog --dev testname Development mode (dump to stdout)."
- echo " $prog --update testname Update mode (replace expected.txt)."
- echo " Omitting the test name uses the current directory as the test."
- ) 1>&2
- exit 1
-fi
-
-td_info="$testdir"/"$info"
-td_run="$testdir"/"$run"
-td_expected="$testdir"/"$expected"
-td_skip="$testdir"/"$skip"
-
-if [ -r "$td_skip" ]; then
- exit 2
-fi
-
-tmpdir=/tmp/test-$$
-
-if [ '!' '(' -r "$td_info" -a -r "$td_run" -a -r "$td_expected" ')' ]; then
- echo "${testdir}: missing files" 1>&2
- exit 1
-fi
-
-# copy the test to a temp dir and run it
-
-echo "${testdir}: running..." 1>&2
-
-rm -rf "$tmpdir"
-cp -Rp "$testdir" "$tmpdir"
-cd "$tmpdir"
-chmod 755 "$run"
-
-#PATH="${progdir}/../build/bin:${PATH}"
-
-good="no"
-if [ "$dev_mode" = "yes" ]; then
- "./$run" 2>&1
- echo "exit status: $?" 1>&2
- good="yes"
-elif [ "$update_mode" = "yes" ]; then
- "./$run" >"${progdir}/$td_expected" 2>&1
- good="yes"
-else
- "./$run" >"$output" 2>&1
- cmp -s "$expected" "$output"
- if [ "$?" = "0" ]; then
- # output == expected
- good="yes"
- echo "$testdir"': succeeded!' 1>&2
- fi
-fi
-
-if [ "$good" = "yes" ]; then
- cd "$oldwd"
- rm -rf "$tmpdir"
- exit 0
-fi
-
-(
- echo "${testdir}: FAILED!"
- echo ' '
- echo '#################### info'
- cat "$info" | sed 's/^/# /g'
- echo '#################### diffs'
- diff -u "$expected" "$output"
- echo '####################'
- echo ' '
- echo "files left in $tmpdir"
-) 1>&2
-
-exit 1