18c2ecf20Sopenharmony_ci#
28c2ecf20Sopenharmony_ci# This example shows the bisect tests (git bisect and config bisect)
38c2ecf20Sopenharmony_ci#
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci# The config that includes this file may define a RUN_TEST
78c2ecf20Sopenharmony_ci# variable that will tell this config what test to run.
88c2ecf20Sopenharmony_ci# (what to set the TEST option to).
98c2ecf20Sopenharmony_ci#
108c2ecf20Sopenharmony_ciDEFAULTS IF NOT DEFINED RUN_TEST
118c2ecf20Sopenharmony_ci# Requires that hackbench is in the PATH
128c2ecf20Sopenharmony_ciRUN_TEST := ${SSH} hackbench 50
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci# Set TEST to 'bisect' to do a normal git bisect. You need
168c2ecf20Sopenharmony_ci# to modify the options below to make it bisect the exact
178c2ecf20Sopenharmony_ci# commits you are interested in.
188c2ecf20Sopenharmony_ci#
198c2ecf20Sopenharmony_ciTEST_START IF ${TEST} == bisect
208c2ecf20Sopenharmony_ciTEST_TYPE = bisect
218c2ecf20Sopenharmony_ci# You must set the commit that was considered good (git bisect good)
228c2ecf20Sopenharmony_ciBISECT_GOOD = v3.3
238c2ecf20Sopenharmony_ci# You must set the commit that was considered bad (git bisect bad)
248c2ecf20Sopenharmony_ciBISECT_BAD = HEAD
258c2ecf20Sopenharmony_ci# It's best to specify the branch to checkout before starting the bisect.
268c2ecf20Sopenharmony_ciCHECKOUT = origin/master
278c2ecf20Sopenharmony_ci# This can be build, boot, or test. Here we are doing a bisect
288c2ecf20Sopenharmony_ci# that requires to run a test to know if the bisect was good or bad.
298c2ecf20Sopenharmony_ci# The test should exit with 0 on good, non-zero for bad. But see
308c2ecf20Sopenharmony_ci# the BISECT_RET_* options in samples.conf to override this.
318c2ecf20Sopenharmony_ciBISECT_TYPE = test
328c2ecf20Sopenharmony_ciTEST = ${RUN_TEST}
338c2ecf20Sopenharmony_ci# It is usually a good idea to confirm that the GOOD and the BAD
348c2ecf20Sopenharmony_ci# commits are truly good and bad respectively. Having BISECT_CHECK
358c2ecf20Sopenharmony_ci# set to 1 will check both that the good commit works and the bad
368c2ecf20Sopenharmony_ci# commit fails. If you only want to check one or the other,
378c2ecf20Sopenharmony_ci# set BISECT_CHECK to 'good' or to 'bad'.
388c2ecf20Sopenharmony_ciBISECT_CHECK = 1
398c2ecf20Sopenharmony_ci#BISECT_CHECK = good
408c2ecf20Sopenharmony_ci#BISECT_CHECK = bad
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci# Usually it's a good idea to specify the exact config you
438c2ecf20Sopenharmony_ci# want to use throughout the entire bisect. Here we placed
448c2ecf20Sopenharmony_ci# it in the directory we called ktest.pl from and named it
458c2ecf20Sopenharmony_ci# 'config-bisect'.
468c2ecf20Sopenharmony_ciMIN_CONFIG = ${THIS_DIR}/config-bisect
478c2ecf20Sopenharmony_ci# By default, if we are doing a BISECT_TYPE = test run but the
488c2ecf20Sopenharmony_ci# build or boot fails, ktest.pl will do a 'git bisect skip'.
498c2ecf20Sopenharmony_ci# Uncomment the below option to make ktest stop testing on such
508c2ecf20Sopenharmony_ci# an error.
518c2ecf20Sopenharmony_ci#BISECT_SKIP = 0
528c2ecf20Sopenharmony_ci# Now if you had BISECT_SKIP = 0 and the test fails, you can
538c2ecf20Sopenharmony_ci# examine what happened and then do 'git bisect log > /tmp/replay'
548c2ecf20Sopenharmony_ci# Set BISECT_REPLAY to /tmp/replay and ktest.pl will run the
558c2ecf20Sopenharmony_ci# 'git bisect replay /tmp/replay' before continuing the bisect test.
568c2ecf20Sopenharmony_ci#BISECT_REPLAY = /tmp/replay
578c2ecf20Sopenharmony_ci# If you used BISECT_REPLAY after the bisect test failed, you may
588c2ecf20Sopenharmony_ci# not want to continue the bisect on that commit that failed.
598c2ecf20Sopenharmony_ci# By setting BISECT_START to a new commit. ktest.pl will checkout
608c2ecf20Sopenharmony_ci# that commit after it has performed the 'git bisect replay' but
618c2ecf20Sopenharmony_ci# before it continues running the bisect test.
628c2ecf20Sopenharmony_ci#BISECT_START = 2545eb6198e7e1ec50daa0cfc64a4cdfecf24ec9
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci# Now if you don't trust ktest.pl to make the decisions for you, then
658c2ecf20Sopenharmony_ci# set BISECT_MANUAL to 1. This will cause ktest.pl not to decide
668c2ecf20Sopenharmony_ci# if the commit was good or bad. Instead, it will ask you to tell
678c2ecf20Sopenharmony_ci# it if the current commit was good. In the mean time, you could
688c2ecf20Sopenharmony_ci# take the result, load it on any machine you want. Run several tests,
698c2ecf20Sopenharmony_ci# or whatever you feel like. Then, when you are happy, you can tell
708c2ecf20Sopenharmony_ci# ktest if you think it was good or not and ktest.pl will continue
718c2ecf20Sopenharmony_ci# the git bisect. You can even change what commit it is currently at.
728c2ecf20Sopenharmony_ci#BISECT_MANUAL = 1
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci# One of the unique tests that ktest does is the config bisect.
768c2ecf20Sopenharmony_ci# Currently (which hopefully will be fixed soon), the bad config
778c2ecf20Sopenharmony_ci# must be a superset of the good config. This is because it only
788c2ecf20Sopenharmony_ci# searches for a config that causes the target to fail. If the
798c2ecf20Sopenharmony_ci# good config is not a subset of the bad config, or if the target
808c2ecf20Sopenharmony_ci# fails because of a lack of a config, then it will not find
818c2ecf20Sopenharmony_ci# the config for you.
828c2ecf20Sopenharmony_ciTEST_START IF ${TEST} == config-bisect
838c2ecf20Sopenharmony_ciTEST_TYPE = config_bisect
848c2ecf20Sopenharmony_ci# set to build, boot, test
858c2ecf20Sopenharmony_ciCONFIG_BISECT_TYPE = boot
868c2ecf20Sopenharmony_ci# Set the config that is considered bad.
878c2ecf20Sopenharmony_ciCONFIG_BISECT = ${THIS_DIR}/config-bad
888c2ecf20Sopenharmony_ci# This config is optional. By default it uses the
898c2ecf20Sopenharmony_ci# MIN_CONFIG as the good config.
908c2ecf20Sopenharmony_ciCONFIG_BISECT_GOOD = ${THIS_DIR}/config-good
91