Skip to content

Commit ac7eaed

Browse files
committed
[ci] streamlining
1 parent 0f7c0b4 commit ac7eaed

File tree

8 files changed

+26
-30
lines changed

8 files changed

+26
-30
lines changed

.github/workflows/dry-run.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
shell: bash
3535
run: |
3636
cd build
37-
cmake --build . --target install
37+
cmake --build . --config Release --target install
3838
3939
- name: Test
4040
shell: bash

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build products
2-
/build*/
2+
build*
33

44
# System hidden files
55
.DS_Store

.gitpod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ tasks:
1717
-DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_DIR}/install \
1818
-DBUILD_TESTING:BOOL=ON \
1919
-DINSTALL_ALL_ROBOTS:BOOL=ON
20-
cmake --build . --target install
20+
cmake --build . --config Release --target install

CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
# Authors: Ugo Pattacini
33
# CopyPolicy: Released under the terms of the GNU GPL v2.0.
44

5-
cmake_minimum_required(VERSION 3.5)
5+
cmake_minimum_required(VERSION 3.12)
66
project(robots-configuration VERSION 2.2.1)
77

8+
find_package(YCM REQUIRED)
89
find_package(YARP REQUIRED)
910
find_package(ICUBcontrib REQUIRED)
1011

11-
list(APPEND CMAKE_MODULE_PATH ${YARP_MODULE_PATH})
1212
list(APPEND CMAKE_MODULE_PATH ${ICUBCONTRIB_MODULE_PATH})
13-
14-
include(YarpInstallationHelpers)
1513
include(ICUBcontribOptions)
1614
include(ICUBcontribHelpers)
1715

@@ -25,6 +23,9 @@ if(UNIX)
2523
find_program(BASH_PROGRAM bash)
2624
include(CTest)
2725
enable_testing()
26+
if(BUILD_TESTING)
27+
add_subdirectory(tests/dry-run/check-nws-nwc-xml)
28+
endif()
2829
endif()
2930

3031
if(INSTALL_ALL_ROBOTS)
@@ -49,7 +50,7 @@ if(INSTALL_ALL_ROBOTS)
4950
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/CMakeLists.txt)
5051
message(STATUS "Exists")
5152
add_subdirectory(${dir})
52-
if(BASH_PROGRAM)
53+
if(BUILD_TESTING AND BASH_PROGRAM)
5354
set(test_dryrun_xml_name "dry-run_${dir}_xml")
5455
add_test(NAME ${test_dryrun_xml_name} COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/tests/dry-run/dry-run_xml.sh ${dir})
5556
message(STATUS "Also added test ${test_dryrun_xml_name}")

tests/dockerfiles/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ENV DEBIAN_FRONTEND=noninteractive
1010
# Install essentials
1111
RUN apt update && \
1212
apt install -y sudo apt-utils apt-transport-https software-properties-common build-essential psmisc procps gdb gdebi autoconf locales \
13-
git gitk cmake libace-dev libtinyxml-dev libtinyxml2-dev libxml2-dev \
13+
git gitk cmake libace-dev libtinyxml-dev libtinyxml2-dev libxml2-dev libxml2-utils \
1414
coinor-libipopt-dev libeigen3-dev libgsl-dev libopencv-dev libsdl1.2-dev \
1515
libi2c-dev i2c-tools xmlstarlet magic-wormhole
1616

tests/dry-run/check-nws-nwc-xml/CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,17 @@ cmake_minimum_required(VERSION 3.12)
99
project(check-nws-nwc-xml)
1010

1111
include(FetchContent)
12-
1312
FetchContent_Declare(
1413
pugixml
1514
GIT_REPOSITORY https://github.com/zeux/pugixml.git
1615
GIT_TAG origin/master
1716
)
1817

1918
FetchContent_GetProperties(pugixml)
20-
if(NOT pugixml)
21-
FetchContent_Populate(pugixml)
22-
add_subdirectory(${pugixml_SOURCE_DIR} ${pugixml_BINARY_DIR})
23-
endif()
19+
if(NOT pugixml)
20+
FetchContent_Populate(pugixml)
21+
add_subdirectory(${pugixml_SOURCE_DIR} ${pugixml_BINARY_DIR})
22+
endif()
2423

