]> SALOME platform Git repositories - tools/sat.git/blob - test/test_sat5_0/compilation/test_makeinstall.py
Salome HOME
option bin_products part 1
[tools/sat.git] / test / test_sat5_0 / compilation / test_makeinstall.py
1 #!/usr/bin/env python
2 #-*- coding:utf-8 -*-
3
4 #  Copyright (C) 2010-2018  CEA/DEN
5 #
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.
10 #
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.
15 #
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
19
20 import os
21 import sys
22 import unittest
23
24 import src.product
25 from src.salomeTools import Sat
26
27 class TestMakeinstall(unittest.TestCase):
28     """Test of the makeinstall command"""
29
30     def test_010(self):
31         # Test the configure-make-makeinstall command without any option
32         OK = 'KO'
33
34         appli = 'appli-test'
35         product_name = 'PRODUCT_GIT'
36
37         sat = Sat()
38                             
39         sat.prepare(appli + ' --product ' + product_name)
40         expected_install_dir = src.product.get_product_config(sat.cfg, product_name).install_dir
41         expected_file_path = os.path.join(expected_install_dir, 'bin/hello')
42        
43         sat.configure(appli + ' --product ' + product_name)
44         
45         sat.make(appli + ' --product ' + product_name)
46         
47         sat.makeinstall(appli + ' --product ' + product_name)
48         
49         if os.path.exists(expected_file_path):
50             OK = 'OK'         
51         # pyunit method to compare 2 str
52         self.assertEqual(OK, 'OK')
53
54     def test_020(self):
55         # Test the sat -h make
56         OK = "KO"
57
58         import makeinstall
59         
60         if "The makeinstall command executes the 'make install' command" in makeinstall.description():
61             OK = "OK"
62
63         # pyunit method to compare 2 str
64         self.assertEqual(OK, "OK")
65
66 # test launch
67 if __name__ == '__main__':
68     unittest.main()
69     pass