16d76f469SSteven Rostedt# patchcheck.conf 26d76f469SSteven Rostedt# 36d76f469SSteven Rostedt# This contains a test that takes two git commits and will test each 46d76f469SSteven Rostedt# commit between the two. The build test will look at what files the 56d76f469SSteven Rostedt# commit has touched, and if any of those files produce a warning, then 66d76f469SSteven Rostedt# the build will fail. 76d76f469SSteven Rostedt 86d76f469SSteven Rostedt 96d76f469SSteven Rostedt# PATCH_START is the commit to begin with and PATCH_END is the commit 106d76f469SSteven Rostedt# to end with (inclusive). This is similar to doing a git rebase -i PATCH_START~1 116d76f469SSteven Rostedt# and then testing each commit and doing a git rebase --continue. 126d76f469SSteven Rostedt# You can use a SHA1, a git tag, or anything that git will accept for a checkout 136d76f469SSteven Rostedt 146d76f469SSteven RostedtPATCH_START := HEAD~3 156d76f469SSteven RostedtPATCH_END := HEAD 166d76f469SSteven Rostedt 17*4283b169SSteven Rostedt (Red Hat)# Use the oldconfig if build_type wasn't defined 18*4283b169SSteven Rostedt (Red Hat)DEFAULTS IF NOT DEFINED BUILD_TYPE 19*4283b169SSteven Rostedt (Red Hat)DO_BUILD_TYPE := oldconfig 20*4283b169SSteven Rostedt (Red Hat) 21*4283b169SSteven Rostedt (Red Hat)DEFAULTS ELSE 22*4283b169SSteven Rostedt (Red Hat)DO_BUILD_TYPE := ${BUILD_TYPE} 23*4283b169SSteven Rostedt (Red Hat) 24*4283b169SSteven Rostedt (Red Hat)DEFAULTS 25*4283b169SSteven Rostedt (Red Hat) 26*4283b169SSteven Rostedt (Red Hat) 276d76f469SSteven Rostedt# Change PATCH_CHECKOUT to be the branch you want to test. The test will 286d76f469SSteven Rostedt# do a git checkout of this branch before starting. Obviously both 296d76f469SSteven Rostedt# PATCH_START and PATCH_END must be in this branch (and PATCH_START must 306d76f469SSteven Rostedt# be contained by PATCH_END). 316d76f469SSteven Rostedt 326d76f469SSteven RostedtPATCH_CHECKOUT := test/branch 336d76f469SSteven Rostedt 346d76f469SSteven Rostedt# Usually it's a good idea to have a set config to use for testing individual 356d76f469SSteven Rostedt# patches. 366d76f469SSteven RostedtPATCH_CONFIG := ${CONFIG_DIR}/config-patchcheck 376d76f469SSteven Rostedt 386d76f469SSteven Rostedt# Change PATCH_TEST to run some test for each patch. Each commit that is 396d76f469SSteven Rostedt# tested, after it is built and installed on the test machine, this command 406d76f469SSteven Rostedt# will be executed. Usually what is done is to ssh to the target box and 416d76f469SSteven Rostedt# run some test scripts. If you just want to boot test your patches 426d76f469SSteven Rostedt# comment PATCH_TEST out. 436d76f469SSteven RostedtPATCH_TEST := ${SSH} "/usr/local/bin/ktest-test-script" 446d76f469SSteven Rostedt 456d76f469SSteven RostedtDEFAULTS IF DEFINED PATCH_TEST 466d76f469SSteven RostedtPATCH_TEST_TYPE := test 476d76f469SSteven Rostedt 486d76f469SSteven RostedtDEFAULTS ELSE 496d76f469SSteven RostedtPATCH_TEST_TYPE := boot 506d76f469SSteven Rostedt 516d76f469SSteven Rostedt# If for some reason a file has a warning that one of your patches touch 526d76f469SSteven Rostedt# but you do not care about it, set IGNORE_WARNINGS to that commit(s) 536d76f469SSteven Rostedt# (space delimited) 546d76f469SSteven Rostedt#IGNORE_WARNINGS = 39eaf7ef884dcc44f7ff1bac803ca2a1dcf43544 6edb2a8a385f0cdef51dae37ff23e74d76d8a6ce 556d76f469SSteven Rostedt 56*4283b169SSteven Rostedt (Red Hat)# Instead of just checking for warnings to files that are changed 57*4283b169SSteven Rostedt (Red Hat)# it can be advantageous to check for any new warnings. If a 58*4283b169SSteven Rostedt (Red Hat)# header file is changed, it could cause a warning in a file not 59*4283b169SSteven Rostedt (Red Hat)# touched by the commit. To detect these kinds of warnings, you 60*4283b169SSteven Rostedt (Red Hat)# can use the WARNINGS_FILE option. 61*4283b169SSteven Rostedt (Red Hat)# 62*4283b169SSteven Rostedt (Red Hat)# If the variable CREATE_WARNINGS_FILE is set, this config will 63*4283b169SSteven Rostedt (Red Hat)# enable the WARNINGS_FILE during the patchcheck test. Also, 64*4283b169SSteven Rostedt (Red Hat)# before running the patchcheck test, it will create the 65*4283b169SSteven Rostedt (Red Hat)# warnings file. 66*4283b169SSteven Rostedt (Red Hat)# 67*4283b169SSteven Rostedt (Red Hat)DEFAULTS IF DEFINED CREATE_WARNINGS_FILE 68*4283b169SSteven Rostedt (Red Hat)WARNINGS_FILE = ${OUTPUT_DIR}/warnings_file 69*4283b169SSteven Rostedt (Red Hat) 70*4283b169SSteven Rostedt (Red Hat)TEST_START IF DEFINED CREATE_WARNINGS_FILE 71*4283b169SSteven Rostedt (Red Hat)# WARNINGS_FILE is already set by the DEFAULTS above 72*4283b169SSteven Rostedt (Red Hat)TEST_TYPE = make_warnings_file 73*4283b169SSteven Rostedt (Red Hat)# Checkout the commit before the patches to test, 74*4283b169SSteven Rostedt (Red Hat)# and record all the warnings that exist before the patches 75*4283b169SSteven Rostedt (Red Hat)# to test are added 76*4283b169SSteven Rostedt (Red Hat)CHECKOUT = ${PATCHCHECK_START}~1 77*4283b169SSteven Rostedt (Red Hat)# Force a full build 78*4283b169SSteven Rostedt (Red Hat)BUILD_NOCLEAN = 0 79*4283b169SSteven Rostedt (Red Hat)BUILD_TYPE = ${DO_BUILD_TYPE} 80*4283b169SSteven Rostedt (Red Hat) 816d76f469SSteven Rostedt# If you are running a multi test, and the test failed on the first 826d76f469SSteven Rostedt# test but on, say the 5th patch. If you want to restart on the 836d76f469SSteven Rostedt# fifth patch, set PATCH_START1. This will make the first test start 846d76f469SSteven Rostedt# from this commit instead of the PATCH_START commit. 856d76f469SSteven Rostedt# Note, do not change this option. Just define PATCH_START1 in the 866d76f469SSteven Rostedt# top config (the one you pass to ktest.pl), and this will use it, 876d76f469SSteven Rostedt# otherwise it will just use PATCH_START if PATCH_START1 is not defined. 886d76f469SSteven RostedtDEFAULTS IF NOT DEFINED PATCH_START1 896d76f469SSteven RostedtPATCH_START1 := ${PATCH_START} 906d76f469SSteven Rostedt 916d76f469SSteven RostedtTEST_START IF ${TEST} == patchcheck 926d76f469SSteven RostedtTEST_TYPE = patchcheck 936d76f469SSteven RostedtMIN_CONFIG = ${PATCH_CONFIG} 946d76f469SSteven RostedtTEST = ${PATCH_TEST} 956d76f469SSteven RostedtPATCHCHECK_TYPE = ${PATCH_TEST_TYPE} 966d76f469SSteven RostedtPATCHCHECK_START = ${PATCH_START1} 976d76f469SSteven RostedtPATCHCHECK_END = ${PATCH_END} 986d76f469SSteven RostedtCHECKOUT = ${PATCH_CHECKOUT} 99*4283b169SSteven Rostedt (Red Hat)BUILD_TYPE = ${DO_BUILD_TYPE} 1006d76f469SSteven Rostedt 1016d76f469SSteven RostedtTEST_START IF ${TEST} == patchcheck && ${MULTI} 1026d76f469SSteven RostedtTEST_TYPE = patchcheck 1036d76f469SSteven RostedtMIN_CONFIG = ${PATCH_CONFIG} 1046d76f469SSteven RostedtTEST = ${PATCH_TEST} 1056d76f469SSteven RostedtPATCHCHECK_TYPE = ${PATCH_TEST_TYPE} 1066d76f469SSteven RostedtPATCHCHECK_START = ${PATCH_START} 1076d76f469SSteven RostedtPATCHCHECK_END = ${PATCH_END} 1086d76f469SSteven RostedtCHECKOUT = ${PATCH_CHECKOUT} 1096d76f469SSteven Rostedt# Use multi to test different compilers? 1106d76f469SSteven RostedtMAKE_CMD = CC=gcc-4.5.1 make 111*4283b169SSteven Rostedt (Red Hat)BUILD_TYPE = ${DO_BUILD_TYPE} 112