forked from IntelRealSense/librealsense
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
146 lines (113 loc) · 3.76 KB
/
appveyor.yml
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
# Copyright (c) 2017 Intel Corporation. All rights reserved.
# Use of this source code is governed by a Apache License
# Version 2.0 license that can be found in the LICENSE file.
version: 2.1.{build}
branches:
only:
- development
skip_tags: true
environment:
nodejs_version: "6"
image: Visual Studio 2015
clone_folder: c:\projects\librealsense
init:
- ps: >-
$startTime = (Get-Date)
echo "Script started on $startTime"
- cmd:
install:
- ps: Install-Product node $env:nodejs_version
- cmd: >-
cd c:\projects\librealsense\.. && git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
set OLDPATH=%PATH% && set PATH=%PATH%;c:\projects\depot_tools
cd c:\projects\librealsense\wrappers\nodejs\tools && npm install
cd c:\projects\librealsense\wrappers\nodejs && node .\tools\linter.js && set PATH=%OLDPATH% && set OLDPATH=
before_build:
- cmd: >-
cd c:\projects\librealsense && mkdir build && cd build
cmake .. -DBUILD_EXAMPLES=true -DBUILD_PYTHON_BINDINGS=true -DBUILD_NODEJS_BINDINGS:BOOL=true -DBUILD_UNIT_TESTS:BOOL=true
build:
project: ./build/librealsense2.sln
parallel: true # Is not in use on "Free" plans - https://github.com/appveyor/ci/issues/216. Leaved for future consideration
verbosity: minimal
#Unit-Test Suite
# Each successful build will invoke a set of predefined unit-test that will run from recorded live test sessions
# The records are available for download from the location specified in the tests, and are arranged in the following convention
# |
# |---| ..
# | | Records.txt
# | |
# | | single_cam
# | | ..
# | | Recorded_Test_1
# | | Recorded_Test_2
# | | ......
# |
# | | multi_cam
# | | ..
# | | Recorded_Test_3
# | | Recorded_Test_4
# | | ......
# |
# The content of Records.txt is a list of all record paths one per line, e.g:
# single_cam/Recorded_Test_1
# single_cam/Recorded_Test_2
# multi_cam/Recorded_Test_3
# multi_cam/Recorded_Test_4
#
test_script:
- ps: >-
$url_records_path = "https://librealsense.intel.com/rs-tests/lrs_2.8.3/"
$url_records_list = $url_records_path + "records.txt"
$out_records_list = "records.txt"
Invoke-WebRequest -Uri $url_records_list -OutFile $out_records_list
$records = Get-Content $out_records_list
mkdir single_cam
mkdir multi_cam
foreach ($element in $records)
{
$url_cur = $url_records_path + $element
Invoke-WebRequest -Uri $url_cur -OutFile $element
}
$test_failed = @()
& cmd.exe /c C:/projects/librealsense/build/Debug/live-test.exe -d yes -i [software-device]
if ($LASTEXITCODE -ne 0)
{
$test_failed += "software-device"
}
foreach ($element in $records)
{
$url_cur = $url_records_path + $element
& cmd.exe /c C:/projects/librealsense/build/Debug/live-test.exe from $element -d yes -i
if ($LASTEXITCODE -ne 0)
{
$test_failed += $element
}
}
if ($test_failed.length -ne 0)
{
$err_msg = "The following tests failed: "
foreach ($elem in $test_failed)
{
$err_msg = $err_msg + $elem + ", "
}
throw $err_msg
}
# TODO(halton): Add unit test for Node.js binding
#---------------------------------#
# global handlers #
#---------------------------------#
# on successful build
on_success:
- ps: >-
echo Script completed successfuly
# on build failure
on_failure:
- ps: >-
echo "Script Failed"
# after build failure or success
on_finish:
- ps: >-
$endTime = (Get-Date)
echo "Ended on $endTime"
($endTime-$startTime).ToString('''Execution time: ''mm'' min ''ss'' sec''')