fix trouble on atoms tests since 5.4.0 without libscilab
[scilab.git] / scilab / modules / atoms / tests / unit_tests / atomsRemove.dia.ref
index 81b1b21..32f3b4f 100644 (file)
@@ -5,6 +5,13 @@
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
 // <-- CLI SHELL MODE -->
+//detect scilab arch
+[version, opts] = getversion();
+if opts(2) == "x64" & getos() == "Windows" then
+    arch = "x64/";
+else
+    arch = "";
+end
 load("SCI/modules/atoms/macros/atoms_internals/lib");
 // If previous test did not end properly, restore, else backup config file
 atomsRestoreConfig(%T);
@@ -38,10 +45,10 @@ end
 // installed by
 // -----------------------------------------------------------------------------
 atomsInstall(["toolbox_5" "1.0"],"user");
-ref = [ "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_1/1.0-1"  "A" ;
-        "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_2/1.0-1"  "A" ;
-        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_4/1.0-1"  "A" ;
-        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_5/1.0-1"  "I" ];
+ref = [ "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_1/1.0-1"  "A" ;
+        "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_2/1.0-1"  "A" ;
+        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_4/1.0-1"  "A" ;
+        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_5/1.0-1"  "I" ];
 if getos()=="Windows" then
    ref=strsubst(ref,"/","\");
 end
@@ -52,12 +59,12 @@ assert_checkequal(removed(b,:),ref);
 // -----------------------------------------------------------------------------
 atomsInstall(["toolbox_5" "1.0"],"user");
 atomsInstall(["toolbox_3" "1.0"],"user");
-ref = [ "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_1/1.0-1"  "A" ;
-        "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_2/1.0-1"  "A" ;
-        "toolbox_2"  "2.0-1"  "user"  "SCIHOME/atoms/toolbox_2/2.0-1"  "A" ;
-        "toolbox_3"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_3/1.0-1"  "I" ;
-        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_4/1.0-1"  "A" ;
-        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_5/1.0-1"  "I" ];
+ref = [ "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_1/1.0-1"  "A" ;
+        "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_2/1.0-1"  "A" ;
+        "toolbox_2"  "2.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_2/2.0-1"  "A" ;
+        "toolbox_3"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_3/1.0-1"  "I" ;
+        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_4/1.0-1"  "A" ;
+        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_5/1.0-1"  "I" ];
 if getos()=="Windows" then
    ref=strsubst(ref,"/","\");
 end
@@ -70,8 +77,8 @@ assert_checkequal(removed(b,:),ref);
 // -----------------------------------------------------------------------------
 atomsInstall(["toolbox_5" "1.0"],"user");
 atomsInstall(["toolbox_3" "1.0"],"user");
-ref = [ "toolbox_2"  "2.0-1"  "user"  "SCIHOME/atoms/toolbox_2/2.0-1"  "A" ;
-        "toolbox_3"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_3/1.0-1"  "I" ];
+ref = [ "toolbox_2"  "2.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_2/2.0-1"  "A" ;
+        "toolbox_3"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_3/1.0-1"  "I" ];
 if getos()=="Windows" then
    ref=strsubst(ref,"/","\");
 end
@@ -82,10 +89,10 @@ assert_checkequal(removed(b,:),ref);
 // -----------------------------------------------------------------------------
 atomsInstall(["toolbox_5" "1.0"],"user");
 atomsInstall(["toolbox_5" "1.0"],"allusers");
-ref = [ "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_1/1.0-1"  "A" ;
-        "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_2/1.0-1"  "A" ;
-        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_4/1.0-1"  "A" ;
-        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_5/1.0-1"  "I" ];
+ref = [ "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_1/1.0-1"  "A" ;
+        "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_2/1.0-1"  "A" ;
+        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_4/1.0-1"  "A" ;
+        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_5/1.0-1"  "I" ];
 if getos()=="Windows" then
    ref=strsubst(ref,"/","\");
 end
@@ -108,13 +115,13 @@ assert_checkequal(removed(b,:),ref_all);
 atomsInstall(["toolbox_5" "1.0"],"user");
 atomsInstall(["toolbox_5" "1.0"],"allusers");
 ref = [ "toolbox_1"  "1.0-1"  "allusers"  "SCI/contrib/toolbox_1/1.0-1"  "A" ;
-        "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_1/1.0-1"  "A" ;
+        "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_1/1.0-1"  "A" ;
         "toolbox_2"  "1.0-1"  "allusers"  "SCI/contrib/toolbox_2/1.0-1"  "A" ;
-        "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_2/1.0-1"  "A" ;
+        "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_2/1.0-1"  "A" ;
         "toolbox_4"  "1.0-1"  "allusers"  "SCI/contrib/toolbox_4/1.0-1"  "A" ;
-        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_4/1.0-1"  "A" ;
+        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_4/1.0-1"  "A" ;
         "toolbox_5"  "1.0-1"  "allusers"  "SCI/contrib/toolbox_5/1.0-1"  "I" ;
-        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_5/1.0-1"  "I" ];
+        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_5/1.0-1"  "I" ];
 if getos()=="Windows" then
    ref=strsubst(ref,"/","\");
 end
@@ -128,10 +135,10 @@ assert_checkequal(removed(b,:),ref);
 // -----------------------------------------------------------------------------
 atomsInstall(["toolbox_5" "1.0"],"user");
 ref_empty = [];
-ref = [ "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_1/1.0-1"  "A" ;
-        "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_2/1.0-1"  "A" ;
-        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_4/1.0-1"  "A" ;
-        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_5/1.0-1"  "I" ];
+ref = [ "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_1/1.0-1"  "A" ;
+        "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_2/1.0-1"  "A" ;
+        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_4/1.0-1"  "A" ;
+        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_5/1.0-1"  "I" ];
 if getos()=="Windows" then
    ref=strsubst(ref,"/","\");
 end
@@ -141,19 +148,19 @@ removed=atomsRemove(["toolbox_5" "1.0"],"user");
 assert_checkequal(removed(b,:),ref);
 // ============================================================================
 // DELETING PART
-rmdir(SCIHOME+"/atoms/archives/",'s');
-mkdir(SCIHOME+"/atoms/archives");
-rmdir(SCI+"/contrib/archives/",'s');
-mkdir(SCI+"/contrib/archives");
+rmdir(atomsPath("install","user")+'archives/','s');
+mkdir(atomsPath("install","user")+'archives/');
+rmdir(atomsPath("install","allusers")+'archives/','s');
+mkdir(atomsPath("install","allusers")+'archives/');
 // ============================================================================
 // REMOVING AND DELETING a toolbox will delete its archives and archives of the
 // toolboxes it depends on
 // -----------------------------------------------------------------------------
 atomsInstall(["toolbox_5" "1.0"],"user");
-ref = [ "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_1/1.0-1"  "A" ;
-        "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_2/1.0-1"  "A" ;
-        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_4/1.0-1"  "A" ;
-        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_5/1.0-1"  "I" ];
+ref = [ "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_1/1.0-1"  "A" ;
+        "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_2/1.0-1"  "A" ;
+        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_4/1.0-1"  "A" ;
+        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_5/1.0-1"  "I" ];
 if getos()=="Windows" then
    ref=strsubst(ref,"/","\");
 end
@@ -166,23 +173,22 @@ if getos()=="Windows" then
 else
     assert_checkequal(ls(atomsPath("install","user")+'archives/'),ref_empty);
 end
-rmdir(SCIHOME+"/atoms/archives/",'s');
-mkdir(SCIHOME+"/atoms/archives");
-rmdir(SCI+"/contrib/archives/",'s');
-mkdir(SCI+"/contrib/archives");
+rmdir(atomsPath("install","user")+'archives/','s');
+mkdir(atomsPath("install","user")+'archives/');
+rmdir(atomsPath("install","allusers")+'archives/','s');
+mkdir(atomsPath("install","allusers")+'archives/');
 // REMOVING AND DELETING a toolbox will not delete other archives than the ones
 // it depends on
 // -----------------------------------------------------------------------------
 atomsInstall(["toolbox_5" "1.0"],"user");
 atomsInstall(["toolbox_6" "1.0"],"user");
-ref = [ "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_2/1.0-1"  "A" ;
-        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_4/1.0-1"  "A" ;
-        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_5/1.0-1"  "I" ];
+ref = [ "toolbox_2"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_2/1.0-1"  "A" ;
+        "toolbox_4"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_4/1.0-1"  "A" ;
+        "toolbox_5"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_5/1.0-1"  "I" ];
 [version, opts] = getversion();
-arch = opts(2);
 if getos()=="Windows" then
     ref=strsubst(ref,"/","\");
-       if arch == "x86" then
+       if opts(2) == "x86" then
 ref_ls = [ "toolbox_1_1.0-1.bin.windows.zip";
            "toolbox_2_2.0-1.bin.windows.zip";
            "toolbox_6_1.0-1.bin.windows.zip"];
@@ -192,7 +198,7 @@ ref_ls = [ "toolbox_1_1.0-1.bin.x64.windows.zip";
            "toolbox_6_1.0-1.bin.x64.windows.zip"];
        end
 elseif getos()=="Linux" then
-       if arch == "x86" then
+       if opts(2) == "x86" then
 ref_ls = [ "toolbox_1_1.0-1.bin.i686.linux.tar.gz";
            "toolbox_2_2.0-1.bin.i686.linux.tar.gz";
            "toolbox_6_1.0-1.bin.i686.linux.tar.gz"];   
@@ -206,9 +212,9 @@ ref_ls = [ "toolbox_1_1.0-1.bin.x86_64.darwin.tar.gz";
            "toolbox_2_2.0-1.bin.x86_64.darwin.tar.gz";
            "toolbox_6_1.0-1.bin.x86_64.darwin.tar.gz"];        
 end
-ref_rem_6 = [ "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_1/1.0-1"  "A" ;
-              "toolbox_2"  "2.0-1"  "user"  "SCIHOME/atoms/toolbox_2/2.0-1"  "A" ;
-              "toolbox_6"  "1.0-1"  "user"  "SCIHOME/atoms/toolbox_6/1.0-1"  "I" ];
+ref_rem_6 = [ "toolbox_1"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_1/1.0-1"  "A" ;
+              "toolbox_2"  "2.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_2/2.0-1"  "A" ;
+              "toolbox_6"  "1.0-1"  "user"  "SCIHOME/atoms/" + arch + "toolbox_6/1.0-1"  "I" ];
 if getos()=="Windows" then
    ref_rem_6=strsubst(ref_rem_6,"/","\");
 end