Skip to content

Commit

Permalink
tests: adding test for building a linked develspace with files with u…
Browse files Browse the repository at this point in the history
…nicode names
  • Loading branch information
jbohren committed May 4, 2016
1 parent c2bf6ea commit 38fd58a
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/system/resources/catkin_pkgs/products_unicode/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 2.8.3)
project(products_unicode)
find_package(catkin REQUIRED)

catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}_lib
CFG_EXTRAS extras.cmake)

include_directories(include)

add_library(${PROJECT_NAME}_lib lib.cpp)
set_target_properties(${PROJECT_NAME}_lib PROPERTIES OUTPUT_NAME "${PROJECT_NAME}_lïb")
target_link_libraries(${PROJECT_NAME}_lib ${catkin_LIBRARIES})

add_executable(main main.cpp)
set_target_properties(main PROPERTIES OUTPUT_NAME "maïn")
target_link_libraries(main ${PROJECT_NAME}_lib ${catkin_LIBRARIES})

install(TARGETS ${PROJECT_NAME}_lib main
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set($ENV{PRODUCTS_UNICODE} "devel")
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set($ENV{PRODUCTS_UNICODE} "install")
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace make_products_0 {
int fun();
}
4 changes: 4 additions & 0 deletions tests/system/resources/catkin_pkgs/products_unicode/lib.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include <make_products_0/fun.h>
int make_products_0::fun() {
return 0;
}
6 changes: 6 additions & 0 deletions tests/system/resources/catkin_pkgs/products_unicode/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#include <make_products_0/fun.h>

int main(int argc, char** argv) {
return make_products_0::fun();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<package>
<name>products_unicode</name>
<version>0.1.0</version>
<description>This package generates products in the make stage.</description>
<maintainer email="todo@todo.todo">todo</maintainer>
<license>BSD</license>
<buildtool_depend>catkin</buildtool_depend>
</package>
14 changes: 14 additions & 0 deletions tests/system/verbs/catkin_build/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,17 @@ def test_install_catkin_destdir():
setup_dir_correct = True
break
assert setup_dir_correct is True


def test_pkg_with_unicode_names():
"""Test building a package with unicode file names."""
with redirected_stdio() as (out, err):
with workspace_factory() as wf:
print(os.getcwd)
wf.build()
shutil.copytree(
os.path.join(RESOURCES_DIR, 'catkin_pkgs', 'products_unicode'),
os.path.join('src/cmake_pkgs'))

assert catkin_success(['config', '--link-devel'])
assert catkin_success(BUILD)

0 comments on commit 38fd58a

Please sign in to comment.