tests: Add support for functional only tests
Modify the ClassicTest class to only emit a stat verification test unit if there is a reference stat file. This makes it possible to design tests that don't care about stat changes. To generate purely functional tests, we need to be able to create empty test reference directories. This does not work well with many revision control systems. As a workaround, add a file named EMPTY to the list of ignored files in the test harness. This file can be used as a placeholder in otherwise empty test directories. Change-Id: I583c8c4e55479f0d48fa99d0b0d1eac9221e6652 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
This commit is contained in:
parent
18461d1522
commit
1ecc3628a8
1 changed files with 11 additions and 6 deletions
|
@ -236,6 +236,7 @@ class ClassicTest(Test):
|
||||||
# and other files that we don't care about.
|
# and other files that we don't care about.
|
||||||
ref_ignore_files = FileIgnoreList(
|
ref_ignore_files = FileIgnoreList(
|
||||||
names=(
|
names=(
|
||||||
|
"EMPTY",
|
||||||
), rex=(
|
), rex=(
|
||||||
# Mercurial sometimes leaves backups when applying MQ patches
|
# Mercurial sometimes leaves backups when applying MQ patches
|
||||||
r"\.orig$",
|
r"\.orig$",
|
||||||
|
@ -284,17 +285,21 @@ class ClassicTest(Test):
|
||||||
]
|
]
|
||||||
|
|
||||||
def verify_units(self):
|
def verify_units(self):
|
||||||
return [
|
ref_files = set(self.ref_files())
|
||||||
DiffStatFile(ref_dir=self.ref_dir, test_dir=self.output_dir,
|
units = []
|
||||||
skip=self.skip_diff_stat)
|
if "stats.txt" in ref_files:
|
||||||
] + [
|
units.append(
|
||||||
|
DiffStatFile(ref_dir=self.ref_dir, test_dir=self.output_dir,
|
||||||
|
skip=self.skip_diff_stat))
|
||||||
|
units += [
|
||||||
DiffOutFile(f,
|
DiffOutFile(f,
|
||||||
ref_dir=self.ref_dir, test_dir=self.output_dir,
|
ref_dir=self.ref_dir, test_dir=self.output_dir,
|
||||||
skip=self.skip_diff_out)
|
skip=self.skip_diff_out)
|
||||||
for f in self.ref_files()
|
for f in ref_files if f not in ClassicTest.diff_ignore_files
|
||||||
if f not in ClassicTest.diff_ignore_files
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
return units
|
||||||
|
|
||||||
def update_ref(self):
|
def update_ref(self):
|
||||||
for fname in self.ref_files():
|
for fname in self.ref_files():
|
||||||
shutil.copy(
|
shutil.copy(
|
||||||
|
|
Loading…
Reference in a new issue