summaryrefslogtreecommitdiff
blob: 4fdb08fc0288b18104fdb1a5d6d753b29b34b6c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
commit dec4afb4145b1c9ccfe3474e26a86716f597910d
Author: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
Date:   Tue Aug 8 22:33:08 2017 +0200

    Use ecm_add_test and benefit from BUILD_TESTING awareness
    
    Reviewers: #frameworks, kfunk
    
    Reviewed By: kfunk
    
    Subscribers: kfunk
    
    Tags: #frameworks
    
    Differential Revision: https://phabricator.kde.org/D7213

diff --git a/src/ioslaves/trash/tests/CMakeLists.txt b/src/ioslaves/trash/tests/CMakeLists.txt
index 7adba49b..514fd79c 100644
--- a/src/ioslaves/trash/tests/CMakeLists.txt
+++ b/src/ioslaves/trash/tests/CMakeLists.txt
@@ -11,21 +11,16 @@ set(testtrash_SRCS
     ${CMAKE_CURRENT_SOURCE_DIR}/../kiotrashdebug.cpp
 )
 
-add_executable(testtrash ${testtrash_SRCS})
-ecm_mark_as_test(testtrash)
-add_test(NAME testtrash COMMAND testtrash)
-
-target_link_libraries(testtrash
-   KF5::I18n
-   Qt5::DBus
-   KF5::KIOCore
-   KF5::Solid
-   Qt5::Test
-)
 if(APPLE)
-    target_link_libraries(testtrash "-framework DiskArbitration -framework CoreFoundation")
+    set(testtrash_APPLE_LIBS "-framework DiskArbitration -framework CoreFoundation")
 endif(APPLE)
-ecm_mark_nongui_executable(testtrash)
+
+include(ECMAddTests)
+
+ecm_add_test(${testtrash_SRCS}
+    TEST_NAME testtrash
+    LINK_LIBRARIES KF5::I18n Qt5::DBus KF5::KIOCore KF5::Solid Qt5::Test ${testtrash_APPLE_LIBS}
+)
 
 ### next target ###