File tree 3 files changed +58
-5
lines changed
3 files changed +58
-5
lines changed Original file line number Diff line number Diff line change 41
41
- name : Test
42
42
working-directory : ${{ github.workspace }}
43
43
run : |
44
- echo "TODO"
44
+ cd build
45
+ make test
45
46
46
47
test-on-ubuntu-2004 :
47
48
name : test-on-ubuntu-20.04
72
73
- name : Test
73
74
working-directory : ${{ github.workspace }}
74
75
run : |
75
- echo "TODO"
76
+ cd build
77
+ make test
76
78
77
79
test-on-ubuntu-1804 :
78
80
name : test-on-ubuntu-18.04
@@ -103,7 +105,8 @@ jobs:
103
105
- name : Test
104
106
working-directory : ${{ github.workspace }}
105
107
run : |
106
- echo "TODO"
108
+ cd build
109
+ make test
107
110
108
111
test-on-centos-792009 :
109
112
name : test-on-centos-7.9.2009
@@ -133,7 +136,8 @@ jobs:
133
136
- name : Test
134
137
working-directory : ${{ github.workspace }}
135
138
run : |
136
- echo "TODO"
139
+ cd build
140
+ make test
137
141
138
142
test-on-centos-731611 :
139
143
name : test-on-centos-7.3.1611
@@ -163,4 +167,5 @@ jobs:
163
167
- name : Test
164
168
working-directory : ${{ github.workspace }}
165
169
run : |
166
- echo "TODO"
170
+ cd build
171
+ make test
Original file line number Diff line number Diff line change @@ -101,3 +101,7 @@ INSTALL(TARGETS qlibc LIBRARY DESTINATION lib)
101
101
INSTALL (TARGETS qlibcext LIBRARY DESTINATION lib)
102
102
INSTALL (TARGETS qlibc-static ARCHIVE DESTINATION lib)
103
103
INSTALL (TARGETS qlibcext-static ARCHIVE DESTINATION lib)
104
+
105
+ # add test
106
+ ENABLE_TESTING ()
107
+ ADD_SUBDIRECTORY (${qlibc_SOURCE_DIR} /tests)
Original file line number Diff line number Diff line change
1
+ INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR} /include /qlibc)
2
+ SET (test_list
3
+ test_qstring
4
+ test_qhashtbl
5
+ test_qhasharr
6
+ test_qhasharr_darkdh
7
+ test_qtreetbl
8
+ test_qlist
9
+ test_qvector
10
+ test_qqueue
11
+ test_qstack
12
+ test_qhash
13
+ )
14
+
15
+ SET (test_file_list
16
+ test_qhash_data_1.bin
17
+ test_qhash_data_2.bin
18
+ test_qhash_data_3.bin
19
+ test_qhash_data_4.bin
20
+ )
21
+
22
+ # build test
23
+ FOREACH (element IN LISTS test_list)
24
+ MESSAGE (STATUS "set build test: ${element} " )
25
+ ADD_EXECUTABLE (${element} ${element} .c)
26
+ TARGET_LINK_LIBRARIES (${element} qlibc qlibcext)
27
+ ENDFOREACH ()
28
+
29
+ # copy test file
30
+ FOREACH (element IN LISTS test_file_list)
31
+ ADD_CUSTOM_TARGET (cpoy_${element} ALL
32
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
33
+ ${CMAKE_CURRENT_SOURCE_DIR} /${element}
34
+ ${CMAKE_CURRENT_BINARY_DIR} /${element}
35
+ COMMENT "Copying ${element} to ${CMAKE_CURRENT_BINARY_DIR} "
36
+ VERBATIM
37
+ )
38
+ ENDFOREACH ()
39
+
40
+ # run test
41
+ FOREACH (element IN LISTS test_list)
42
+ MESSAGE (STATUS "set run test: ${element} " )
43
+ ADD_TEST (NAME ${element} COMMAND ${CMAKE_CURRENT_SOURCE_DIR} /launcher.sh ${element} )
44
+ ENDFOREACH ()
You can’t perform that action at this time.
0 commit comments