Skip to content

Commit 34395fc

Browse files
committed
Add a simple test for build_info()
1 parent 611204f commit 34395fc

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
include("rsp/testing")
2+
include("rsp/debug")
3+
4+
define_test_case(
5+
"Build Info Test"
6+
LABELS "debug;build_info"
7+
)
8+
9+
# -------------------------------------------------------------------------------------------------------------- #
10+
# Actual Tests
11+
# -------------------------------------------------------------------------------------------------------------- #
12+
13+
define_test("can output build info" "outputs_build_info")
14+
function(outputs_build_info)
15+
16+
# Set a few of the build info variables
17+
set(CMAKE_BUILD_TYPE "Debug")
18+
set(LIB_TYPE "STATIC")
19+
20+
# ---------------------------------------------------------------------- #
21+
22+
build_info(OUTPUT result)
23+
24+
# Debug
25+
# message("${result}")
26+
27+
# ---------------------------------------------------------------------- #
28+
29+
# Ensure that a few of the properties are in the output
30+
assert_string_contains("${result}" "Type: ${CMAKE_BUILD_TYPE}" MESSAGE "Incorrect build info output (build type)")
31+
assert_string_contains("${result}" "Library Type: ${LIB_TYPE}" MESSAGE "Incorrect build info output (library type)")
32+
endfunction()

0 commit comments

Comments
 (0)