Skip to content

Commit 6088d9f

Browse files
committed
tests/csdiff: separate subdir for csdiff tests
1 parent 5e2edda commit 6088d9f

File tree

181 files changed

+96
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+96
-77
lines changed

tests/CMakeLists.txt

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -35,38 +35,7 @@ endmacro()
3535

3636
set(test_cost 1048576)
3737

38-
# a generic template for a csdiff test-case
39-
macro(test_csdiff dir num)
40-
set(tst "${testdir}/${dir}/${num}")
41-
42-
set(cmd "${csdiff} -c ${tst}-old.err ${tst}-new.err")
43-
set(cmd "${cmd} | ${diffcmd} ${tst}-add.err -")
44-
add_test_wrap("${dir}-${num}-added" "${cmd}")
45-
46-
set(cmd "${csdiff} -x ${tst}-old.err ${tst}-new.err")
47-
set(cmd "${cmd} | ${csjson} | ${csgrep}")
48-
set(cmd "${cmd} | ${diffcmd} ${tst}-fix.err -")
49-
add_test_wrap("${dir}-${num}-fixed" "${cmd}")
50-
51-
set(cmd "${csdiff} -z ${tst}-old.err ${tst}-new.err")
52-
set(cmd "${cmd} | ${csjson} | ${csgrep}")
53-
set(cmd "${cmd} | ${diffcmd} ${tst}-add-z.err -")
54-
add_test_wrap("${dir}-${num}-added-with-z" "${cmd}")
55-
56-
set(cmd "${csdiff} -xz ${tst}-old.err ${tst}-new.err")
57-
set(cmd "${cmd} | ${csjson} | ${csgrep}")
58-
set(cmd "${cmd} | ${diffcmd} ${tst}-fix-z.err -")
59-
add_test_wrap("${dir}-${num}-fixed-with-z" "${cmd}")
60-
61-
set(cmd "${csdiff} -c ${tst}-old.err ${tst}-new.err")
62-
set(cmd "${cmd} | ${diffcmd} ${tst}-add.err -")
63-
add_test_wrap("${dir}-${num}-added-with-c" "${cmd}")
64-
65-
set(cmd "${csdiff} -jx ${tst}-old.err ${tst}-new.err")
66-
set(cmd "${cmd} | ${csgrep}")
67-
set(cmd "${cmd} | ${diffcmd} ${tst}-fix.err -")
68-
add_test_wrap("${dir}-${num}-fixed-with-j" "${cmd}")
69-
endmacro()
38+
add_subdirectory(csdiff)
7039

7140
# a generic template for csparser test-cases
7241
macro(test_csparser dir num)
@@ -193,35 +162,6 @@ test_cssort(cssort-5.8 02)
193162
test_cssort(cssort-5.8 03)
194163
test_cssort(cssort-misc 00)
195164

196-
# csdiff tests
197-
test_csdiff(diff5.9-kernel 00)
198-
test_csdiff(diff7.0-qt 00)
199-
test_csdiff(diff7.0-fftw 00)
200-
test_csdiff(diff7.0-sudo 00)
201-
test_csdiff(diff7.0-libssh 00)
202-
test_csdiff(diff7.0-icu 00)
203-
test_csdiff(diff7.0-virtuoso-opensource 00)
204-
test_csdiff(diff5.8-kernel 00)
205-
test_csdiff(diff6.4-iok 00)
206-
test_csdiff(diff6.4-rpm 00)
207-
test_csdiff(diff6.4-ksh 00)
208-
test_csdiff(diff6.4-samba4 00)
209-
test_csdiff(diff6.4-papi 00)
210-
test_csdiff(diff6.4-kernel 00)
211-
test_csdiff(diff8.0-ModemManager 00)
212-
test_csdiff(diff-misc 00)
213-
test_csdiff(diff-misc 01)
214-
test_csdiff(diff-misc 02)
215-
test_csdiff(diff-misc 03)
216-
test_csdiff(diff-misc 04)
217-
test_csdiff(diff-misc 05)
218-
test_csdiff(diff-misc 06)
219-
test_csdiff(diff-misc 07)
220-
test_csdiff(diff-misc 08)
221-
test_csdiff(diff-misc 09-shellcheck-raw)
222-
test_csdiff(diff-misc 10-pylint-copr)
223-
test_csdiff(diff-misc 11-pylint-copr-json)
224-
225165
# cstrans-df-run tests
226166
tests_cstrans_df_run(0001)
227167
tests_cstrans_df_run(0002)

