~ubuntu-branches/debian/sid/glib2.0/sid

« back to all changes in this revision

Viewing changes to glib/gtester.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-05-08 06:25:57 UTC
  • mfrom: (1.27.14) (3.1.181 experimental)
  • Revision ID: package-import@ubuntu.com-20130508062557-i7gbku66mls70gi2
Tags: 2.36.1-2
Merge experimental branch, upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
18
 * Boston, MA 02111-1307, USA.
19
19
 */
 
20
#include "config.h"
 
21
 
20
22
#include <glib.h>
 
23
#include <glib-unix.h>
21
24
#include <gstdio.h>
22
25
#include <string.h>
23
26
#include <stdlib.h>
283
286
  gboolean loop_pending;
284
287
  gint i = 0;
285
288
 
286
 
  if (pipe (report_pipe) < 0)
 
289
  if (!g_unix_open_pipe (report_pipe, FD_CLOEXEC, &error))
287
290
    {
288
291
      if (subtest_mode_fatal)
289
 
        g_error ("Failed to open pipe for test binary: %s: %s", binary, g_strerror (errno));
 
292
        g_error ("Failed to open pipe for test binary: %s: %s", binary, error->message);
290
293
      else
291
 
        g_warning ("Failed to open pipe for test binary: %s: %s", binary, g_strerror (errno));
 
294
        g_warning ("Failed to open pipe for test binary: %s: %s", binary, error->message);
 
295
      g_clear_error (&error);
292
296
      return FALSE;
293
297
    }
294
298
 
474
478
      g_print ("gtester version %d.%d.%d\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
475
479
      return;
476
480
    }
477
 
  g_print ("Usage: gtester [OPTIONS] testprogram...\n");
 
481
  g_print ("Usage:\n");
 
482
  g_print ("gtester [OPTIONS] testprogram...\n\n");
478
483
  /*        12345678901234567890123456789012345678901234567890123456789012345678901234567890 */
479
 
  g_print ("Options:\n");
480
 
  g_print ("  -h, --help                  show this help message\n");
481
 
  g_print ("  -v, --version               print version informations\n");
482
 
  g_print ("  --g-fatal-warnings          make warnings fatal (abort)\n");
483
 
  g_print ("  -k, --keep-going            continue running after tests failed\n");
484
 
  g_print ("  -l                          list paths of available test cases\n");
485
 
  g_print ("  -m=perf, -m=slow, -m=quick -m=thorough\n");
486
 
  g_print ("                              run test cases in mode perf, slow/thorough or quick (default)\n");
487
 
  g_print ("  -m=no-undefined             don't run test cases that provoke assertions\n");
488
 
  g_print ("  -p=TESTPATH                 only start test cases matching TESTPATH\n");
489
 
  g_print ("  -s=TESTPATH                 skip test cases matching TESTPATH\n");
490
 
  g_print ("  --seed=SEEDSTRING           start all tests with random number seed SEEDSTRING\n");
491
 
  g_print ("  -o=LOGFILE                  write the test log to LOGFILE\n");
492
 
  g_print ("  -q, --quiet                 suppress per test binary output\n");
493
 
  g_print ("  --verbose                   report success per testcase\n");
 
484
  g_print ("Help Options:\n");
 
485
  g_print ("  -h, --help                    Show this help message\n\n");
 
486
  g_print ("Utility Options:\n");
 
487
  g_print ("  -v, --version                 Print version informations\n");
 
488
  g_print ("  --g-fatal-warnings            Make warnings fatal (abort)\n");
 
489
  g_print ("  -k, --keep-going              Continue running after tests failed\n");
 
490
  g_print ("  -l                            List paths of available test cases\n");
 
491
  g_print ("  -m {perf|slow|thorough|quick} Run test cases according to mode\n");
 
492
  g_print ("  -m {undefined|no-undefined}   Run test cases according to mode\n");
 
493
  g_print ("  -p=TESTPATH                   Only start test cases matching TESTPATH\n");
 
494
  g_print ("  -s=TESTPATH                   Skip test cases matching TESTPATH\n");
 
495
  g_print ("  --seed=SEEDSTRING             Start tests with random seed SEEDSTRING\n");
 
496
  g_print ("  -o=LOGFILE                    Write the test log to LOGFILE\n");
 
497
  g_print ("  -q, --quiet                   Suppress per test binary output\n");
 
498
  g_print ("  --verbose                     Report success per testcase\n");
494
499
}
495
500
 
496
501
static void