summaryrefslogtreecommitdiff
path: root/androidTest.sh
blob: f9ae88ead3c253a48b4b3c1e2c65096ee33d2994 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
set -e

config=(${1//,/ })
export hostName=${config[0]}
export triple=${config[1]}
export remoteDir=${config[2]}
export compiler=$toolchain/$triple/bin/$triple-gcc
tripleToken=(${triple//-/ })
export arch=${tripleToken[0]}

export logHome=$buildSlaveRoot/test-traces/$triple/$hostName

dir_count=$(ls -l $logHome/ | grep -c ^d)

if [ $dir_count -gt 10 ]
then
  ls -t $logHome/ | tail -n +11 | xargs rm -rf
fi

today=`date '+%Y_%m_%d__%H_%M_%S'`
export logDir=$logHome/$today
mkdir -p $logDir


function clean {
  svn status $lldbDir/test --no-ignore | grep '^[I?]' | cut -c 9- | while IFS= read -r f; do echo "$f"; rm -rf "$f"; done || true
  ssh $hostName "ps -A | grep lldb-server | awk '{print \$1}' | xargs kill || true"
  ssh $hostName "rm -rd $remoteDir || true"
}
trap clean EXIT


set -x

# Check if lldb-server is already running. If yes then kill the process else do nothing.
ssh $hostName "ps -A | grep lldb-server | awk '{print \$1}' | xargs kill || true"

# Delete remoteDir if it was present previously
ssh $hostName "rm -rd $remoteDir || true"

# Create new remoteDir.
ssh $hostName "mkdir -p $remoteDir/tmp"

# Copy lldb-server binary to remoteDir
scp $buildDir/$triple/bin/lldb-server $hostName:$remoteDir/


listen_url=*:$port
connect_url=connect://$hostName:$port


screen -d -m ssh $hostName "TMPDIR=$remoteDir/tmp $remoteDir/lldb-server platform --listen $listen_url --server"

export LLDB_TEST_THREADS=8

lldbPath=$buildDir/host/bin/lldb

cmd="$lldbDir/test/dotest.py \
--executable $lldbPath \
-A $arch -C $compiler \
-v -s $logDir -u CXXFLAGS -u CFLAGS \
--channel \"gdb-remote packets\" --channel \"lldb all\" \
--platform-name remote-linux \
--platform-url $connect_url \
--platform-working-dir $remoteDir \
--env OS=Linux \
--skip-category lldb-mi"

eval $cmd