- def testBadOutputDir(self):
- """Test building with an output dir the same as out current dir"""
- self._test_branch = '/__dev/__testbranch'
- with self.assertRaises(SystemExit):
- self._RunControl('-b', self._test_branch, '-o', os.getcwd())
- with self.assertRaises(SystemExit):
- self._RunControl('-b', self._test_branch, '-o',
- os.path.join(os.getcwd(), 'test'))
+ def testWorkInOutput(self):
+ """Test the -w option which should write directly to the output dir"""
+ board_list = board.Boards()
+ board_list.AddBoard(board.Board(*boards[0]))
+ self._RunControl('-o', self._output_dir, '-w', clean_dir=False,
+ boards=board_list)
+ self.assertTrue(
+ os.path.exists(os.path.join(self._output_dir, 'u-boot')))
+
+ def testWorkInOutputFail(self):
+ """Test the -w option failures"""
+ with self.assertRaises(SystemExit) as e:
+ self._RunControl('-o', self._output_dir, '-w', clean_dir=False)
+ self.assertIn("single board", str(e.exception))
+ self.assertFalse(
+ os.path.exists(os.path.join(self._output_dir, 'u-boot')))
+
+ board_list = board.Boards()
+ board_list.AddBoard(board.Board(*boards[0]))
+ with self.assertRaises(SystemExit) as e:
+ self._RunControl('-b', self._test_branch, '-o', self._output_dir,
+ '-w', clean_dir=False, boards=board_list)
+ self.assertIn("single commit", str(e.exception))