Mercurial > irccd
annotate tests/CMakeLists.txt @ 1195:43e3f7a4045b release-4.0 4.0.4
misc: update before 4.0.4
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 03 Aug 2023 21:24:10 +0200 |
parents | f06e9761cc90 |
children | 1845a0509a93 |
rev | line source |
---|---|
1098
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
1 # |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
2 # CMakeLists.txt -- CMake build system for irccd |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
3 # |
1136
f06e9761cc90
misc: update copyright years
David Demelier <markand@malikania.fr>
parents:
1114
diff
changeset
|
4 # Copyright (c) 2013-2022 David Demelier <markand@malikania.fr> |
1098
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
5 # |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
6 # Permission to use, copy, modify, and/or distribute this software for any |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
7 # purpose with or without fee is hereby granted, provided that the above |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
8 # copyright notice and this permission notice appear in all copies. |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
9 # |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
17 # |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
18 |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
19 project(tests) |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
20 |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
21 set( |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
22 TESTS |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
23 bot |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
24 channel |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
25 dl-plugin |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
26 event |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
27 log |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
28 rule |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
29 subst |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
30 util |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
31 ) |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
32 |
1114
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
33 if (IRCCD_WITH_JS) |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
34 list( |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
35 APPEND TESTS |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
36 jsapi-chrono |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
37 jsapi-directory |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
38 jsapi-file |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
39 jsapi-irccd |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
40 jsapi-system |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
41 jsapi-timer |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
42 jsapi-unicode |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
43 jsapi-util |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
44 plugin-ask |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
45 plugin-auth |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
46 plugin-hangman |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
47 plugin-history |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
48 plugin-joke |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
49 plugin-logger |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
50 plugin-plugin |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
51 plugin-tictactoe |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
52 ) |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
53 endif () |
cda2076a7ece
misc: fix build without javascript
David Demelier <markand@malikania.fr>
parents:
1104
diff
changeset
|
54 |
1098
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
55 foreach (t ${TESTS}) |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
56 add_executable(test-${t} ${tests_SOURCE_DIR}/test-${t}.c) |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
57 add_test(NAME test-${t} COMMAND test-${t}) |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
58 set_target_properties(test-${t} PROPERTIES FOLDER tests ENABLE_EXPORTS On) |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
59 target_link_libraries(test-${t} irccd-static libirccd-greatest) |
1104
4d1bf796c005
tests: fix jsapi-system test
David Demelier <markand@malikania.fr>
parents:
1098
diff
changeset
|
60 target_compile_definitions( |
4d1bf796c005
tests: fix jsapi-system test
David Demelier <markand@malikania.fr>
parents:
1098
diff
changeset
|
61 test-${t} |
4d1bf796c005
tests: fix jsapi-system test
David Demelier <markand@malikania.fr>
parents:
1098
diff
changeset
|
62 PRIVATE |
4d1bf796c005
tests: fix jsapi-system test
David Demelier <markand@malikania.fr>
parents:
1098
diff
changeset
|
63 TOP="${CMAKE_SOURCE_DIR}" |
4d1bf796c005
tests: fix jsapi-system test
David Demelier <markand@malikania.fr>
parents:
1098
diff
changeset
|
64 IRCCD_EXECUTABLE="$<TARGET_FILE:irccd>" |
4d1bf796c005
tests: fix jsapi-system test
David Demelier <markand@malikania.fr>
parents:
1098
diff
changeset
|
65 ) |
1098
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
66 endforeach () |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
67 |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
68 # |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
69 # Test: dl-plugin |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
70 # |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
71 # We need a sample plugin to open. |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
72 # |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
73 add_library(plugin-dl-example MODULE ${tests_SOURCE_DIR}/data/example-dl-plugin.c) |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
74 add_dependencies(test-dl-plugin plugin-dl-example) |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
75 set_target_properties(plugin-dl-example PROPERTIES PREFIX "" FOLDER tests) |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
76 target_compile_definitions(test-dl-plugin PRIVATE EXAMPLE_DL_PLUGIN="$<TARGET_FILE:plugin-dl-example>") |
6c15d37b7518
cmake: switch back to CMake because of portability issues
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
77 target_link_libraries(plugin-dl-example irccd) |