2524
add_executable(${PROJECT_NAME})
2625
target_sources(${PROJECT_NAME} PRIVATE check-nws-nwc-xml.cpp)

tests/dry-run/check-nws-nwc-xml/README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,27 @@ sudo apt install libxml2-utils
1717
2. Build the code :
1818

1919
```sh
20-
cd <your-robots-configuration-folder>/experimentalSetups/check-nws-nwc-xml
21-
mkdir build
22-
cd build
23-
ccmake ..
24-
make
20+
cd <your-robots-configuration-folder>/tests/dry-run/check-nws-nwc-xml
21+
mkdir build && cd build
22+
cmake ..
23+
make install
2524
```
2625

2726
3. Run the program :
2827

2928
```sh
30-
cd <your-robots-configuration-folder>/experimentalSetups/check-nws-nwc-xml/build
31-
./check-nws-nwc-xml <robot-folder-absolute-path>
29+
check-nws-nwc-xml <robot-folder-absolute-path>
3230
```
33-
## Example
3431

35-
Run :
32+
Example:
3633

3734
```sh
38-
./check-nws-nwc-xml /home/tumme/icub-tech-iit/robots-configuration/iCubLausanne01/
35+
check-nws-nwc-xml /home/tumme/icub-tech-iit/robots-configuration/iCubLausanne01/
3936
```
4037

4138
Output :
4239

43-
```
40+
```console
4441
1 - test yarprobotinterface.ini presence **************
4542

4643
yarprobotinterface.ini FOUND! PASS
@@ -200,5 +197,4 @@ Remappers XSD check passed!
200197
***************************************************
201198

202199
ALL TESTS PASSED!!
203-
204200
```

tests/dry-run/check-nws-nwc-xml/check-nws-nwc-xml.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ int main(int argc, char *argv[])
267267
if(ele.find("calibrators") != std::string::npos) {
268268
found = true;
269269
std::cout << ele << std::endl;
270-
xsd_cmd = "xmllint --schema ..\/calibrators.xsd " + ele + " --noout";
270+
xsd_cmd = "xmllint --schema ../calibrators.xsd " + ele + " --noout";
271271
ret = system(xsd_cmd.c_str());
272272
if (WEXITSTATUS(ret) != 0) {
273273
ALL_PASSED = false;
@@ -293,7 +293,7 @@ int main(int argc, char *argv[])
293293
if(ele.find("cartesian") != std::string::npos) {
294294
found = true;
295295
std::cout << ele << std::endl;
296-
xsd_cmd = "xmllint --schema ..\/cartesian.xsd " + ele + " --noout";
296+
xsd_cmd = "xmllint --schema ../cartesian.xsd " + ele + " --noout";
297297
ret = system(xsd_cmd.c_str());
298298
if (WEXITSTATUS(ret) != 0) {
299299
ALL_PASSED = false;
@@ -319,7 +319,7 @@ int main(int argc, char *argv[])
319319
if(ele.find("wrappers/motorControl") != std::string::npos && ele.find("_wrapper") != std::string::npos) {
320320
found = true;
321321
std::cout << ele << std::endl;
322-
xsd_cmd = "xmllint --schema ..\/wrapper.xsd " + ele + " --noout";
322+
xsd_cmd = "xmllint --schema ../wrapper.xsd " + ele + " --noout";
323323
ret = system(xsd_cmd.c_str());
324324
if (WEXITSTATUS(ret) != 0) {
325325
ALL_PASSED = false;
@@ -345,7 +345,7 @@ int main(int argc, char *argv[])
345345
if(ele.find("wrappers/motorControl") != std::string::npos && ele.find("_remapper") != std::string::npos) {
346346
found = true;
347347
std::cout << ele << std::endl;
348-
xsd_cmd = "xmllint --schema ..\/remapper.xsd " + ele + " --noout";
348+
xsd_cmd = "xmllint --schema ../remapper.xsd " + ele + " --noout";
349349
ret = system(xsd_cmd.c_str());
350350
if (WEXITSTATUS(ret) != 0) {
351351
ALL_PASSED = false;

0 commit comments

Comments
 (0)