tests/csdiff/CMakeLists.txt

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Copyright (C) 2011 - 2020 Red Hat, Inc.
2+
#
3+
# This file is part of csdiff.
4+
#
5+
# csdiff is free software: you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation, either version 3 of the License, or
8+
# any later version.
9+
#
10+
# csdiff is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with csdiff. If not, see <http://www.gnu.org/licenses/>.
17+
18+
# a generic template for a csdiff test-case
19+
macro(test_csdiff dir num)
20+
set(tst "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${num}")
21+
22+
set(cmd "${csdiff} -c ${tst}-old.err ${tst}-new.err")
23+
set(cmd "${cmd} | ${diffcmd} ${tst}-add.err -")
24+
add_test_wrap("${dir}-${num}-added" "${cmd}")
25+
26+
set(cmd "${csdiff} -x ${tst}-old.err ${tst}-new.err")
27+
set(cmd "${cmd} | ${csjson} | ${csgrep}")
28+
set(cmd "${cmd} | ${diffcmd} ${tst}-fix.err -")
29+
add_test_wrap("${dir}-${num}-fixed" "${cmd}")
30+
31+
set(cmd "${csdiff} -z ${tst}-old.err ${tst}-new.err")
32+
set(cmd "${cmd} | ${csjson} | ${csgrep}")
33+
set(cmd "${cmd} | ${diffcmd} ${tst}-add-z.err -")
34+
add_test_wrap("${dir}-${num}-added-with-z" "${cmd}")
35+
36+
set(cmd "${csdiff} -xz ${tst}-old.err ${tst}-new.err")
37+
set(cmd "${cmd} | ${csjson} | ${csgrep}")
38+
set(cmd "${cmd} | ${diffcmd} ${tst}-fix-z.err -")
39+
add_test_wrap("${dir}-${num}-fixed-with-z" "${cmd}")
40+
41+
set(cmd "${csdiff} -c ${tst}-old.err ${tst}-new.err")
42+
set(cmd "${cmd} | ${diffcmd} ${tst}-add.err -")
43+
add_test_wrap("${dir}-${num}-added-with-c" "${cmd}")
44+
45+
set(cmd "${csdiff} -jx ${tst}-old.err ${tst}-new.err")
46+
set(cmd "${cmd} | ${csgrep}")
47+
set(cmd "${cmd} | ${diffcmd} ${tst}-fix.err -")
48+
add_test_wrap("${dir}-${num}-fixed-with-j" "${cmd}")
49+
endmacro()
50+
51+
# csdiff tests
52+
test_csdiff(diff5.9-kernel 00)
53+
test_csdiff(diff7.0-qt 00)
54+
test_csdiff(diff7.0-fftw 00)
55+
test_csdiff(diff7.0-sudo 00)
56+
test_csdiff(diff7.0-libssh 00)
57+
test_csdiff(diff7.0-icu 00)
58+
test_csdiff(diff7.0-virtuoso-opensource 00)
59+
test_csdiff(diff5.8-kernel 00)
60+
test_csdiff(diff6.4-iok 00)
61+
test_csdiff(diff6.4-rpm 00)
62+
test_csdiff(diff6.4-ksh 00)
63+
test_csdiff(diff6.4-samba4 00)
64+
test_csdiff(diff6.4-papi 00)
65+
test_csdiff(diff6.4-kernel 00)
66+
test_csdiff(diff8.0-ModemManager 00)
67+
test_csdiff(diff-misc 00)
68+
test_csdiff(diff-misc 01)
69+
test_csdiff(diff-misc 02)
70+
test_csdiff(diff-misc 03)
71+
test_csdiff(diff-misc 04)
72+
test_csdiff(diff-misc 05)
73+
test_csdiff(diff-misc 06)
74+
test_csdiff(diff-misc 07)
75+
test_csdiff(diff-misc 08)
76+
test_csdiff(diff-misc 09-shellcheck-raw)
77+
test_csdiff(diff-misc 10-pylint-copr)
78+
test_csdiff(diff-misc 11-pylint-copr-json)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)