Skip to content

Commit b44dbb3

Browse files
committed
CMake-tests: validate android mismatch warnings
Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
1 parent 0491817 commit b44dbb3

4 files changed

Lines changed: 87 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright (C) 2025 HERE Europe B.V.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
# License-Filename: LICENSE
17+
18+
cmake_minimum_required(VERSION 3.12)
19+
20+
project(gluecodium.test)
21+
set(CMAKE_CXX_STANDARD 17)
22+
23+
set(THREADS_PREFER_PTHREAD_FLAG ON)
24+
find_package(Threads REQUIRED)
25+
26+
list(APPEND CMAKE_MODULE_PATH "${GLUECODIUM_CMAKE_DIR}/modules")
27+
include(gluecodium/Gluecodium)
28+
29+
include(${GLUECODIUM_CMAKE_TESTS_DIR}/utils/get_supported_gluecodium_generators.cmake)
30+
31+
add_library(dummySharedLibrary SHARED "${CMAKE_CURRENT_LIST_DIR}/cpp/FooImpl.cpp")
32+
target_link_libraries(dummySharedLibrary PRIVATE Threads::Threads)
33+
34+
get_supported_gluecodium_generators(_gluecodium_generator)
35+
36+
gluecodium_generate(dummySharedLibrary GENERATORS ${_gluecodium_generator})
37+
gluecodium_target_lime_sources(dummySharedLibrary
38+
PRIVATE "${CMAKE_CURRENT_LIST_DIR}/lime/foo.lime")
39+
40+
set_target_properties(dummySharedLibrary
41+
PROPERTIES GLUECODIUM_ENABLE_ANDROID_ATTRIBUTES_MISMATCH_WARNING "ON")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// -------------------------------------------------------------------------------------------------
2+
// Copyright (C) 2016-2025 HERE Europe B.V.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
// SPDX-License-Identifier: Apache-2.0
17+
// License-Filename: LICENSE
18+
//
19+
// -------------------------------------------------------------------------------------------------
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (C) 2016-2025 HERE Europe B.V.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
# License-Filename: LICENSE
17+
18+
package unit.test
19+
20+
# This class uses function with type that does not exist.
21+
# It is done this way to force CMake to print Gluecodium logs
22+
# to the output to be able to match it.
23+
@Java(Skip)
24+
class Foo {
25+
fun foo(): SomeTypeThatDoesNotExits
26+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
element unit.test.Foo: Attributes missing in Kotlin, but present in Java: \[Skip\]

0 commit comments

Comments
 (0)