xref: /OK3568_Linux_fs/kernel/tools/testing/ktest/examples/include/patchcheck.conf (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# patchcheck.conf
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# This contains a test that takes two git commits and will test each
4*4882a593Smuzhiyun# commit between the two. The build test will look at what files the
5*4882a593Smuzhiyun# commit has touched, and if any of those files produce a warning, then
6*4882a593Smuzhiyun# the build will fail.
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun# PATCH_START is the commit to begin with and PATCH_END is the commit
10*4882a593Smuzhiyun# to end with (inclusive). This is similar to doing a git rebase -i PATCH_START~1
11*4882a593Smuzhiyun# and then testing each commit and doing a git rebase --continue.
12*4882a593Smuzhiyun# You can use a SHA1, a git tag, or anything that git will accept for a checkout
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunPATCH_START := HEAD~3
15*4882a593SmuzhiyunPATCH_END := HEAD
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun# Use the oldconfig if build_type wasn't defined
18*4882a593SmuzhiyunDEFAULTS IF NOT DEFINED BUILD_TYPE
19*4882a593SmuzhiyunDO_BUILD_TYPE := oldconfig
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunDEFAULTS ELSE
22*4882a593SmuzhiyunDO_BUILD_TYPE := ${BUILD_TYPE}
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunDEFAULTS
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun# Change PATCH_CHECKOUT to be the branch you want to test. The test will
28*4882a593Smuzhiyun# do a git checkout of this branch before starting. Obviously both
29*4882a593Smuzhiyun# PATCH_START and PATCH_END must be in this branch (and PATCH_START must
30*4882a593Smuzhiyun# be contained by PATCH_END).
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunPATCH_CHECKOUT := test/branch
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun# Usually it's a good idea to have a set config to use for testing individual
35*4882a593Smuzhiyun# patches.
36*4882a593SmuzhiyunPATCH_CONFIG := ${CONFIG_DIR}/config-patchcheck
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun# Change PATCH_TEST to run some test for each patch. Each commit that is
39*4882a593Smuzhiyun# tested, after it is built and installed on the test machine, this command
40*4882a593Smuzhiyun# will be executed. Usually what is done is to ssh to the target box and
41*4882a593Smuzhiyun# run some test scripts. If you just want to boot test your patches
42*4882a593Smuzhiyun# comment PATCH_TEST out.
43*4882a593SmuzhiyunPATCH_TEST := ${SSH} "/usr/local/bin/ktest-test-script"
44*4882a593Smuzhiyun
45*4882a593SmuzhiyunDEFAULTS IF DEFINED PATCH_TEST
46*4882a593SmuzhiyunPATCH_TEST_TYPE := test
47*4882a593Smuzhiyun
48*4882a593SmuzhiyunDEFAULTS ELSE
49*4882a593SmuzhiyunPATCH_TEST_TYPE := boot
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun# If for some reason a file has a warning that one of your patches touch
52*4882a593Smuzhiyun# but you do not care about it, set IGNORE_WARNINGS to that commit(s)
53*4882a593Smuzhiyun# (space delimited)
54*4882a593Smuzhiyun#IGNORE_WARNINGS = 39eaf7ef884dcc44f7ff1bac803ca2a1dcf43544 6edb2a8a385f0cdef51dae37ff23e74d76d8a6ce
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun# Instead of just checking for warnings to files that are changed
57*4882a593Smuzhiyun# it can be advantageous to check for any new warnings. If a
58*4882a593Smuzhiyun# header file is changed, it could cause a warning in a file not
59*4882a593Smuzhiyun# touched by the commit. To detect these kinds of warnings, you
60*4882a593Smuzhiyun# can use the WARNINGS_FILE option.
61*4882a593Smuzhiyun#
62*4882a593Smuzhiyun# If the variable CREATE_WARNINGS_FILE is set, this config will
63*4882a593Smuzhiyun# enable the WARNINGS_FILE during the patchcheck test. Also,
64*4882a593Smuzhiyun# before running the patchcheck test, it will create the
65*4882a593Smuzhiyun# warnings file.
66*4882a593Smuzhiyun#
67*4882a593SmuzhiyunDEFAULTS IF DEFINED CREATE_WARNINGS_FILE
68*4882a593SmuzhiyunWARNINGS_FILE = ${OUTPUT_DIR}/warnings_file
69*4882a593Smuzhiyun
70*4882a593SmuzhiyunTEST_START IF DEFINED CREATE_WARNINGS_FILE
71*4882a593Smuzhiyun# WARNINGS_FILE is already set by the DEFAULTS above
72*4882a593SmuzhiyunTEST_TYPE = make_warnings_file
73*4882a593Smuzhiyun# Checkout the commit before the patches to test,
74*4882a593Smuzhiyun# and record all the warnings that exist before the patches
75*4882a593Smuzhiyun# to test are added
76*4882a593SmuzhiyunCHECKOUT = ${PATCHCHECK_START}~1
77*4882a593Smuzhiyun# Force a full build
78*4882a593SmuzhiyunBUILD_NOCLEAN = 0
79*4882a593SmuzhiyunBUILD_TYPE = ${DO_BUILD_TYPE}
80*4882a593Smuzhiyun
81*4882a593Smuzhiyun# If you are running a multi test, and the test failed on the first
82*4882a593Smuzhiyun# test but on, say the 5th patch. If you want to restart on the
83*4882a593Smuzhiyun# fifth patch, set PATCH_START1. This will make the first test start
84*4882a593Smuzhiyun# from this commit instead of the PATCH_START commit.
85*4882a593Smuzhiyun# Note, do not change this option. Just define PATCH_START1 in the
86*4882a593Smuzhiyun# top config (the one you pass to ktest.pl), and this will use it,
87*4882a593Smuzhiyun# otherwise it will just use PATCH_START if PATCH_START1 is not defined.
88*4882a593SmuzhiyunDEFAULTS IF NOT DEFINED PATCH_START1
89*4882a593SmuzhiyunPATCH_START1 := ${PATCH_START}
90*4882a593Smuzhiyun
91*4882a593SmuzhiyunTEST_START IF ${TEST} == patchcheck
92*4882a593SmuzhiyunTEST_TYPE = patchcheck
93*4882a593SmuzhiyunMIN_CONFIG = ${PATCH_CONFIG}
94*4882a593SmuzhiyunTEST = ${PATCH_TEST}
95*4882a593SmuzhiyunPATCHCHECK_TYPE = ${PATCH_TEST_TYPE}
96*4882a593SmuzhiyunPATCHCHECK_START = ${PATCH_START1}
97*4882a593SmuzhiyunPATCHCHECK_END = ${PATCH_END}
98*4882a593SmuzhiyunCHECKOUT = ${PATCH_CHECKOUT}
99*4882a593SmuzhiyunBUILD_TYPE = ${DO_BUILD_TYPE}
100*4882a593Smuzhiyun
101*4882a593SmuzhiyunTEST_START IF ${TEST} == patchcheck && ${MULTI}
102*4882a593SmuzhiyunTEST_TYPE = patchcheck
103*4882a593SmuzhiyunMIN_CONFIG = ${PATCH_CONFIG}
104*4882a593SmuzhiyunTEST = ${PATCH_TEST}
105*4882a593SmuzhiyunPATCHCHECK_TYPE = ${PATCH_TEST_TYPE}
106*4882a593SmuzhiyunPATCHCHECK_START = ${PATCH_START}
107*4882a593SmuzhiyunPATCHCHECK_END = ${PATCH_END}
108*4882a593SmuzhiyunCHECKOUT = ${PATCH_CHECKOUT}
109*4882a593Smuzhiyun# Use multi to test different compilers?
110*4882a593SmuzhiyunMAKE_CMD = CC=gcc-4.5.1 make
111*4882a593SmuzhiyunBUILD_TYPE = ${DO_BUILD_TYPE}
112