* Update Windows ref for atomsShow.tst
[scilab.git] / scilab / modules / atoms / tests / unit_tests / atomsUpdate.tst
1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2009 - DIGITEO - Pierre MARECHAL <pierre.marechal@scilab.org>
4 //
5 //  This file is distributed under the same license as the Scilab package.
6 // =============================================================================
7
8 // <-- ENGLISH IMPOSED -->
9 // <-- CLI SHELL MODE -->
10
11
12
13 load("SCI/modules/atoms/macros/atoms_internals/lib");
14
15 // We need a clean version
16 // =============================================================================
17 if ~isempty( atomsGetInstalled() ) then pause, end
18
19 // If previous test did not end properly, restore, else backup config file
20 atomsRestoreConfig(%T);
21 atomsSaveConfig();
22
23 // Do not use the autoload system
24 // =============================================================================
25 atomsSetConfig("autoloadAddAfterInstall","False");
26 atomsSetConfig("Verbose" ,"False");
27
28
29 // 1st test-case : Just install the toolbox 5
30 // =============================================================================
31
32 // Load the 1st scenario : See scene10.test.atoms.scilab.org.txt
33 atomsRepositorySetOfl("http://scene10.6.0.test.atoms.scilab.org");
34
35 atomsInstall("toolbox_5V6","user");
36
37 // Check if the module is really installed
38
39 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
40 if ~atomsIsInstalled(["toolbox_4V6" "1.0-1"],"user") then pause, end
41 if  atomsIsInstalled(["toolbox_4V6" "1.1-1"],"all")  then pause, end
42 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
43 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
44
45 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
46 if atomsGetInstalledStatus(["toolbox_4V6" "1.0-1"],"user")<>"A" then pause, end
47 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
48 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
49
50 // Load the 2nd scenario : See scene11.test.atoms.scilab.org.txt
51 atomsRepositorySetOfl("http://scene11.6.0.test.atoms.scilab.org");
52
53 atomsUpdate();
54
55 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
56 if  atomsIsInstalled(["toolbox_4V6" "1.0-1"],"all")  then pause, end
57 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
58 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
59 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
60
61 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
62 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"A" then pause, end
63 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
64 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
65
66 // Remove the module
67 atomsRemove("toolbox_5V6","user");
68
69 // no module should be installed
70 if ~isempty( atomsGetInstalled() ) then pause, end
71
72 // 2nd test-case : Install toolbox 4 and then toolbox 5
73 // =============================================================================
74
75 // Load the 1st scenario : See scene10.test.atoms.scilab.org.txt
76 atomsRepositorySetOfl("http://scene10.6.0.test.atoms.scilab.org");
77
78 atomsInstall("toolbox_4V6","user");
79 atomsInstall("toolbox_5V6","user");
80
81 // Check if the module is really installed
82
83 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
84 if ~atomsIsInstalled(["toolbox_4V6" "1.0-1"],"user") then pause, end
85 if  atomsIsInstalled(["toolbox_4V6" "1.1-1"],"all")  then pause, end
86 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
87 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
88
89 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
90 if atomsGetInstalledStatus(["toolbox_4V6" "1.0-1"],"user")<>"I" then pause, end
91 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
92 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
93
94 // Load the 2nd scenario : See scene11.test.atoms.scilab.org.txt
95 atomsRepositorySetOfl("http://scene11.6.0.test.atoms.scilab.org");
96
97 atomsUpdate();
98
99 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
100 if  atomsIsInstalled(["toolbox_4V6" "1.0-1"],"all")  then pause, end
101 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
102 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
103 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
104
105 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
106 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"I" then pause, end
107 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
108 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
109
110 // Remove the module
111 atomsRemove("toolbox_5V6","user");
112 atomsRemove("toolbox_4V6","user");
113
114 // no module should be installed
115 if ~isempty( atomsGetInstalled() ) then pause, end
116
117 // 3rd test-case : Install toolbox 4 and toolbox 3
118 // => Test the behaviour of toolbox_2
119 // =============================================================================
120
121 // Load the 1st scenario : See scene10.test.atoms.scilab.org.txt
122 atomsRepositorySetOfl("http://scene10.6.0.test.atoms.scilab.org");
123
124 atomsInstall("toolbox_3V6","user");
125 atomsInstall("toolbox_4V6","user");
126
127 if ~atomsIsInstalled(["toolbox_4V6" "1.0-1"],"user") then pause, end
128 if ~atomsIsInstalled(["toolbox_3V6" "1.0-1"],"user") then pause, end
129 if ~atomsIsInstalled(["toolbox_2V6" "2.0-1"],"user") then pause, end
130 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
131 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
132
133 if  atomsIsInstalled(["toolbox_4V6" "1.1-1"],"all")  then pause, end
134 if  atomsIsInstalled(["toolbox_2V6" "2.1-1"],"all")  then pause, end
135
136 if atomsGetInstalledStatus(["toolbox_4V6" "1.0-1"],"user")<>"I" then pause, end
137 if atomsGetInstalledStatus(["toolbox_3V6" "1.0-1"],"user")<>"I" then pause, end
138 if atomsGetInstalledStatus(["toolbox_2V6" "2.0-1"],"user")<>"A" then pause, end
139 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
140 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
141
142 // Load the 2nd scenario : See scene11.test.atoms.scilab.org.txt
143 atomsRepositorySetOfl("http://scene11.6.0.test.atoms.scilab.org");
144
145 atomsUpdate();
146
147 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
148 if ~atomsIsInstalled(["toolbox_3V6" "1.0-1"],"user") then pause, end
149 if ~atomsIsInstalled(["toolbox_2V6" "2.1-1"],"user") then pause, end
150 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
151 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
152
153 if  atomsIsInstalled(["toolbox_4V6" "1.0-1"],"all")  then pause, end
154 if  atomsIsInstalled(["toolbox_2V6" "2.0-1"],"all")  then pause, end
155
156 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"I" then pause, end
157 if atomsGetInstalledStatus(["toolbox_3V6" "1.0-1"],"user")<>"I" then pause, end
158 if atomsGetInstalledStatus(["toolbox_2V6" "2.1-1"],"user")<>"A" then pause, end
159 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
160 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
161
162 atomsRemove("toolbox_4V6","user");
163 atomsRemove("toolbox_3V6","user");
164
165 // no module should be installed
166 if ~isempty( atomsGetInstalled() ) then pause, end
167
168 // 4th test-case : Test the user/allusers behaviour
169 // =============================================================================
170
171 // Load the 1st scenario : See scene10.test.atoms.scilab.org.txt
172 atomsRepositorySetOfl("http://scene10.6.0.test.atoms.scilab.org");
173
174 atomsInstall("toolbox_5V6","user");
175 atomsInstall("toolbox_5V6","allusers");
176
177 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
178 if ~atomsIsInstalled(["toolbox_4V6" "1.0-1"],"user") then pause, end
179 if  atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
180 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
181 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
182
183 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"allusers") then pause, end
184 if ~atomsIsInstalled(["toolbox_4V6" "1.0-1"],"allusers") then pause, end
185 if  atomsIsInstalled(["toolbox_4V6" "1.1-1"],"allusers") then pause, end
186 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"allusers") then pause, end
187 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"allusers") then pause, end
188
189 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
190 if atomsGetInstalledStatus(["toolbox_4V6" "1.0-1"],"user")<>"A" then pause, end
191 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
192 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
193
194 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"allusers")<>"I" then pause, end
195 if atomsGetInstalledStatus(["toolbox_4V6" "1.0-1"],"allusers")<>"A" then pause, end
196 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"allusers")<>"A" then pause, end
197 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"allusers")<>"A" then pause, end
198
199 // Load the 2nd scenario : See scene11.test.atoms.scilab.org.txt
200 atomsRepositorySetOfl("http://scene11.6.0.test.atoms.scilab.org");
201
202 atomsUpdate([],"user");
203
204 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
205 if  atomsIsInstalled(["toolbox_4V6" "1.0-1"],"user") then pause, end
206 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
207 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
208 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
209
210 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"allusers") then pause, end
211 if ~atomsIsInstalled(["toolbox_4V6" "1.0-1"],"allusers") then pause, end
212 if  atomsIsInstalled(["toolbox_4V6" "1.1-1"],"allusers") then pause, end
213 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"allusers") then pause, end
214 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"allusers") then pause, end
215
216 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"A" then pause, end
217 if atomsGetInstalledStatus(["toolbox_4V6" "1.0-1"],"allusers")<>"A" then pause, end
218
219 atomsUpdate([],"allusers");
220
221 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
222 if  atomsIsInstalled(["toolbox_4V6" "1.0-1"],"user") then pause, end
223 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
224 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
225 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
226
227 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"allusers") then pause, end
228 if  atomsIsInstalled(["toolbox_4V6" "1.0-1"],"allusers") then pause, end
229 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"allusers") then pause, end
230 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"allusers") then pause, end
231 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"allusers") then pause, end
232
233 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"A" then pause, end
234 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"allusers")<>"A" then pause, end
235
236 atomsRemove("toolbox_5V6","user");
237 atomsRemove("toolbox_5V6","allusers");
238
239 // no module should be installed
240 if ~isempty( atomsGetInstalled() ) then pause, end
241
242 // 5th test-case : Test the packaging version update
243 // =============================================================================
244
245 // Load the 1st scenario : See scene11.test.atoms.scilab.org.txt
246 atomsRepositorySetOfl("http://scene11.6.0.test.atoms.scilab.org");
247
248 atomsInstall("toolbox_5V6","user");
249
250 // Check if the module is really installed
251
252 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
253 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"all")  then pause, end
254 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
255 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
256
257 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
258 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"A" then pause, end
259 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
260 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
261
262 // Load the 2nd scenario : See scene12.test.atoms.scilab.org.txt
263 atomsRepositorySetOfl("http://scene12.6.0.test.atoms.scilab.org");
264
265 atomsUpdate();
266
267 if ~atomsIsInstalled(["toolbox_5V6" "1.0-1"],"user") then pause, end
268 if ~atomsIsInstalled(["toolbox_4V6" "1.1-1"],"user") then pause, end
269 if ~atomsIsInstalled(["toolbox_2V6" "1.0-1"],"user") then pause, end
270 if ~atomsIsInstalled(["toolbox_1V6" "1.0-1"],"user") then pause, end
271
272 if atomsGetInstalledStatus(["toolbox_5V6" "1.0-1"],"user")<>"I" then pause, end
273 if atomsGetInstalledStatus(["toolbox_4V6" "1.1-1"],"user")<>"A" then pause, end
274 if atomsGetInstalledStatus(["toolbox_2V6" "1.0-1"],"user")<>"A" then pause, end
275 if atomsGetInstalledStatus(["toolbox_1V6" "1.0-1"],"user")<>"A" then pause, end
276
277 // Remove the module
278 atomsRemove("toolbox_5V6","user");
279
280 // no module should be installed
281 if ~isempty( atomsGetInstalled() ) then pause, end
282
283 // Restore original values
284 // =============================================================================
285 atomsRestoreConfig(%T);
286
287 atomsRepositorySetOfl(mgetl(SCI+"/modules/atoms/tests/unit_tests/repositories.orig"));