forked from legatoproject/legato-af
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-tests
executable file
·837 lines (676 loc) · 19 KB
/
run-tests
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
#!/bin/bash
copyright="
Copyright (C) Sierra Wireless Inc.
"
. "$(dirname "${BASH_SOURCE[0]}")/framework/tools/scripts/shlib"
help_usage=(
"CMD <ARGS>"
)
help_short_desc="Build and run Legato unit-tests"
help_long_description=(
"$help_short_desc"
""
"CMD must be one of the following options:"
" - host-ut:"
" build and run unit-tests on the local machine."
" Uses 'tests_localhost' make target."
" No extra arguments are needed."
""
" - run-host-ut:"
" use an existing build to execute the 'running' part of 'host-ut'."
""
" - target-ut:"
" build and run unit-tests for a specific target."
" Uses the 'tests_<target>' make target (e.g.: 'tests_wp76xx' or 'tests_wp85')."
" The following env. variables must be set before running this script:"
" - DEST_IP: IP of the device to test"
" - TARGET_TYPE: Type of the device to test (e.g.: 'wp76xx' or 'wp85')"
""
" - run-target-ut:"
" use an existing build to execute the 'running' part of 'target-ut'."
""
" - virt-target-ut:"
" similar to target-ut, but instantiate and run tests on a QEmu-based virtual"
" platform in a Docker environment."
" DEST_IP and TARGET_TYPE variables are not necessary."
" VIRT_TARGET_ARCH can be declared as to set the CPU architecture to emulate."
""
" - run-virt-target-ut:"
" use an existing build to execute the 'running' part of 'virt-target-ut'."
""
" - target-clean-coverage:"
" removes code coverage data stored on a target."
" IP must be provided as parameter, e.g.:"
" ./run-tests target-clean-coverage 192.168.2.2"
""
" - target-get-coverage:"
" fetches code coverage data stored on a target."
" Target type and IP must be provided as parameters."
" Coverage data is stored in build/$$target_type/coverage/raw/"
" e.g.:"
" ./run-tests target-get-coverage wp76xx 192.168.2.2"
" retrieves coverage data from the device and stores it in"
" 'build/wp76xx/coverage/raw/'."
""
" - report-coverage:"
" generates code coverage report."
" Target type must be provided as parameter, e.g.:"
" ./run-tests report-coverage wp76xx"
" generates a report in build/wp76xx/coverage/html/ using"
" data stored in build/wp76xx/coverage/raw/."
""
" - dev-trial:"
" build and run unit-tests for localhost' and 'virt' targets."
""
" - quick-test:"
" quick check, at the moment an alias to 'host-ut'."
)
SOURCEDIR=$PWD
BUILDDIR_BASE=$PWD/build
TEST_COVERAGE=${TEST_COVERAGE:-1}
TEST_COVERAGE_DIR=${TEST_COVERAGE_DIR:-/data/coverage}
WITH_COLORS=${WITH_COLORS:-true}
TARGET_SSH_PORT=${TARGET_SSH_PORT:-22}
if [[ "$WITH_COLORS" == "true" ]]; then
COLOR_INFO="\033[1;36m"
COLOR_ERROR="\033[1;31m"
COLOR_WARN="\033[1;93m"
COLOR_RESET="\033[0m"
COLOR_PASS="\033[1;32m"
fi
# This allows to build commands such as 'if <cmd> | <cmd>'
# without having to check the exit status of each sub-commands.
set -o pipefail
function message {
local color=$1
shift
echo $ECHO_ARGS -e $color $* $COLOR_RESET
}
function DoTestCleanup()
{
StopDaemons
StopVirtualTarget
}
function Exit()
{
DoTestCleanup
exit $1
}
function Abort()
{
message $COLOR_WARN "Aborting ..."
Exit 1
}
trap 'Abort' INT
function CheckRet()
{
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
message $COLOR_ERROR "Exit Code $RETVAL"
Exit $RETVAL
fi
}
function CheckSshHost {
local ssh_host=$1
local ssh_port=$2
host_ENTRY="$ssh_host"
if [[ "$ssh_port" != "22" ]]; then
host_ENTRY="[$ssh_host]:$ssh_port"
fi
known_ENTRY=$(ssh-keygen -F $host_ENTRY | grep -v '#')
ssh_ENTRY=$(ssh-keyscan -p $ssh_port -t rsa $ssh_host 2>/dev/null)
if [ -z "$ssh_ENTRY" ]; then
echo "Unable to find RSA host key for $host_ENTRY"
return 1
fi
ssh_KEY=$(echo $ssh_ENTRY | awk '{print $3}')
# Rebuild entry because port is not specified in some versions of ssh-keyscan
ssh_ENTRY="$host_ENTRY ssh-rsa $ssh_KEY"
if [ -z "$known_ENTRY" ]; then
message $COLOR_WARN "Host '$ssh_host' ($ssh_port) is not known, adding new key"
if ! [ -e "$HOME/.ssh/known_hosts" ]; then
mkdir -p "$HOME/.ssh"
touch "$HOME/.ssh/known_hosts"
fi
echo "$ssh_ENTRY" >> "$HOME/.ssh/known_hosts"
ssh-keygen -H
else
# Host is known
known_LINE=$(echo $known_ENTRY | sed -e 's/\([0-9]*\):.*/\1/g')
known_KEY=$(echo $known_ENTRY | awk '{print $3}' | head -1)
message $COLOR_WARN "Host '$ssh_host' ($ssh_port) is known"
if ! [[ "$known_KEY" == "$ssh_KEY" ]]; then
message $COLOR_WARN "Replacing key for '$ssh_host' ($ssh_port)"
# Remove existing entry
ssh-keygen -R $host_ENTRY
# Add new key
echo "$ssh_ENTRY" >> "$HOME/.ssh/known_hosts"
ssh-keygen -H
fi
fi
}
function CheckSsh {
local ssh_host=$1
local ssh_port=${2:-22}
ssh_host=$(echo $ssh_host | tr '[:upper:]' '[:lower:]')
local ssh_ip=$(getent hosts $ssh_host | head -1 | awk '{print $1}')
CheckSshHost $ssh_host $ssh_port
if [ $? -ne 0 ]; then
return 1
fi
if [ -z "$ssh_ip" ] || [[ "$ssh_host" == "$ssh_ip" ]]; then
return 0
fi
CheckSshHost $ssh_ip $ssh_port
if [ $? -ne 0 ]; then
return 1
fi
}
function StartServiceDirectory()
{
message $COLOR_INFO "Starting Service Directory..."
serviceDirectory &
SERVICE_DIRECTORY_PID=$!
sleep 0.5
message $COLOR_PASS "DONE"
}
function StopServiceDirectory()
{
ECHO_ARGS='-n' message $COLOR_INFO "Stopping Service Directory..."
kill $SERVICE_DIRECTORY_PID > /dev/null 2>&1
message $COLOR_PASS "DONE"
}
function CheckServiceDirectory()
{
if ! kill -0 $SERVICE_DIRECTORY_PID > /dev/null 2>&1
then
message $COLOR_WARN "Service Directory is no longer running!"
Exit 1
fi
}
function StartLogControlDaemon()
{
message $COLOR_INFO "Starting Log Control Daemon..."
logCtrlDaemon &
LOG_CTRL_DAEMON_PID=$!
sleep 0.5
message $COLOR_PASS "DONE"
}
function StopLogControlDaemon()
{
ECHO_ARGS='-n' message $COLOR_INFO "Stopping Log Control Daemon..."
kill $LOG_CTRL_DAEMON_PID > /dev/null 2>&1
sleep 0.5
message $COLOR_PASS "DONE"
}
function CheckLogControlDaemon()
{
if ! kill -0 $LOG_CTRL_DAEMON_PID > /dev/null 2>&1
then
message $COLOR_WARN "Log Control Daemon is no longer running!"
Exit 1
fi
}
function StartConfigTree()
{
message $COLOR_INFO "Starting Configuration Tree..."
configTree &
CONFIG_TREE_PID=$!
sleep 0.5
message $COLOR_PASS " DONE."
}
function StopConfigTree()
{
ECHO_ARGS='-n' message $COLOR_INFO "Stopping Configuration Tree..."
kill $CONFIG_TREE_PID > /dev/null 2>&1
message $COLOR_PASS " DONE."
}
function CheckConfigTree()
{
if ! kill -0 $CONFIG_TREE_PID > /dev/null 2>&1
then
message $COLOR_WARN "Config Tree is no longer running!"
Exit 1
fi
}
function StartDaemons()
{
StartServiceDirectory
StartLogControlDaemon
StartConfigTree
}
function StopDaemons()
{
if [[ "$TARGET_TYPE" != "localhost" ]]; then
return
fi
StopLogControlDaemon
StopServiceDirectory
StopConfigTree
}
function CheckDaemons()
{
CheckLogControlDaemon
CheckServiceDirectory
CheckConfigTree
}
# Wait for SSH to be available
function WaitSsh()
{
for (( i=0; i<10; i++ )); do
echo "Trying $DEST_IP:22 ..."
KEY=$(ssh-keyscan -p 22 -t rsa $DEST_IP)
if [ -n "$KEY" ]; then
return 0
fi
sleep 15
done
return 1
}
function StartVirtualTarget()
{
VIRT_TARGET_ARCH=${VIRT_TARGET_ARCH:-arm}
VIRT_DOCKER_IMG=${VIRT_DOCKER_IMG:-"quay.io/legato/virt-$VIRT_TARGET_ARCH"}
if ! which docker >/dev/null; then
message $COLOR_ERROR "Unable to find 'docker', unable to executed virtual tests."
echo "See https://docs.docker.com/engine/installation/ for installation instructions."
Exit 1
fi
if [ -z "$VIRT_SKIP_PULL" ]; then
message $COLOR_INFO "Downloading virtual target image ..."
docker pull $VIRT_DOCKER_IMG
CheckRet
fi
# If available, use the partition built locally
local volume_opt
if [ -e "$SOURCEDIR/build/virt/legato.squashfs" ]; then
volume_opt="--volume=$SOURCEDIR/build/virt/legato.squashfs:/legato/legato.squashfs"
fi
VIRT_CNT_NAME="virt-$(date +%Y%d%m-%H%M%S)"
# If available, use the partition built locally
local volume_opt
if [ -e "$SOURCEDIR/build/virt/legato.squashfs" ]; then
volume_opt="--volume=$SOURCEDIR/build/virt/legato.squashfs:/legato/legato.squashfs"
fi
message $COLOR_INFO "Starting virtual target ..."
docker run \
--detach \
--name=$VIRT_CNT_NAME \
$volume_opt \
$VIRT_DOCKER_IMG
CheckRet
# Wait up to 1 minute for the image to have an IP
for (( i=0; i<4; i++ )); do
DEST_IP=$(docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $VIRT_CNT_NAME)
if [ -n "$DEST_IP" ]; then
break
fi
sleep 15
done
echo "Virtual target[$VIRT_TARGET_ARCH]: IP[$DEST_IP] Container[$VIRT_CNT_NAME]"
WaitSsh
CheckRet
CheckSsh $DEST_IP
CheckRet
export DEST_IP VIRT_TARGET_ARCH
}
function StopVirtualTarget()
{
if [ -n "$VIRT_CNT_NAME" ]; then
docker kill $VIRT_CNT_NAME
fi
}
function CleanBuild()
{
make clean
}
function TargetIdentify()
{
if [ -z "$TARGET_TYPE" ]; then
echo "Identifying target ..."
TARGET_MODEL=$(ssh -o ConnectTimeout=5 -p $TARGET_SSH_PORT root@$DEST_IP "bsinfo -l | grep \" - \$(bsinfo -s -t)\" | sed -e 's/BS//' -e 's/ - .*$//'" 2> /dev/null)
if [ -z "$TARGET_MODEL" ]; then
echo "Unable to determine remote target model"
Exit 1
fi
TARGET_TYPE=$($SOURCEDIR/bin/gettargettype $TARGET_MODEL)
if [ -z "$TARGET_TYPE" ]; then
echo "Unable to determine remote target type"
Exit 1
fi
fi
message $COLOR_INFO "Testing Legato on $DEST_IP (type = $TARGET_TYPE)"
}
function TargetUpdateLegato()
{
message $COLOR_INFO "Updating Legato"
# if startup scripts are updated target will need to reboot.
instsys build/$TARGET_TYPE/system.$TARGET_TYPE.update $DEST_IP
CheckRet
# Wait for target to bring up the new system.
sleep 30
# Mark good
message $COLOR_INFO "-> marking good"
for (( i=0; i<10; i++ )); do
echo "waiting ..."
if timeout 15 ssh -p $TARGET_SSH_PORT root@$DEST_IP "/legato/systems/current/bin/update --mark-good" > build/$TARGET_TYPE/target.log 2>&1; then
break
fi
if grep -q "The probation period has already ended" build/$TARGET_TYPE/target.log; then
break
fi
sleep 15
done
# Wait for system to be marked good
message $COLOR_INFO "-> checking status"
for (( i=0; i<10; i++ )); do
echo "waiting ..."
if timeout 15 ssh -p $TARGET_SSH_PORT root@$DEST_IP "/legato/systems/current/bin/legato status | grep current | grep good"; then
return 0
fi
sleep 15
done
message $COLOR_ERROR "Timeout !"
Exit 1
}
function TargetCleanCoverage()
{
local target_ip=$1
ssh root@$target_ip "rm -rf $TEST_COVERAGE_DIR"
CheckRet
}
# Transfer coverage results stored on the target to the test host
function TargetRetrieveCoverage()
{
local target_type=$1
local target_ip=$2
message $COLOR_INFO "Getting code coverage from target $target_ip"
cd $SOURCEDIR
rm -rf build/$target_type/coverage/raw/
mkdir -p build/$target_type/coverage/raw/
# Restart legato to make sure that coverage has been saved
ssh root@$target_ip "/legato/systems/current/bin/legato restart"
# Transfer
if ! ssh root@$target_ip "cd $TEST_COVERAGE_DIR && tar c *" | tar x -C build/$target_type/coverage/raw/; then
message $COLOR_WARN "Unable to transfer coverage files from $TEST_COVERAGE_DIR"
fi
for d in $(find build/$target_type/coverage/raw -wholename "*/build/$target_type"); do
rsync -a $d/ build/$target_type/
CheckRet
done
}
function Job_TargetCleanCoverage()
{
local target_ip=$2
if [ -z "$target_ip" ]; then
echo "Usage: $0 $1 <target IP>"
exit 1
fi
CheckSsh $target_ip
CheckRet
TargetCleanCoverage $target_ip
}
function Job_TargetRetrieveCoverage()
{
local target_type=$2
local target_ip=$3
if [ -z "$target_type" ] || [ -z "$target_ip" ]; then
echo "Usage: $0 $1 <target type> <target IP>"
exit 1
fi
CheckSsh $target_ip
CheckRet
TargetRetrieveCoverage $target_type $target_ip
}
function TargetUnitTest()
{
if [ -z "$DEST_IP" ]; then
echo "Target IP address (DEST_IP) is not available. Unit testing on target will be skipped."
return
fi
TargetUpdateLegato
cd $BUILDDIR_BASE/$TARGET_TYPE
CheckRet
if [[ "$TEST_COVERAGE" == "1" ]]; then
TargetCleanCoverage $DEST_IP
fi
# Test
$SOURCEDIR/apps/test/targetUnitTests $DEST_IP $TARGET_TYPE
local test_ret=$?
if [ $test_ret -ne 0 ]; then
message $COLOR_ERROR "Target tests failed"
else
message $COLOR_PASS "Target tests OK"
fi
if [[ "$TEST_COVERAGE" == "1" ]]; then
TargetRetrieveCoverage "$TARGET_TYPE" "$DEST_IP"
fi
cd $SOURCEDIR
CheckRet
return $test_ret
}
function HostUnitTest()
{
# Default timeout to 2 minutes
#
# NOTE: Tests can eventually override this timeout using
# add_test(MyTest1 ....)
# set_tests_properties(MyTest1 PROPERTIES TIMEOUT 100)
UT_TIMEOUT=${UT_TIMEOUT:-120}
# Default to run all test cases
UT_FILTER=${UT_FILTER:-".*"}
cd $BUILDDIR_BASE/localhost
CheckRet
export PATH=$PWD/framework/bin:$PWD/tests/bin:$PATH
# Stop any other instances of the legato framework daemons that may already be running.
# NOTE: Killing the Service Directory should be sufficient to cause everything else to die too.
serviceDirProcIDs=`pgrep serviceDir`
if [ $? -eq 0 ]
then
for procID in $serviceDirProcIDs
do
echo "*** Killing Service Directory process with PID $procID"
kill $procID
done
fi
StartDaemons
CheckDaemons
# Test
ctest \
-D ExperimentalTest \
--no-compress-output \
--tests-regex "$UT_FILTER" \
--timeout $UT_TIMEOUT \
-VV
local test_ret=$?
if [ $test_ret -ne 0 ]; then
message $COLOR_ERROR "Host tests failed"
else
message $COLOR_PASS "Host tests OK"
fi
CheckDaemons
StopDaemons
cd $SOURCEDIR
CheckRet
return $test_ret
}
function Build()
{
local target=$1
local builddir="$BUILDDIR_BASE/$target"
message "Building $target with code coverage report set to $TEST_COVERAGE"
# Check Toolchain path
# NOTE: Even if the toolchain path is not set, the Makefile should be able to recover.
if [[ "$target" != "localhost" ]]; then
local toolchain_env="${target^^}_TOOLCHAIN_DIR"
if [ -z "${!toolchain_env}" ]; then
message $COLOR_WARN "$toolchain_env not set!"
else
echo "$toolchain_env=${!toolchain_env}"
fi
fi
# Build
make tests_$target TEST_COVERAGE=$TEST_COVERAGE
CheckRet
source $SOURCEDIR/bin/configlegatoenv
}
function BuildTools()
{
echo "Building Tools"
make tools
CheckRet
}
function BuildClang()
{
if ! which clang; then
echo "Unable to find clang"
Exit 1
fi
echo " Clang version:"
clang -v 2>&1 |head -1
# Normal build, with clang
export USE_CLANG=1
Build "localhost"
unset USE_CLANG
CleanBuild
}
function Job_HostUnitTest()
{
local clean=${1:-true}
if [ -n "$SKIP_HOST_TESTING" ]; then
echo "Skipping host unit tests."
return
fi
export TARGET_TYPE=localhost
if $clean; then
CleanBuild
Build $TARGET_TYPE
fi
HostUnitTest
local test_ret=$?
GenerateReport $TARGET_TYPE
Exit $test_ret
}
function Job_TargetUnitTest()
{
local clean=${1:-true}
if [ -n "$SKIP_TARGET_TESTING" ]; then
echo "Skipping on-target unit tests."
return
fi
TargetIdentify
if $clean; then
CleanBuild
Build $TARGET_TYPE
fi
TargetUnitTest
local test_ret=$?
GenerateReport $TARGET_TYPE
Exit $test_ret
}
function Job_VirtualTargetUnitTest()
{
local clean=${1:-true}
if [ -n "$SKIP_TARGET_TESTING" ]; then
echo "Skipping on-target unit tests."
return
fi
export TARGET_TYPE=virt
export VIRT_TARGET_ARCH=${VIRT_TARGET_ARCH:-arm}
if $clean; then
CleanBuild
Build $TARGET_TYPE
fi
StartVirtualTarget
TargetUnitTest
local test_ret=$?
GenerateReport $TARGET_TYPE
Exit $test_ret
}
function Manual_DeveloperPrePushTrial()
{
message $COLOR_INFO "Cleaning ..."
CleanBuild
message $COLOR_INFO "Building ..."
Build "localhost"
message $COLOR_INFO "Building for virtual target ..."
Build "virt"
message $COLOR_INFO "Testing host UTs ..."
Job_HostUnitTest false
message $COLOR_INFO "Testing virtual target UTs ..."
Job_VirtualTargetUnitTest false
message $COLOR_PASS "Tests complete"
}
function GenerateReport()
{
local target=$1
local builddir="$BUILDDIR_BASE/$target"
if [[ "$TEST_COVERAGE" == "1" ]]; then
message $COLOR_INFO "Generating report for $target ..."
cd $SOURCEDIR
# Build
gcovr --xml \
--root . \
--output $builddir/coverage.xml \
--exclude ".*(test|build|codegen)\b.*"
CheckRet
mkdir -p $builddir/coverage/html/
gcovr --html \
--html-details \
--root . \
--output $builddir/coverage/html/index.html \
--exclude ".*(test|build|codegen)\b.*"
CheckRet
fi
}
function Job_GenerateReport()
{
local target=$2
if [ -z "$target" ]; then
echo "Usage: $0 $1 <target>"
exit 1
fi
GenerateReport $target
}
CheckForHelp $1
message $COLOR_INFO "== Task: '$1' ==\n"
if [ -e "$SOURCEDIR/bin/configlegatoenv" ]; then
source $SOURCEDIR/bin/configlegatoenv
fi
case "$1" in
host-ut | quick-test)
Job_HostUnitTest true
;;
run-host-ut)
Job_HostUnitTest false
;;
target-ut)
Job_TargetUnitTest true
;;
run-target-ut)
Job_TargetUnitTest false
;;
virt-target-ut)
Job_VirtualTargetUnitTest true
;;
run-virt-target-ut)
Job_VirtualTargetUnitTest false
;;
target-clean-coverage)
Job_TargetCleanCoverage $@
;;
target-get-coverage)
Job_TargetRetrieveCoverage $@
;;
report-coverage)
Job_GenerateReport $@
;;
dev-trial)
Manual_DeveloperPrePushTrial
;;
*)
echo "Invalid argument: '$1'"
exit 1
;;
esac
Exit 0