4 # Copyright (C) 2010-2018 CEA/DEN
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 from src.salomeTools import Sat
27 class TestCase(unittest.TestCase):
28 """Test of the configure command"""
37 # Test the configure command with a product in cmake
41 product_name = 'PRODUCT_GIT'
45 sat.prepare(appli + ' --product ' + product_name)
46 expected_build_dir = src.product.get_product_config(sat.cfg, product_name).build_dir
47 expected_file_path = os.path.join(expected_build_dir, 'CMakeCache.txt')
49 sat.configure(appli + ' --product ' + product_name)
51 if os.path.exists(os.path.join(expected_build_dir, expected_file_path)):
53 # pyunit method to compare 2 str
54 self.assertEqual(OK, 'OK')
57 # Test the configure command with a product in autotools
61 product_name = 'PRODUCT_CVS'
65 sat.prepare(appli + ' --product ' + product_name)
66 expected_build_dir = src.product.get_product_config(sat.cfg, product_name).build_dir
67 expected_file_path = os.path.join(expected_build_dir, 'config.log')
69 sat.configure(appli + ' --product ' + product_name)
71 if os.path.exists(os.path.join(expected_build_dir, expected_file_path)):
73 # pyunit method to compare 2 str
74 self.assertEqual(OK, 'OK')
77 # Test the configure command with a product in script mode
81 product_name = 'Python'
85 sat.prepare(appli + ' --product ' + product_name)
86 expected_build_dir = src.product.get_product_config(sat.cfg, product_name).build_dir
88 sat.configure(appli + ' --product ' + product_name)
90 if os.path.exists(expected_build_dir):
92 # pyunit method to compare 2 str
93 self.assertEqual(OK, 'OK')
96 # Test the 'sat -h configure'
101 if "The configure command executes in the build directory" in configure.description():
104 # pyunit method to compare 2 str
105 self.assertEqual(OK, "OK")
108 if __name__ == '__main__':