Skip to content

Commit

Permalink
tests BUGFIX use user types
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvasko committed Mar 22, 2018
1 parent 4b65a75 commit 4f7ec5f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ __Q: error while loading shared libraries__
__A:__ libyang is installed into the directory detected by CMake's GNUInstallDirs
function. However, when it is connected with the installation prefix, the
target directory is not necessary the path used by the system linker. Check
the linker's paths in `/etc/ld.so.conf.d/`. If the path where libyang is
the linker's paths in `/etc/ld.so.conf.d/`. If the path where libyang is
installed is already present, just make `ldconfig` to rebuild its cache:
```
# ldconfig
Expand All @@ -15,7 +15,7 @@ __A:__ libyang is installed into the directory detected by CMake's GNUInstallDir
```
$ mkdir build; cd build
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
$ make
$ make
# make install
```
or add the libyang's location to the linker paths in `/etc/ld.so.conf.d` and
Expand All @@ -40,4 +40,9 @@ __A:__ To handle complex YANG extensions, libyang (and therefore yanglint(1))
```
$ LIBYANG_EXTENSIONS_PLUGINS_DIR=`pwd`/src/extensions ./yanglint
```

The same issue occurs for user types and the solution is the same except they
are built in `src/user_types/` subdirectory and the path should be set with:
```
$ LIBYANG_USER_TYPES_PLUGINS_DIR=`pwd`/src/user_types
```
However, user types are not required for yanglint(1) to run properly.
2 changes: 2 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ foreach(test_name IN LISTS api_tests data_tests schema_yin_tests schema_tests co
target_link_libraries(${test_name} ${CMOCKA_LIBRARIES} yang)
add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
set_property(TEST ${test_name} PROPERTY ENVIRONMENT "LIBYANG_EXTENSIONS_PLUGINS_DIR=${CMAKE_BINARY_DIR}/src/extensions")
set_property(TEST ${test_name} APPEND PROPERTY ENVIRONMENT "LIBYANG_USER_TYPES_PLUGINS_DIR=${CMAKE_BINARY_DIR}/src/user_types")
set_property(TEST ${test_name} APPEND PROPERTY ENVIRONMENT "MALLOC_CHECK_=3")
endforeach(test_name)

Expand All @@ -50,6 +51,7 @@ if(ENABLE_VALGRIND_TESTS)
add_test(${test_name}_valgrind valgrind --leak-check=full --show-leak-kinds=all --suppressions=${PROJECT_SOURCE_DIR}/tests/ld.supp --error-exitcode=1
${CMAKE_BINARY_DIR}/tests/${test_name})
set_property(TEST ${test_name}_valgrind PROPERTY ENVIRONMENT "LIBYANG_EXTENSIONS_PLUGINS_DIR=${CMAKE_BINARY_DIR}/src/extensions")
set_property(TEST ${test_name}_valgrind APPEND PROPERTY ENVIRONMENT "LIBYANG_USER_TYPES_PLUGINS_DIR=${CMAKE_BINARY_DIR}/src/user_types")
endforeach(test_name)
else(VALGRIND_FOUND)
message(WARNING "valgrind executable not found! Disabling memory leaks tests.")
Expand Down

0 comments on commit 4f7ec5f

Please sign in to comment.