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 TestConfigure(unittest.TestCase):
35 '''Test of the configure command
38 def test_configure_cmake(self):
39 '''Test the configure command with a product in cmake
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, 'CMakeCache.txt')
52 sat.configure(appli + ' --product ' + product_name)
54 if os.path.exists(os.path.join(expected_build_dir, expected_file_path)):
56 # pyunit method to compare 2 str
57 self.assertEqual(OK, 'OK')
59 def test_configure_autotools(self):
60 '''Test the configure command with a product in autotools
65 product_name = 'PRODUCT_CVS'
69 sat.prepare(appli + ' --product ' + product_name)
70 expected_build_dir = src.product.get_product_config(sat.cfg, product_name).build_dir
71 expected_file_path = os.path.join(expected_build_dir, 'config.log')
73 sat.configure(appli + ' --product ' + product_name)
75 if os.path.exists(os.path.join(expected_build_dir, expected_file_path)):
77 # pyunit method to compare 2 str
78 self.assertEqual(OK, 'OK')
80 def test_configure_script(self):
81 '''Test the configure command with a product in script mode
86 product_name = 'Python'
90 sat.prepare(appli + ' --product ' + product_name)
91 expected_build_dir = src.product.get_product_config(sat.cfg, product_name).build_dir
93 sat.configure(appli + ' --product ' + product_name)
95 if os.path.exists(expected_build_dir):
97 # pyunit method to compare 2 str
98 self.assertEqual(OK, 'OK')
100 def test_description(self):
101 '''Test the sat -h configure
108 if "The configure command executes in the build directory" in configure.description():
111 # pyunit method to compare 2 str
112 self.assertEqual(OK, "OK")
115 if __name__ == '__main__':
116 HTMLTestRunner.main()