3 # Copyright (C) 2010-2012 CEA/DEN
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 testdir = os.path.dirname(os.path.realpath(__file__))
25 sys.path.append(os.path.join(testdir, '..', '..'))
26 sys.path.append(os.path.join(testdir, '..', '_testTools'))
27 sys.path.append(os.path.join(testdir, '..', '..','commands'))
31 from salomeTools import Sat
34 class TestMake(unittest.TestCase):
35 '''Test of the make command
39 '''Test the configure command without any option
44 product_name = 'PRODUCT_GIT'
48 sat.prepare(appli + ' --product ' + product_name)
49 expected_build_dir = src.product.get_product_config(sat.cfg, product_name).build_dir
50 expected_file_path = os.path.join(expected_build_dir, 'hello')
52 sat.configure(appli + ' --product ' + product_name)
54 sat.make(appli + ' --product ' + product_name)
56 if os.path.exists(os.path.join(expected_build_dir, expected_file_path)):
58 # pyunit method to compare 2 str
59 self.assertEqual(OK, 'OK')
61 def test_make_option(self):
62 '''Test the make command with an option
67 product_name = 'PRODUCT_GIT'
71 sat.prepare(appli + ' --product ' + product_name)
72 expected_build_dir = src.product.get_product_config(sat.cfg, product_name).build_dir
73 expected_file_path = os.path.join(expected_build_dir, 'hello')
75 sat.configure(appli + ' --product ' + product_name)
77 sat.make(appli + ' --product ' + product_name + ' --option -j3')
79 if os.path.exists(os.path.join(expected_build_dir, expected_file_path)):
81 # pyunit method to compare 2 str
82 self.assertEqual(OK, 'OK')
84 def test_make_script(self):
85 '''Test the make command with a product in script mode
90 product_name = 'Python'
94 sat.prepare(appli + ' --product ' + product_name)
95 expected_install_dir = src.product.get_product_config(sat.cfg, product_name).install_dir
96 expected_file = "bin/python2.7"
98 sat.make(appli + ' --product ' + product_name)
100 if os.path.exists(os.path.join(expected_install_dir, expected_file)):
102 # pyunit method to compare 2 str
103 self.assertEqual(OK, 'OK')
105 def test_description(self):
106 '''Test the sat -h make
113 if "The make command executes the \"make\" command" in make.description():
116 # pyunit method to compare 2 str
117 self.assertEqual(OK, "OK")
120 if __name__ == '__main__':
121 HTMLTestRunner.main()