OSDN Git Service

Add CTS accounts tests to CTS makefile.
[android-x86/build.git] / envsetup.sh
index 4ef6d77..4eede33 100644 (file)
@@ -537,7 +537,10 @@ function gettop
         echo $TOP
     else
         if [ -f $TOPFILE ] ; then
-            echo $PWD
+            # The following circumlocution (repeated below as well) ensures
+            # that we record the true directory name and not one that is
+            # faked up with symlink names.
+            PWD= /bin/pwd
         else
             # We redirect cd to /dev/null in case it's aliased to
             # a command that prints something as a side-effect
@@ -546,7 +549,7 @@ function gettop
             T=
             while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
                 cd .. > /dev/null
-                T=$PWD
+                T=`PWD= /bin/pwd`
             done
             cd $HERE > /dev/null
             if [ -f "$T/$TOPFILE" ]; then
@@ -656,6 +659,26 @@ function croot()
     fi
 }
 
+function cproj()
+{
+    TOPFILE=build/core/envsetup.mk
+    # We redirect cd to /dev/null in case it's aliased to
+    # a command that prints something as a side-effect
+    # (like pushd)
+    local HERE=$PWD
+    T=
+    while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
+        T=$PWD
+        if [ -f "$T/Android.mk" ]; then
+            cd $T
+            return
+        fi
+        cd .. > /dev/null
+    done
+    cd $HERE > /dev/null
+    echo "can't find Android.mk"
+}
+
 function pid()
 {
    local EXE="$1"
@@ -667,6 +690,13 @@ function pid()
    fi
 }
 
+# systemstack - dump the current stack trace of all threads in the system process
+# to the usual ANR traces file
+function systemstack()
+{
+    adb shell echo '""' '>>' /data/anr/traces.txt && adb shell chmod 776 /data/anr/traces.txt && adb shell kill -3 $(pid system_server)
+}
+
 function gdbclient()
 {
    local OUT_ROOT=$(get_abs_build_var PRODUCT_OUT)
@@ -947,14 +977,7 @@ function runtest()
         echo "Couldn't locate the top of the tree.  Try setting TOP." >&2
         return
     fi
-    (cd "$T" && development/testrunner/runtest.py $@)
-}
-
-# TODO: Remove this some time after 1 June 2009
-function runtest_py()
-{
-    echo "runtest_py is obsolete; use runtest instead" >&2
-    return 1
+    ("$T"/development/testrunner/runtest.py $@)
 }
 
 function godir () {