diff --git a/scripts/sanitycheck b/scripts/sanitycheck index 017a7f6b70b..0bd303e4077 100755 --- a/scripts/sanitycheck +++ b/scripts/sanitycheck @@ -30,6 +30,10 @@ Each testcase.ini block can define the following key/value pairs: run under certain circumstances, like daily builds. These test cases are still compiled. + kernel = + Specify the kernel being tested instead of relying on parsing + Makefile for KERNEL_TYPE + extra_args = Extra arguments to pass to Make when building or running the test case. @@ -725,6 +729,7 @@ testcase_valid_keys = {"tags" : {"type" : "set", "required" : True}, "skip" : {"type" : "bool", "default" : False}, "slow" : {"type" : "bool", "default" : False}, "timeout" : {"type" : "int", "default" : 60}, + "kernel" : {"type": "str", "required" : False}, "arch_whitelist" : {"type" : "set"}, "arch_exclude" : {"type" : "set"}, "platform_exclude" : {"type" : "set"}, @@ -968,6 +973,7 @@ class TestCase: self.arch_whitelist = tc_dict["arch_whitelist"] self.arch_exclude = tc_dict["arch_exclude"] self.skip = tc_dict["skip"] + self.kernel = tc_dict["kernel"] self.platform_exclude = tc_dict["platform_exclude"] self.platform_whitelist = tc_dict["platform_whitelist"] self.config_whitelist = tc_dict["config_whitelist"] @@ -976,18 +982,21 @@ class TestCase: self.slow = tc_dict["slow"] self.path = os.path.join(workdir, name) self.name = self.path # for now - self.ktype = None self.defconfig = {} + self.ktype = None - with open(os.path.join(testcase_root, workdir, "Makefile")) as makefile: - for line in makefile.readlines(): - m = TestCase.makefile_re.match(line) - if m: - self.ktype = m.group(1) - break - if not self.ktype: - raise ConfigurationError(os.path.join(workdir, "Makefile"), - "KERNEL_TYPE not found") + if self.kernel: + self.ktype = self.kernel + else: + with open(os.path.join(testcase_root, workdir, "Makefile")) as makefile: + for line in makefile.readlines(): + m = TestCase.makefile_re.match(line) + if m: + self.ktype = m.group(1) + break + if not self.ktype: + raise ConfigurationError(os.path.join(workdir, "Makefile"), + "KERNEL_TYPE not found") def __repr__(self): return self.name