~cyphermox/unity/phablet-packaging

« back to all changes in this revision

Viewing changes to run

  • Committer: Tarmac
  • Author(s): Daniel d'Andrada
  • Date: 2013-04-19 14:51:08 UTC
  • mfrom: (603.1.34 remove_fakes_from_qml)
  • Revision ID: tarmac-20130419145108-wanpphpc2pbumgui
Purge fakes from QML code.
  
Instead of having several switches in the qml code to choose between fake
and real implementations of components, provide a fake implementation of
Ubuntu.Application module instead. That way we have a cleaner QML code
that is easier to test and we run exactly the same qml code both on the
target device and under a fake environment.

Approved by Michał Sawicz, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
QML_PHONE_SHELL_PATH=./builddir/qml-phone-shell
4
4
export LD_LIBRARY_PATH=$PWD/../unity_build/build/lib
5
5
GDB=false
6
 
 
7
 
set -- `getopt -n$0 -u -a --longoptions="gdb" "g" "$@"`
 
6
FAKE=false
 
7
 
 
8
usage() {
 
9
    echo "usage: "$0" [OPTIONS]\n" >&2
 
10
    echo "Script to run the shell.\n" >&2
 
11
    echo "OPTIONS:" >&2
 
12
    echo " -f, --fake Force use of fake Qml modules." >&2
 
13
    echo " -g, --gdb Run through gdb." >&2
 
14
    echo " -h, --help Show this help." >&2
 
15
    echo >&2
 
16
    exit 1
 
17
}
 
18
 
 
19
ARGS=`getopt -n$0 -u -a --longoptions="fake,gdb,help" -o "fgh" -- "$@"`
 
20
[ $? -ne 0 ] && usage
 
21
eval set -- "$ARGS"
8
22
 
9
23
while [ $# -gt 0 ]
10
24
do
11
25
    case "$1" in
 
26
       -f|--fake)  FAKE=true;;
12
27
       -g|--gdb)   GDB=true;;
 
28
       -h|--help)  usage;;
13
29
       --)         shift;break;;
14
30
    esac
15
31
    shift
16
32
done
17
33
 
 
34
[ $# -gt 1 ] && usage
 
35
 
 
36
if $FAKE; then
 
37
  export QML2_IMPORT_PATH=$PWD/builddir/plugins:$PWD/builddir/tests/mocks
 
38
fi
 
39
 
18
40
if $GDB; then
19
41
  gdb -ex run --args $QML_PHONE_SHELL_PATH $@
20
42
else