diff options
author | Doug Zongker <dougz@android.com> | 2009-07-15 01:31:56 +0200 |
---|---|---|
committer | Doug Zongker <dougz@android.com> | 2009-07-15 01:58:42 +0200 |
commit | 64893ccc09b25ac31bc6a17f5c7f43c7fa789576 (patch) | |
tree | a56912e18b608b123f1c4454293d2b2aa36fa96a /amend/tests | |
parent | skip over all-zero blocks when reading MTD partition (diff) | |
download | android_bootable_recovery-64893ccc09b25ac31bc6a17f5c7f43c7fa789576.tar android_bootable_recovery-64893ccc09b25ac31bc6a17f5c7f43c7fa789576.tar.gz android_bootable_recovery-64893ccc09b25ac31bc6a17f5c7f43c7fa789576.tar.bz2 android_bootable_recovery-64893ccc09b25ac31bc6a17f5c7f43c7fa789576.tar.lz android_bootable_recovery-64893ccc09b25ac31bc6a17f5c7f43c7fa789576.tar.xz android_bootable_recovery-64893ccc09b25ac31bc6a17f5c7f43c7fa789576.tar.zst android_bootable_recovery-64893ccc09b25ac31bc6a17f5c7f43c7fa789576.zip |
Diffstat (limited to '')
44 files changed, 0 insertions, 544 deletions
diff --git a/amend/tests/001-nop/expected.txt b/amend/tests/001-nop/expected.txt deleted file mode 100644 index d4a85ceab..000000000 --- a/amend/tests/001-nop/expected.txt +++ /dev/null @@ -1 +0,0 @@ -I am a jelly donut. diff --git a/amend/tests/001-nop/info.txt b/amend/tests/001-nop/info.txt deleted file mode 100644 index 9942f10da..000000000 --- a/amend/tests/001-nop/info.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a sample no-op test, which does at least serve to verify that the -test harness is working. diff --git a/amend/tests/001-nop/run b/amend/tests/001-nop/run deleted file mode 100644 index 51637c147..000000000 --- a/amend/tests/001-nop/run +++ /dev/null @@ -1,17 +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. - -echo 'I am a jelly donut.' diff --git a/amend/tests/002-lex-empty/SKIP b/amend/tests/002-lex-empty/SKIP deleted file mode 100644 index e69de29bb..000000000 --- a/amend/tests/002-lex-empty/SKIP +++ /dev/null diff --git a/amend/tests/002-lex-empty/expected.txt b/amend/tests/002-lex-empty/expected.txt deleted file mode 100644 index 822a54c23..000000000 --- a/amend/tests/002-lex-empty/expected.txt +++ /dev/null @@ -1 +0,0 @@ - EOF diff --git a/amend/tests/002-lex-empty/info.txt b/amend/tests/002-lex-empty/info.txt deleted file mode 100644 index 090083fc6..000000000 --- a/amend/tests/002-lex-empty/info.txt +++ /dev/null @@ -1 +0,0 @@ -Test to make sure that an empty file is accepted properly. diff --git a/amend/tests/002-lex-empty/input b/amend/tests/002-lex-empty/input deleted file mode 100644 index e69de29bb..000000000 --- a/amend/tests/002-lex-empty/input +++ /dev/null diff --git a/amend/tests/002-lex-empty/run b/amend/tests/002-lex-empty/run deleted file mode 100644 index 35c4a4fa3..000000000 --- a/amend/tests/002-lex-empty/run +++ /dev/null @@ -1,17 +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. - -amend --debug-lex input diff --git a/amend/tests/003-lex-command/expected.txt b/amend/tests/003-lex-command/expected.txt deleted file mode 100644 index e40db0c7c..000000000 --- a/amend/tests/003-lex-command/expected.txt +++ /dev/null @@ -1,13 +0,0 @@ - IDENTIFIER<this_identifier_is_not_assert> EOL - IDENTIFIER<NEITHER_IS_THIS_123> EOL - IDENTIFIER<but_the_next_one_is> EOL - IDENTIFIER<assert> EOL - IDENTIFIER<next_one_is_not_an_identifier> EOL -line 6: unexpected character at '1' - EOF -line 1: unexpected character at '"' - EOF -line 1: unexpected character at '=' - EOF -line 1: unexpected character at '9' - EOF diff --git a/amend/tests/003-lex-command/info.txt b/amend/tests/003-lex-command/info.txt deleted file mode 100644 index 929664855..000000000 --- a/amend/tests/003-lex-command/info.txt +++ /dev/null @@ -1 +0,0 @@ -Test to make sure that simple command names are tokenized properly. diff --git a/amend/tests/003-lex-command/input b/amend/tests/003-lex-command/input deleted file mode 100644 index b9ef231b0..000000000 --- a/amend/tests/003-lex-command/input +++ /dev/null @@ -1,6 +0,0 @@ -this_identifier_is_not_assert -NEITHER_IS_THIS_123 -but_the_next_one_is -assert -next_one_is_not_an_identifier -12not_an_identifier diff --git a/amend/tests/003-lex-command/input2 b/amend/tests/003-lex-command/input2 deleted file mode 100644 index eb5daf761..000000000 --- a/amend/tests/003-lex-command/input2 +++ /dev/null @@ -1 +0,0 @@ -"quoted" diff --git a/amend/tests/003-lex-command/input3 b/amend/tests/003-lex-command/input3 deleted file mode 100644 index f1c873878..000000000 --- a/amend/tests/003-lex-command/input3 +++ /dev/null @@ -1 +0,0 @@ -== diff --git a/amend/tests/003-lex-command/input4 b/amend/tests/003-lex-command/input4 deleted file mode 100644 index 3ad5abd03..000000000 --- a/amend/tests/003-lex-command/input4 +++ /dev/null @@ -1 +0,0 @@ -99 diff --git a/amend/tests/003-lex-command/run b/amend/tests/003-lex-command/run deleted file mode 100644 index 2e21fab03..000000000 --- a/amend/tests/003-lex-command/run +++ /dev/null @@ -1,20 +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. - -amend --debug-lex input -amend --debug-lex input2 -amend --debug-lex input3 -amend --debug-lex input4 diff --git a/amend/tests/004-lex-comment/expected.txt b/amend/tests/004-lex-comment/expected.txt deleted file mode 100644 index a728a5e70..000000000 --- a/amend/tests/004-lex-comment/expected.txt +++ /dev/null @@ -1,5 +0,0 @@ - IDENTIFIER<comment_on_this_line> EOL - IDENTIFIER<none_on_this_one> EOL - EOL - EOL - EOF diff --git a/amend/tests/004-lex-comment/info.txt b/amend/tests/004-lex-comment/info.txt deleted file mode 100644 index 06912483b..000000000 --- a/amend/tests/004-lex-comment/info.txt +++ /dev/null @@ -1 +0,0 @@ -Test to make sure that comments are stripped out. diff --git a/amend/tests/004-lex-comment/input b/amend/tests/004-lex-comment/input deleted file mode 100644 index 6736c954c..000000000 --- a/amend/tests/004-lex-comment/input +++ /dev/null @@ -1,4 +0,0 @@ -comment_on_this_line # this is a "comment" (with / a bunch) # \\ of stuff \ -none_on_this_one -# beginning of line - # preceded by whitespace diff --git a/amend/tests/004-lex-comment/run b/amend/tests/004-lex-comment/run deleted file mode 100644 index 35c4a4fa3..000000000 --- a/amend/tests/004-lex-comment/run +++ /dev/null @@ -1,17 +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. - -amend --debug-lex input diff --git a/amend/tests/005-lex-quoted-string/expected.txt b/amend/tests/005-lex-quoted-string/expected.txt deleted file mode 100644 index 9bb5ac485..000000000 --- a/amend/tests/005-lex-quoted-string/expected.txt +++ /dev/null @@ -1,13 +0,0 @@ - IDENTIFIER<test> WORD<string> EOL - IDENTIFIER<test> WORD<string with spaces> EOL - IDENTIFIER<test> WORD<string with "escaped" quotes> EOL - IDENTIFIER<test> WORD<string with \escaped\ backslashes> EOL - IDENTIFIER<test> WORD<string with # a comment character> EOL - EOF - EOL - IDENTIFIER<test1>line 2: unterminated string at ' -' - ??? <0> - EOL - IDENTIFIER<test1>line 2: illegal escape at '\n' - ??? <0> diff --git a/amend/tests/005-lex-quoted-string/info.txt b/amend/tests/005-lex-quoted-string/info.txt deleted file mode 100644 index be458bd36..000000000 --- a/amend/tests/005-lex-quoted-string/info.txt +++ /dev/null @@ -1 +0,0 @@ -Test to make sure that quoted strings are tokenized properly. diff --git a/amend/tests/005-lex-quoted-string/input b/amend/tests/005-lex-quoted-string/input deleted file mode 100644 index 2b34bbcfa..000000000 --- a/amend/tests/005-lex-quoted-string/input +++ /dev/null @@ -1,5 +0,0 @@ -test "string" -test "string with spaces" -test "string with \"escaped\" quotes" -test "string with \\escaped\\ backslashes" -test "string with # a comment character" diff --git a/amend/tests/005-lex-quoted-string/input2 b/amend/tests/005-lex-quoted-string/input2 deleted file mode 100644 index 09e668957..000000000 --- a/amend/tests/005-lex-quoted-string/input2 +++ /dev/null @@ -1,2 +0,0 @@ -# This should fail -test1 "unterminated string diff --git a/amend/tests/005-lex-quoted-string/input3 b/amend/tests/005-lex-quoted-string/input3 deleted file mode 100644 index 02f3f8530..000000000 --- a/amend/tests/005-lex-quoted-string/input3 +++ /dev/null @@ -1,2 +0,0 @@ -# This should fail -test1 "string with illegal escape \n in the middle" diff --git a/amend/tests/005-lex-quoted-string/run b/amend/tests/005-lex-quoted-string/run deleted file mode 100644 index 7b1292a75..000000000 --- a/amend/tests/005-lex-quoted-string/run +++ /dev/null @@ -1,19 +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. - -amend --debug-lex input -amend --debug-lex input2 -amend --debug-lex input3 diff --git a/amend/tests/006-lex-words/SKIP b/amend/tests/006-lex-words/SKIP deleted file mode 100644 index e69de29bb..000000000 --- a/amend/tests/006-lex-words/SKIP +++ /dev/null diff --git a/amend/tests/006-lex-words/expected.txt b/amend/tests/006-lex-words/expected.txt deleted file mode 100644 index a78a0b177..000000000 --- a/amend/tests/006-lex-words/expected.txt +++ /dev/null @@ -1,6 +0,0 @@ - IDENTIFIER<test> WORD<this> WORD<has> WORD<a> WORD<bunch> WORD<of> WORD<BARE> WORD<ALPHA> WORD<WORDS> EOL - IDENTIFIER<test> WORD<12> WORD<this> WORD<has(some> WORD<)> WORD<ALPHANUMER1C> WORD<and> WORD<\\> WORD<whatever> WORD<characters> EOL - IDENTIFIER<test> WORD<this> WORD<has> WORD<mixed> WORD<bare> WORD<and quoted> WORD<words> EOL - IDENTIFIER<test> WORD<what> WORD<about> WORD<quotesin the middle?> EOL - IDENTIFIER<test> WORD<"""shouldn't> WORD<be> WORD<a> WORD<quoted> WORD<string> EOL - EOF diff --git a/amend/tests/006-lex-words/info.txt b/amend/tests/006-lex-words/info.txt deleted file mode 100644 index dd3701607..000000000 --- a/amend/tests/006-lex-words/info.txt +++ /dev/null @@ -1 +0,0 @@ -Test to make sure that argument words are tokenized properly. diff --git a/amend/tests/006-lex-words/input b/amend/tests/006-lex-words/input deleted file mode 100644 index a4de63821..000000000 --- a/amend/tests/006-lex-words/input +++ /dev/null @@ -1,5 +0,0 @@ -test this has a bunch of BARE ALPHA WORDS -test 12 this has(some ) ALPHANUMER1C and \\ whatever characters -test this has mixed bare "and quoted" words -test what about quotes"in the middle?" -test \"\"\"shouldn't be a quoted string diff --git a/amend/tests/006-lex-words/input2 b/amend/tests/006-lex-words/input2 deleted file mode 100644 index 09e668957..000000000 --- a/amend/tests/006-lex-words/input2 +++ /dev/null @@ -1,2 +0,0 @@ -# This should fail -test1 "unterminated string diff --git a/amend/tests/006-lex-words/input3 b/amend/tests/006-lex-words/input3 deleted file mode 100644 index 02f3f8530..000000000 --- a/amend/tests/006-lex-words/input3 +++ /dev/null @@ -1,2 +0,0 @@ -# This should fail -test1 "string with illegal escape \n in the middle" diff --git a/amend/tests/006-lex-words/run b/amend/tests/006-lex-words/run deleted file mode 100644 index 35c4a4fa3..000000000 --- a/amend/tests/006-lex-words/run +++ /dev/null @@ -1,17 +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. - -amend --debug-lex input diff --git a/amend/tests/007-lex-real-script/expected.txt b/amend/tests/007-lex-real-script/expected.txt deleted file mode 100644 index 012f62c8d..000000000 --- a/amend/tests/007-lex-real-script/expected.txt +++ /dev/null @@ -1,11 +0,0 @@ - IDENTIFIER<assert> IDENTIFIER<hash_dir> ( STRING<SYS:> ) == STRING<112345oldhashvalue1234123> EOL - IDENTIFIER<mark> WORD<SYS:> WORD<dirty> EOL - IDENTIFIER<copy_dir> WORD<PKG:android-files> WORD<SYS:> EOL - IDENTIFIER<assert> IDENTIFIER<hash_dir> ( STRING<SYS:> ) == STRING<667890newhashvalue6678909> EOL - IDENTIFIER<mark> WORD<SYS:> WORD<clean> EOL - IDENTIFIER<done> EOL - IDENTIFIER<assert> IDENTIFIER<hash_dir> ( STRING<SYS:> , STRING<blah> ) == STRING<112345oldhashvalue1234123> EOL - IDENTIFIER<assert> STRING<true> == STRING<false> EOL - IDENTIFIER<assert> IDENTIFIER<one> ( STRING<abc> , IDENTIFIER<two> ( STRING<def> ) ) == STRING<five> EOL - IDENTIFIER<assert> IDENTIFIER<hash_dir> ( STRING<SYS:> ) == STRING<667890newhashvalue6678909> || IDENTIFIER<hash_dir> ( STRING<SYS:> ) == STRING<667890newhashvalue6678909> EOL - EOF diff --git a/amend/tests/007-lex-real-script/info.txt b/amend/tests/007-lex-real-script/info.txt deleted file mode 100644 index 5e321f552..000000000 --- a/amend/tests/007-lex-real-script/info.txt +++ /dev/null @@ -1 +0,0 @@ -An input script similar to one that will actually be used in practice. diff --git a/amend/tests/007-lex-real-script/input b/amend/tests/007-lex-real-script/input deleted file mode 100644 index f3f1fd986..000000000 --- a/amend/tests/007-lex-real-script/input +++ /dev/null @@ -1,10 +0,0 @@ -assert hash_dir("SYS:") == "112345oldhashvalue1234123" -mark SYS: dirty -copy_dir "PKG:android-files" SYS: -assert hash_dir("SYS:") == "667890newhashvalue6678909" -mark SYS: clean -done -assert hash_dir("SYS:", "blah") == "112345oldhashvalue1234123" -assert "true" == "false" -assert one("abc", two("def")) == "five" -assert hash_dir("SYS:") == "667890newhashvalue6678909" || hash_dir("SYS:") == "667890newhashvalue6678909" diff --git a/amend/tests/007-lex-real-script/run b/amend/tests/007-lex-real-script/run deleted file mode 100644 index 35c4a4fa3..000000000 --- a/amend/tests/007-lex-real-script/run +++ /dev/null @@ -1,17 +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. - -amend --debug-lex input diff --git a/amend/tests/008-parse-real-script/expected.txt b/amend/tests/008-parse-real-script/expected.txt deleted file mode 100644 index dabf6d4e2..000000000 --- a/amend/tests/008-parse-real-script/expected.txt +++ /dev/null @@ -1,74 +0,0 @@ -command "assert" { - STRING EQ { - FUNCTION hash_dir ( - "SYS:" - ) - "112345oldhashvalue1234123" - } -} -command "mark" { - "SYS:" - "dirty" -} -command "copy_dir" { - "PKG:android-files" - "SYS:" -} -command "assert" { - STRING EQ { - FUNCTION hash_dir ( - "SYS:" - ) - "667890newhashvalue6678909" - } -} -command "mark" { - "SYS:" - "clean" -} -command "done" { -} -command "assert" { - STRING EQ { - FUNCTION hash_dir ( - "SYS:" - "blah" - ) - "112345oldhashvalue1234123" - } -} -command "assert" { - STRING EQ { - "true" - "false" - } -} -command "assert" { - STRING NE { - FUNCTION matches ( - FUNCTION hash_dir ( - "SYS:" - ) - "667890newhashvalue6678909" - "999999newhashvalue6678909" - ) - "" - } -} -command "assert" { - BOOLEAN OR { - STRING EQ { - FUNCTION hash_dir ( - "SYS:" - ) - "667890newhashvalue6678909" - } - STRING EQ { - FUNCTION hash_dir ( - "SYS:" - ) - "999999newhashvalue6678909" - } - } -} -amend: Parse successful. diff --git a/amend/tests/008-parse-real-script/info.txt b/amend/tests/008-parse-real-script/info.txt deleted file mode 100644 index 5e321f552..000000000 --- a/amend/tests/008-parse-real-script/info.txt +++ /dev/null @@ -1 +0,0 @@ -An input script similar to one that will actually be used in practice. diff --git a/amend/tests/008-parse-real-script/input b/amend/tests/008-parse-real-script/input deleted file mode 100644 index b07330695..000000000 --- a/amend/tests/008-parse-real-script/input +++ /dev/null @@ -1,10 +0,0 @@ -assert hash_dir("SYS:") == "112345oldhashvalue1234123" -mark SYS: dirty -copy_dir "PKG:android-files" SYS: -assert hash_dir("SYS:") == "667890newhashvalue6678909" -mark SYS: clean -done -assert hash_dir("SYS:", "blah") == "112345oldhashvalue1234123" -assert "true" == "false" -assert matches(hash_dir("SYS:"), "667890newhashvalue6678909", "999999newhashvalue6678909") != "" -assert hash_dir("SYS:") == "667890newhashvalue6678909" || hash_dir("SYS:") == "999999newhashvalue6678909" diff --git a/amend/tests/008-parse-real-script/run b/amend/tests/008-parse-real-script/run deleted file mode 100644 index 9544e1b9b..000000000 --- a/amend/tests/008-parse-real-script/run +++ /dev/null @@ -1,17 +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. - -amend --debug-ast input diff --git a/amend/tests/XXX-long-token/SKIP b/amend/tests/XXX-long-token/SKIP deleted file mode 100644 index e69de29bb..000000000 --- a/amend/tests/XXX-long-token/SKIP +++ /dev/null diff --git a/amend/tests/XXX-stack-overflow/SKIP b/amend/tests/XXX-stack-overflow/SKIP deleted file mode 100644 index e69de29bb..000000000 --- a/amend/tests/XXX-stack-overflow/SKIP +++ /dev/null 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 diff --git a/amend/tests/run-all-tests b/amend/tests/run-all-tests deleted file mode 100755 index c696bbd6c..000000000 --- a/amend/tests/run-all-tests +++ /dev/null @@ -1,69 +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}"` - -passed=0 -skipped=0 -skipNames="" -failed=0 -failNames="" - -for i in *; do - if [ -d "$i" -a -r "$i" ]; then - ./one-test "$i" - status=$? - if [ "$status" = "0" ]; then - ((passed += 1)) - elif [ "$status" = "2" ]; then - ((skipped += 1)) - skipNames="$skipNames $i" - else - ((failed += 1)) - failNames="$failNames $i" - fi - fi -done - -echo "passed: $passed test(s)" -echo "skipped: $skipped test(s)" - -for i in $skipNames; do - echo "skipped: $i" -done - -echo "failed: $failed test(s)" - -for i in $failNames; do - echo "failed: $i" -done |