Reviewers: ulan, Jakob,

Message:
It seems that "if [ $? -ne 0 ]" does not work in ash. The "if" expects a list
which is is a sequence of zero or more commands separated by newlines,
semicolons, or ampersands, and optionally terminated by one of these three
characters. In my emulator (Android 4.0.3 API level 15), the android-run.py
reports an error "[: not found".

There are two ways to fix this, one is to add a function and still use "if"
like:

"
checkStatus () {
  return $(($? == 0))
}
if checkStatus
"

The other is to use case statement in this review.

Maybe older version ash supports "if [ $ $? -ne 0 ]", if so, it is better to
have that support in 4.0.3.

After this change, make android.release.check works. It finished after 90
minutes in my machine, and 87 fails. Most of them are time out errors. I will
try to get X86 working to shorten the running time.

Description:
Make android.check work

Please review this at https://chromiumcodereview.appspot.com/10779011/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     AUTHORS
  M     tools/android-run.py


Index: AUTHORS
===================================================================
--- AUTHORS     (revision 12084)
+++ AUTHORS     (working copy)
@@ -51,5 +51,6 @@
 Tobias Burnus <[email protected]>
 Vlad Burlik <[email protected]>
 Yuqiang Xian <[email protected]>
+Haitao Feng <[email protected]>
 Zaheer Ahmad <[email protected]>
 Zhongping Wang <[email protected]>
Index: tools/android-run.py
===================================================================
--- tools/android-run.py        (revision 12084)
+++ tools/android-run.py        (working copy)
@@ -91,9 +91,10 @@
   android_workspace = os.getenv("ANDROID_V8", "/data/local/v8")
   args = [Escape(arg) for arg in sys.argv[1:]]
   script = (" ".join(args) + "\n"
-            "if [ $? -ne 0 ]\n"
-            "  then echo \"Error returned by test\";\n"
-            "fi\n")
+            "case $? in\n"
+            "  0) break;;\n"
+            "  *) echo \"Error returned by test\";;\n"
+            "esac\n")
   script = script.replace(workspace, android_workspace)
   script_file = WriteToTemporaryFile(script)
   android_script_file = android_workspace + "/" + script_file


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to