Salome HOME
Correct the misprints in the README files. See https://codev-tuleap.cea.fr/plugins...
[tools/sat.git] / test / compilation / test_makeinstall.py
1 #!/usr/bin/env python
2 #-*- coding:utf-8 -*-
3 #  Copyright (C) 2010-2012  CEA/DEN
4 #
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.
9 #
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.
14 #
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
18
19 import unittest
20 import os
21 import sys
22
23 # get execution path
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'))
28
29 import src.product
30
31 from salomeTools import Sat
32 import HTMLTestRunner
33
34 class TestMakeinstall(unittest.TestCase):
35     '''Test of the makeinstall command
36     '''
37
38     def test_makeinstall(self):
39         '''Test the configure command without any option
40         '''
41         OK = 'KO'
42
43         appli = 'appli-test'
44         product_name = 'PRODUCT_GIT'
45
46         sat = Sat()
47                             
48         sat.prepare(appli + ' --product ' + product_name)
49         expected_install_dir = src.product.get_product_config(sat.cfg, product_name).install_dir
50         expected_file_path = os.path.join(expected_install_dir, 'bin/hello')
51        
52         sat.configure(appli + ' --product ' + product_name)
53         
54         sat.make(appli + ' --product ' + product_name)
55         
56         sat.makeinstall(appli + ' --product ' + product_name)
57         
58         if os.path.exists(expected_file_path):
59             OK = 'OK'         
60         # pyunit method to compare 2 str
61         self.assertEqual(OK, 'OK')
62
63     def test_description(self):
64         '''Test the sat -h make
65         '''        
66
67         OK = "KO"
68
69         import makeinstall
70         
71         if "The makeinstall command executes the \"make install\" command" in makeinstall.description():
72             OK = "OK"
73
74         # pyunit method to compare 2 str
75         self.assertEqual(OK, "OK")
76
77 # test launch
78 if __name__ == '__main__':
79     HTMLTestRunner.main()