diff options
author | Simon Glass <sjg@chromium.org> | 2014-12-01 17:33:51 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-01-14 21:16:52 -0800 |
commit | 4466c1f943efa974d8e4671778d44427cc535be3 (patch) | |
tree | d8cd78ce31e42574deaab0a6943797598facb319 | |
parent | bd5053ffa5b8162257537bdb79ba829372423096 (diff) | |
download | u-boot-4466c1f943efa974d8e4671778d44427cc535be3.tar.gz |
buildman: Add tests that check the correct output directory is used
Add a few tests of the output directory logic.
Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | tools/buildman/test.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/buildman/test.py b/tools/buildman/test.py index a2a85ac9ce..f16d2fd1a5 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -83,6 +83,8 @@ boards = [ ['Active', 'sandbox', 'sandbox', '', 'Tester', 'Sandbox board', 'board4', ''], ] +BASE_DIR = 'base' + class Options: """Class that holds build options""" pass @@ -341,6 +343,35 @@ class TestBuild(unittest.TestCase): self.assertEqual(self.boards.SelectBoards(['sandbox sandbox', 'sandbox']), {'all': 1, 'sandbox': 1}) + def CheckDirs(self, build, dirname): + self.assertEqual('base%s' % dirname, build._GetOutputDir(1)) + self.assertEqual('base%s/fred' % dirname, + build.GetBuildDir(1, 'fred')) + self.assertEqual('base%s/fred/done' % dirname, + build.GetDoneFile(1, 'fred')) + self.assertEqual('base%s/fred/u-boot.sizes' % dirname, + build.GetFuncSizesFile(1, 'fred', 'u-boot')) + self.assertEqual('base%s/fred/u-boot.objdump' % dirname, + build.GetObjdumpFile(1, 'fred', 'u-boot')) + self.assertEqual('base%s/fred/err' % dirname, + build.GetErrFile(1, 'fred')) + + def testOutputDir(self): + build = builder.Builder(self.toolchains, BASE_DIR, None, 1, 2, + checkout=False, show_unknown=False) + build.commits = self.commits + build.commit_count = len(self.commits) + subject = self.commits[1].subject.translate(builder.trans_valid_chars) + dirname ='/%02d_of_%02d_g%s_%s' % (2, build.commit_count, commits[1][0], + subject[:20]) + self.CheckDirs(build, dirname) + + def testOutputDirCurrent(self): + build = builder.Builder(self.toolchains, BASE_DIR, None, 1, 2, + checkout=False, show_unknown=False) + build.commits = None + build.commit_count = 0 + self.CheckDirs(build, '/current') if __name__ == "__main__": unittest.main() |