Move symlinkUpdateFilesIntoBundleDirectory to head_update.js.in - Bug 879612 - Move app update common xpcshell test code into head_update.js.in. r=bbondy
authorRobert Strong <robert.bugzilla@gmail.com>
Thu, 05 Sep 2013 12:19:22 -0700
changeset 158795 09e0f4967a8968a248026fedf5d2063854f09ab8
parent 158794 201d6846b30853da9002a45dc1d5edb3b4b56edd
child 158796 c70f74b72e32f4a0bb47691523e048d18a5e54ca
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbondy
bugs879612
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Move symlinkUpdateFilesIntoBundleDirectory to head_update.js.in - Bug 879612 - Move app update common xpcshell test code into head_update.js.in. r=bbondy
toolkit/mozapps/update/test/unit/head_update.js.in
toolkit/mozapps/update/test/unit/test_0201_app_launch_apply_update.js
toolkit/mozapps/update/test/unit/test_0202_app_launch_apply_update_dirlocked.js
toolkit/mozapps/update/test/unit/test_0203_app_launch_apply_update.js
toolkit/mozapps/update/test_svc/unit/test_0201_app_launch_apply_update_svc.js
toolkit/mozapps/update/test_svc/unit/test_0202_app_launch_apply_update_dirlocked_svc.js
toolkit/mozapps/update/test_svc/unit/test_0203_app_launch_apply_update_svc.js
--- a/toolkit/mozapps/update/test/unit/head_update.js.in
+++ b/toolkit/mozapps/update/test/unit/head_update.js.in
@@ -2094,16 +2094,85 @@ XPCOMUtils.defineLazyGetter(this, "gAppB
 /**
  * This dummy function just returns false.  Tests which wish to adjust the app
  * directory on Mac OS X should define a real version of this function.
  */
 function shouldAdjustPathsOnMac() {
   return false;
 }
 
+// Override getUpdatesRootDir on Mac because we need to apply the update
+// inside the bundle directory.
+function symlinkUpdateFilesIntoBundleDirectory() {
+  if (!shouldAdjustPathsOnMac()) {
+    return;
+  }
+  // Symlink active-update.xml and updates/ inside the dist/bin directory
+  // to point to the bundle directory.
+  // This is necessary because in order to test the code which actually ships
+  // with Firefox, we need to perform the update inside the bundle directory,
+  // whereas xpcshell runs from dist/bin/, and the updater service code looks
+  // at the current process directory to find things like these two files.
+
+  Components.utils.import("resource://gre/modules/ctypes.jsm");
+  let libc = ctypes.open("/usr/lib/libc.dylib");
+  // We need these two low level APIs because their functionality is not
+  // provided in nsIFile APIs.
+  let symlink = libc.declare("symlink", ctypes.default_abi, ctypes.int,
+                             ctypes.char.ptr, ctypes.char.ptr);
+  let unlink = libc.declare("unlink", ctypes.default_abi, ctypes.int,
+                            ctypes.char.ptr);
+
+  // Symlink active-update.xml
+  let dest = getAppDir();
+  dest.append("active-update.xml");
+  if (!dest.exists()) {
+    dest.create(dest.NORMAL_FILE_TYPE, 0644);
+  }
+  do_check_true(dest.exists());
+  let source = getUpdatesRootDir();
+  source.append("active-update.xml");
+  unlink(source.path);
+  let ret = symlink(dest.path, source.path);
+  do_check_eq(ret, 0);
+  do_check_true(source.exists());
+
+  // Symlink updates/
+  let dest2 = getAppDir();
+  dest2.append("updates");
+  if (dest2.exists()) {
+    dest2.remove(true);
+  }
+  dest2.create(dest.DIRECTORY_TYPE, 0755);
+  do_check_true(dest2.exists());
+  let source2 = getUpdatesRootDir();
+  source2.append("updates");
+  if (source2.exists()) {
+    source2.remove(true);
+  }
+  ret = symlink(dest2.path, source2.path);
+  do_check_eq(ret, 0);
+  do_check_true(source2.exists());
+
+  // Cleanup the symlinks when the test is finished.
+  do_register_cleanup(function AUFIBD_cleanup() {
+    logTestInfo("start - unlinking symlinks");
+    let ret = unlink(source.path);
+    do_check_false(source.exists());
+    let ret = unlink(source2.path);
+    do_check_false(source2.exists());
+    logTestInfo("finish - unlinking symlinks");
+  });
+
+  // Now, make sure that getUpdatesRootDir returns the application bundle
+  // directory, to make the various stuff in the test framework to work
+  // correctly.
+  getUpdatesRootDir = getAppDir;
+}
+
 /**
  * This function copies the entire process directory over to a new one which we
  * can write to, so that we can test under Windows which holds locks on opened
  * files.
  */
 function adjustPathsOnWindows() {
   logTestInfo("start - setup new process directory");
   // We copy the entire GRE directory into another location so that xpcshell
--- a/toolkit/mozapps/update/test/unit/test_0201_app_launch_apply_update.js
+++ b/toolkit/mozapps/update/test/unit/test_0201_app_launch_apply_update.js
@@ -28,83 +28,16 @@ const MAX_TIMEOUT_RUNS = 300;
 // the test will try to kill it.
 const APP_TIMER_TIMEOUT = 120000;
 
 let gAppTimer;
 let gProcess;
 let gActiveUpdate;
 let gTimeoutRuns = 0;
 
-// Override getUpdatesRootDir on Mac because we need to apply the update
-// inside the bundle directory.
-function symlinkUpdateFilesIntoBundleDirectory() {
-  if (!shouldAdjustPathsOnMac()) {
-    return;
-  }
-  // Symlink active-update.xml and updates/ inside the dist/bin directory
-  // to point to the bundle directory.
-  // This is necessary because in order to test the code which actually ships
-  // with Firefox, we need to perform the update inside the bundle directory,
-  // whereas xpcshell runs from dist/bin/, and the updater service code looks
-  // at the current process directory to find things like these two files.
-
-  Components.utils.import("resource://gre/modules/ctypes.jsm");
-  let libc = ctypes.open("/usr/lib/libc.dylib");
-  // We need these two low level APIs because their functionality is not
-  // provided in nsIFile APIs.
-  let symlink = libc.declare("symlink", ctypes.default_abi, ctypes.int,
-                             ctypes.char.ptr, ctypes.char.ptr);
-  let unlink = libc.declare("unlink", ctypes.default_abi, ctypes.int,
-                            ctypes.char.ptr);
-
-  // Symlink active-update.xml
-  let dest = getAppDir();
-  dest.append("active-update.xml");
-  if (!dest.exists()) {
-    dest.create(dest.NORMAL_FILE_TYPE, 0644);
-  }
-  do_check_true(dest.exists());
-  let source = getUpdatesRootDir();
-  source.append("active-update.xml");
-  unlink(source.path);
-  let ret = symlink(dest.path, source.path);
-  do_check_eq(ret, 0);
-  do_check_true(source.exists());
-
-  // Symlink updates/
-  let dest2 = getAppDir();
-  dest2.append("updates");
-  if (dest2.exists()) {
-    dest2.remove(true);
-  }
-  dest2.create(dest.DIRECTORY_TYPE, 0755);
-  do_check_true(dest2.exists());
-  let source2 = getUpdatesRootDir();
-  source2.append("updates");
-  if (source2.exists()) {
-    source2.remove(true);
-  }
-  ret = symlink(dest2.path, source2.path);
-  do_check_eq(ret, 0);
-  do_check_true(source2.exists());
-
-  // Cleanup the symlinks when the test is finished.
-  do_register_cleanup(function() {
-    let ret = unlink(source.path);
-    do_check_false(source.exists());
-    let ret = unlink(source2.path);
-    do_check_false(source2.exists());
-  });
-
-  // Now, make sure that getUpdatesRootDir returns the application bundle
-  // directory, to make the various stuff in the test framework to work
-  // correctly.
-  getUpdatesRootDir = getAppDir;
-}
-
 function run_test() {
   if (APP_BIN_NAME == "xulrunner") {
     logTestInfo("Unable to run this test on xulrunner");
     return;
   }
 
   do_test_pending();
   do_register_cleanup(end_test);
--- a/toolkit/mozapps/update/test/unit/test_0202_app_launch_apply_update_dirlocked.js
+++ b/toolkit/mozapps/update/test/unit/test_0202_app_launch_apply_update_dirlocked.js
@@ -24,85 +24,16 @@ const TEST_ID = "0202";
 // launching a post update executable.
 const FILE_UPDATER_INI_BAK = "updater.ini.bak";
 
 // Number of milliseconds for each do_timeout call.
 const CHECK_TIMEOUT_MILLI = 1000;
 
 let gActiveUpdate;
 
-// Override getUpdatesRootDir on Mac because we need to apply the update
-// inside the bundle directory.
-function symlinkUpdateFilesIntoBundleDirectory() {
-  if (!shouldAdjustPathsOnMac()) {
-    return;
-  }
-  // Symlink active-update.xml and updates/ inside the dist/bin directory
-  // to point to the bundle directory.
-  // This is necessary because in order to test the code which actually ships
-  // with Firefox, we need to perform the update inside the bundle directory,
-  // whereas xpcshell runs from dist/bin/, and the updater service code looks
-  // at the current process directory to find things like these two files.
-
-  Components.utils.import("resource://gre/modules/ctypes.jsm");
-  let libc = ctypes.open("/usr/lib/libc.dylib");
-  // We need these two low level APIs because their functionality is not
-  // provided in nsIFile APIs.
-  let symlink = libc.declare("symlink", ctypes.default_abi, ctypes.int,
-                             ctypes.char.ptr, ctypes.char.ptr);
-  let unlink = libc.declare("unlink", ctypes.default_abi, ctypes.int,
-                            ctypes.char.ptr);
-
-  // Symlink active-update.xml
-  let dest = getAppDir();
-  dest.append("active-update.xml");
-  if (!dest.exists()) {
-    dest.create(dest.NORMAL_FILE_TYPE, 0644);
-  }
-  do_check_true(dest.exists());
-  let source = getUpdatesRootDir();
-  source.append("active-update.xml");
-  unlink(source.path);
-  let ret = symlink(dest.path, source.path);
-  do_check_eq(ret, 0);
-  do_check_true(source.exists());
-
-  // Symlink updates/
-  let dest2 = getAppDir();
-  dest2.append("updates");
-  if (dest2.exists()) {
-    dest2.remove(true);
-  }
-  dest2.create(dest.DIRECTORY_TYPE, 0755);
-  do_check_true(dest2.exists());
-  let source2 = getUpdatesRootDir();
-  source2.append("updates");
-  if (source2.exists()) {
-    source2.remove(true);
-  }
-  ret = symlink(dest2.path, source2.path);
-  do_check_eq(ret, 0);
-  do_check_true(source2.exists());
-
-  // Cleanup the symlinks when the test is finished.
-  do_register_cleanup(function AUFIBD_cleanup() {
-    logTestInfo("start - unlinking symlinks");
-    let ret = unlink(source.path);
-    do_check_false(source.exists());
-    let ret = unlink(source2.path);
-    do_check_false(source2.exists());
-    logTestInfo("finish - unlinking symlinks");
-  });
-
-  // Now, make sure that getUpdatesRootDir returns the application bundle
-  // directory, to make the various stuff in the test framework to work
-  // correctly.
-  getUpdatesRootDir = getAppDir;
-}
-
 function run_test() {
   if (APP_BIN_NAME == "xulrunner") {
     logTestInfo("Unable to run this test on xulrunner");
     return;
   }
 
   if (IS_WIN) {
     var version = AUS_Cc["@mozilla.org/system-info;1"]
--- a/toolkit/mozapps/update/test/unit/test_0203_app_launch_apply_update.js
+++ b/toolkit/mozapps/update/test/unit/test_0203_app_launch_apply_update.js
@@ -36,83 +36,16 @@ const APP_TIMER_TIMEOUT = 120000;
 
 Components.utils.import("resource://gre/modules/ctypes.jsm");
 
 let gAppTimer;
 let gProcess;
 let gActiveUpdate;
 let gTimeoutRuns = 0;
 
-// Override getUpdatesRootDir on Mac because we need to apply the update
-// inside the bundle directory.
-function symlinkUpdateFilesIntoBundleDirectory() {
-  if (!shouldAdjustPathsOnMac()) {
-    return;
-  }
-  // Symlink active-update.xml and updates/ inside the dist/bin directory
-  // to point to the bundle directory.
-  // This is necessary because in order to test the code which actually ships
-  // with Firefox, we need to perform the update inside the bundle directory,
-  // whereas xpcshell runs from dist/bin/, and the updater service code looks
-  // at the current process directory to find things like these two files.
-
-  Components.utils.import("resource://gre/modules/ctypes.jsm");
-  let libc = ctypes.open("/usr/lib/libc.dylib");
-  // We need these two low level APIs because their functionality is not
-  // provided in nsIFile APIs.
-  let symlink = libc.declare("symlink", ctypes.default_abi, ctypes.int,
-                             ctypes.char.ptr, ctypes.char.ptr);
-  let unlink = libc.declare("unlink", ctypes.default_abi, ctypes.int,
-                            ctypes.char.ptr);
-
-  // Symlink active-update.xml
-  let dest = getAppDir();
-  dest.append("active-update.xml");
-  if (!dest.exists()) {
-    dest.create(dest.NORMAL_FILE_TYPE, 0644);
-  }
-  do_check_true(dest.exists());
-  let source = getUpdatesRootDir();
-  source.append("active-update.xml");
-  unlink(source.path);
-  let ret = symlink(dest.path, source.path);
-  do_check_eq(ret, 0);
-  do_check_true(source.exists());
-
-  // Symlink updates/
-  let dest2 = getAppDir();
-  dest2.append("updates");
-  if (dest2.exists()) {
-    dest2.remove(true);
-  }
-  dest2.create(dest.DIRECTORY_TYPE, 0755);
-  do_check_true(dest2.exists());
-  let source2 = getUpdatesRootDir();
-  source2.append("updates");
-  if (source2.exists()) {
-    source2.remove(true);
-  }
-  ret = symlink(dest2.path, source2.path);
-  do_check_eq(ret, 0);
-  do_check_true(source2.exists());
-
-  // Cleanup the symlinks when the test is finished.
-  do_register_cleanup(function() {
-    let ret = unlink(source.path);
-    do_check_false(source.exists());
-    let ret = unlink(source2.path);
-    do_check_false(source2.exists());
-  });
-
-  // Now, make sure that getUpdatesRootDir returns the application bundle
-  // directory, to make the various stuff in the test framework to work
-  // correctly.
-  getUpdatesRootDir = getAppDir;
-}
-
 function run_test() {
   if (APP_BIN_NAME == "xulrunner") {
     logTestInfo("Unable to run this test on xulrunner");
     return;
   }
 
   do_test_pending();
   do_register_cleanup(end_test);
--- a/toolkit/mozapps/update/test_svc/unit/test_0201_app_launch_apply_update_svc.js
+++ b/toolkit/mozapps/update/test_svc/unit/test_0201_app_launch_apply_update_svc.js
@@ -28,83 +28,16 @@ const MAX_TIMEOUT_RUNS = 300;
 // the test will try to kill it.
 const APP_TIMER_TIMEOUT = 120000;
 
 let gAppTimer;
 let gProcess;
 let gActiveUpdate;
 let gTimeoutRuns = 0;
 
-// Override getUpdatesRootDir on Mac because we need to apply the update
-// inside the bundle directory.
-function symlinkUpdateFilesIntoBundleDirectory() {
-  if (!shouldAdjustPathsOnMac()) {
-    return;
-  }
-  // Symlink active-update.xml and updates/ inside the dist/bin directory
-  // to point to the bundle directory.
-  // This is necessary because in order to test the code which actually ships
-  // with Firefox, we need to perform the update inside the bundle directory,
-  // whereas xpcshell runs from dist/bin/, and the updater service code looks
-  // at the current process directory to find things like these two files.
-
-  Components.utils.import("resource://gre/modules/ctypes.jsm");
-  let libc = ctypes.open("/usr/lib/libc.dylib");
-  // We need these two low level APIs because their functionality is not
-  // provided in nsIFile APIs.
-  let symlink = libc.declare("symlink", ctypes.default_abi, ctypes.int,
-                             ctypes.char.ptr, ctypes.char.ptr);
-  let unlink = libc.declare("unlink", ctypes.default_abi, ctypes.int,
-                            ctypes.char.ptr);
-
-  // Symlink active-update.xml
-  let dest = getAppDir();
-  dest.append("active-update.xml");
-  if (!dest.exists()) {
-    dest.create(dest.NORMAL_FILE_TYPE, 0644);
-  }
-  do_check_true(dest.exists());
-  let source = getUpdatesRootDir();
-  source.append("active-update.xml");
-  unlink(source.path);
-  let ret = symlink(dest.path, source.path);
-  do_check_eq(ret, 0);
-  do_check_true(source.exists());
-
-  // Symlink updates/
-  let dest2 = getAppDir();
-  dest2.append("updates");
-  if (dest2.exists()) {
-    dest2.remove(true);
-  }
-  dest2.create(dest.DIRECTORY_TYPE, 0755);
-  do_check_true(dest2.exists());
-  let source2 = getUpdatesRootDir();
-  source2.append("updates");
-  if (source2.exists()) {
-    source2.remove(true);
-  }
-  ret = symlink(dest2.path, source2.path);
-  do_check_eq(ret, 0);
-  do_check_true(source2.exists());
-
-  // Cleanup the symlinks when the test is finished.
-  do_register_cleanup(function() {
-    let ret = unlink(source.path);
-    do_check_false(source.exists());
-    let ret = unlink(source2.path);
-    do_check_false(source2.exists());
-  });
-
-  // Now, make sure that getUpdatesRootDir returns the application bundle
-  // directory, to make the various stuff in the test framework to work
-  // correctly.
-  getUpdatesRootDir = getAppDir;
-}
-
 function run_test() {
   if (!shouldRunServiceTest()) {
     return;
   }
 
   do_test_pending();
   do_register_cleanup(end_test);
 
--- a/toolkit/mozapps/update/test_svc/unit/test_0202_app_launch_apply_update_dirlocked_svc.js
+++ b/toolkit/mozapps/update/test_svc/unit/test_0202_app_launch_apply_update_dirlocked_svc.js
@@ -28,83 +28,16 @@ const FILE_UPDATER_INI_BAK = "updater.in
 const CHECK_TIMEOUT_MILLI = 1000;
 
 // How many of CHECK_TIMEOUT_MILLI to wait before we abort the test.
 const MAX_TIMEOUT_RUNS = 300;
 
 let gActiveUpdate;
 let gTimeoutRuns = 0;
 
-// Override getUpdatesRootDir on Mac because we need to apply the update
-// inside the bundle directory.
-function symlinkUpdateFilesIntoBundleDirectory() {
-  if (!shouldAdjustPathsOnMac()) {
-    return;
-  }
-  // Symlink active-update.xml and updates/ inside the dist/bin directory
-  // to point to the bundle directory.
-  // This is necessary because in order to test the code which actually ships
-  // with Firefox, we need to perform the update inside the bundle directory,
-  // whereas xpcshell runs from dist/bin/, and the updater service code looks
-  // at the current process directory to find things like these two files.
-
-  Components.utils.import("resource://gre/modules/ctypes.jsm");
-  let libc = ctypes.open("/usr/lib/libc.dylib");
-  // We need these two low level APIs because their functionality is not
-  // provided in nsIFile APIs.
-  let symlink = libc.declare("symlink", ctypes.default_abi, ctypes.int,
-                             ctypes.char.ptr, ctypes.char.ptr);
-  let unlink = libc.declare("unlink", ctypes.default_abi, ctypes.int,
-                            ctypes.char.ptr);
-
-  // Symlink active-update.xml
-  let dest = getAppDir();
-  dest.append("active-update.xml");
-  if (!dest.exists()) {
-    dest.create(dest.NORMAL_FILE_TYPE, 0644);
-  }
-  do_check_true(dest.exists());
-  let source = getUpdatesRootDir();
-  source.append("active-update.xml");
-  unlink(source.path);
-  let ret = symlink(dest.path, source.path);
-  do_check_eq(ret, 0);
-  do_check_true(source.exists());
-
-  // Symlink updates/
-  let dest2 = getAppDir();
-  dest2.append("updates");
-  if (dest2.exists()) {
-    dest2.remove(true);
-  }
-  dest2.create(dest.DIRECTORY_TYPE, 0755);
-  do_check_true(dest2.exists());
-  let source2 = getUpdatesRootDir();
-  source2.append("updates");
-  if (source2.exists()) {
-    source2.remove(true);
-  }
-  ret = symlink(dest2.path, source2.path);
-  do_check_eq(ret, 0);
-  do_check_true(source2.exists());
-
-  // Cleanup the symlinks when the test is finished.
-  do_register_cleanup(function() {
-    let ret = unlink(source.path);
-    do_check_false(source.exists());
-    let ret = unlink(source2.path);
-    do_check_false(source2.exists());
-  });
-
-  // Now, make sure that getUpdatesRootDir returns the application bundle
-  // directory, to make the various stuff in the test framework to work
-  // correctly.
-  getUpdatesRootDir = getAppDir;
-}
-
 function run_test() {
   if (!shouldRunServiceTest()) {
     return;
   }
 
   do_test_pending();
   do_register_cleanup(end_test);
 
--- a/toolkit/mozapps/update/test_svc/unit/test_0203_app_launch_apply_update_svc.js
+++ b/toolkit/mozapps/update/test_svc/unit/test_0203_app_launch_apply_update_svc.js
@@ -36,83 +36,16 @@ const APP_TIMER_TIMEOUT = 120000;
 
 Components.utils.import("resource://gre/modules/ctypes.jsm");
 
 let gAppTimer;
 let gProcess;
 let gActiveUpdate;
 let gTimeoutRuns = 0;
 
-// Override getUpdatesRootDir on Mac because we need to apply the update
-// inside the bundle directory.
-function symlinkUpdateFilesIntoBundleDirectory() {
-  if (!shouldAdjustPathsOnMac()) {
-    return;
-  }
-  // Symlink active-update.xml and updates/ inside the dist/bin directory
-  // to point to the bundle directory.
-  // This is necessary because in order to test the code which actually ships
-  // with Firefox, we need to perform the update inside the bundle directory,
-  // whereas xpcshell runs from dist/bin/, and the updater service code looks
-  // at the current process directory to find things like these two files.
-
-  Components.utils.import("resource://gre/modules/ctypes.jsm");
-  let libc = ctypes.open("/usr/lib/libc.dylib");
-  // We need these two low level APIs because their functionality is not
-  // provided in nsIFile APIs.
-  let symlink = libc.declare("symlink", ctypes.default_abi, ctypes.int,
-                             ctypes.char.ptr, ctypes.char.ptr);
-  let unlink = libc.declare("unlink", ctypes.default_abi, ctypes.int,
-                            ctypes.char.ptr);
-
-  // Symlink active-update.xml
-  let dest = getAppDir();
-  dest.append("active-update.xml");
-  if (!dest.exists()) {
-    dest.create(dest.NORMAL_FILE_TYPE, 0644);
-  }
-  do_check_true(dest.exists());
-  let source = getUpdatesRootDir();
-  source.append("active-update.xml");
-  unlink(source.path);
-  let ret = symlink(dest.path, source.path);
-  do_check_eq(ret, 0);
-  do_check_true(source.exists());
-
-  // Symlink updates/
-  let dest2 = getAppDir();
-  dest2.append("updates");
-  if (dest2.exists()) {
-    dest2.remove(true);
-  }
-  dest2.create(dest.DIRECTORY_TYPE, 0755);
-  do_check_true(dest2.exists());
-  let source2 = getUpdatesRootDir();
-  source2.append("updates");
-  if (source2.exists()) {
-    source2.remove(true);
-  }
-  ret = symlink(dest2.path, source2.path);
-  do_check_eq(ret, 0);
-  do_check_true(source2.exists());
-
-  // Cleanup the symlinks when the test is finished.
-  do_register_cleanup(function() {
-    let ret = unlink(source.path);
-    do_check_false(source.exists());
-    let ret = unlink(source2.path);
-    do_check_false(source2.exists());
-  });
-
-  // Now, make sure that getUpdatesRootDir returns the application bundle
-  // directory, to make the various stuff in the test framework to work
-  // correctly.
-  getUpdatesRootDir = getAppDir;
-}
-
 function run_test() {
   if (!shouldRunServiceTest()) {
     return;
   }
 
   do_test_pending();
   do_register_cleanup(end_test);