8. Compile and Installation
● Configuration
# Makefile / Place in the root of code base
KDIR:=$(PWD)/../kernel/android-3.0
CROSS_COMPILE:=arm-none-linux-gnueabi-
HOST:=x86_64
● Compile
# Compile for g-sensor
$ make TESTSUITES=accelerometer
# For all devices
$ make
# A "build" folder will be created
9. Compile and Installation
● Install to device
# In OMAP DDT folder
$ adb push build /system/testsuites
# /system/testsuites is recommended
10. Compile and Installation
● Install to device
# In OMAP DDT folder
$ adb push build /system/testsuites
# /system/testsuites is recommended
gh to
ou !!
En ST
Not TE
R un
12. Pre-requirement
● Configuration for Busybox
Busybox Settings --> Build Options --> Build Busybox as a static binary (no shared libs)
- Enable this option by pressing "Y"
Busybox Settings --> Build Options --> Cross compiler prefix
- Set this option equal to "arm-none-linux-gnueabi-"
Busybox Settings --> General Configuration --> Don't use /usr
- Enable this option by pressing "Y"
Linux Module Utilities --> [ ] Simplified modutils
[*] insmod
[*] rmmod
[*] lsmod
[*] Pretty output
[ ] modprobe
[ ] depmod
Linux Module Utilities --> [ ] Support version 2.2/2.4 Linux kernels
Linux Module Utilities --> [ ] Try to load module from a mmap'ed area
Linux Module Utilities --> [*] Support tainted module checking with new kernels
Linux Module Utilities --> () Default directory containing modules - Set this option to nothing
Linux Module Utilities --> () Default name of modules.dep - Set this option to nothing
14. Pre-requirement
● Install Busybox
$ adb push busybox /system/sbin
$ adb shell
$ cd /system/sbin
$ ./busybox --install .
# /system/sbin is recommended
Don't forget the DOT
15. Pre-requirement
● Compile Bash
$ CC=arm-none-linux-gnueabi-gcc ./configure --prefix=/opt/arm_bash/
--host=arm-linux --enable-static-link --without-bash-malloc
$
$ make
● Install Bash
$ adb push bash /system/sbin
$ adb shell
$ cd /system/sbin
$ mv sh sh.busybox
$ ln -s /system/sbin/bash sh
16. Run Test
● Run all test under device
# In /system/testsuites/accelerometer/test_code/script/
$ ./run_all.sh
● Troubleshooting
○ tmp - cannot work as a temporary directory
○ test - cannot work as a test directory
# In /system/testsuites/accelerometer/test_code/script/
$ mkdir tmp test
○ /bin/sh: bad interpreter: No such file or directory
# !/bin/sh
Modify to ...
# !/system/sbin/sh
19. Automation Tool
● TITAN, TI Test AutomatioN tool
○ Control board through serial or telnet connection
○ Scheduling to run the test cases.
○ Auto boot support (Phidget board required)
● Repository location
○ git://dev.omapzoom.org/pub/scm/cristopherson/titan-development.git
● Last commit
38. Customization
● Test code structure
Ctrl
+ C an
d Ct
rl +
V
C code
39. Customization
● Scenarios
○ L_DD_ACCELEROMETER_0000_0002
#####################################################################
# Scenario: L_DD_ACCELEROMETER_0000_0002
# Author : Hemanth V
# Date : Thu Jun 24 16:43:42 IST 2010
#####################################################################
# Begin L_DD_ACCELEROMETER_0000_0002
# FILE exists and is a symbolic link (same as -L)
01 set -x; test -h $ACCELEROMETER_SYSFS_PATH
# End L_DD_ACCELEROMETER_0000_0002
40. Customization
● Scenarios with helper
○ L_DD_ACCELEROMETER_0000_0005
...
01 $ACCELEROMETER_DIR_HELPER/$ACCELEROMETER_HW/ACC_0000_0005
...
○ ACC_0000_0005
echo -n "1" > $ACCELEROMETER_SYSFS_PATH/enable
echo "Ensure board is Flat on the surfacen"
value=`$ACCELEROMETER_DIR_BINARIES/acctest $DEVFS_ACCELEROMETER Z
| grep Value | awk '{print $2}'`
[ $value -ge 900 ]
46. Utilities
● Under "omap-ddt/utils/*"
● PAN tool
○ A test driver integrated from LTP
○ Execute listed test cases, report 0 for all passed, or number of failed
○ Ex. scenarios
● akey
○ Listen KEY_ENTER, KEY_SELECT and KEY_OK from kaypad
● waitkey
○ Listen any one key event
● BC tool
○ For "bc programming language" for math
○ Syntax is similar to C
47. Utilities
● evtest
○ Event listener, exit by interrupt
● handlers
○ A collection of useful helpers, such as operating on sysfs
○ handlerActivityManager.sh
○ handlerAndroidMonkey.sh
○ handlerAndroidPM.sh
○ handlerAndroidSqlite3.sh
○ handlerCpuFreqScalFrequencies.sh
○ handlerSysFs.sh
○ ...
○ About 4x helpers
48. Utilities
● memtester tool
○ Memoey testing tool
● microcom tool
○ Minicom-like serial terminal emulator
● priority
○ Get and set processes' priority
● schedutils tool
○ Control processes's scheduling
49. Utilities
● scripts
○ A collection of useful scripts and monkey scripts
○ android_display_switch.sh
○ is_android_ready.sh
○ display.live.wallpaper.menu
○ display.system.wallpaper.menu
○ ics.set.max.screen.timeout.value
○ t2.ics.unlock.screen
○ ...
○ About 2x scripts
50. Utilities
● Usage
# Test the enable/disable function of accelerometer
handlerSysFs.sh "set" $ACCELEROMETER_SYSFS_PATH/enable
$ACCELEROMETER_POWERON_VAL
handlerSysFs.sh "compare" $ACCELEROMETER_SYSFS_PATH/enable
$ACCELEROMETER_POWERON_VAL || exit 1
handlerSysFs.sh "set" $ACCELEROMETER_SYSFS_PATH/enable
$ACCELEROMETER_POWEROFF_VAL
handlerSysFs.sh "compare" $ACCELEROMETER_SYSFS_PATH/enable
$ACCELEROMETER_POWEROFF_VAL || exit 100
exit 0
51. Utilities
● Usage
#####################################################################
# Scenario: L_DD_ACCELEROMETER_0000_0005
# Author : Hemanth V
# Date : Thu Jun 24 16:43:42 IST 2010
#####################################################################
# Begin L_DD_ACCELEROMETER_0000_0005
echo -n "1" > $ACCELEROMETER_SYSFS_PATH/enable
echo "Ensure board is Flat on the surfacen"
value=`$ACCELEROMETER_DIR_BINARIES/acctest $DEVFS_ACCELEROMETER Z
| grep Value | awk '{print $2}'`
[ $value -ge 900 ]