[librsvg/wip/otte: 20/39] tests: Make crash test accept commandline args
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/wip/otte: 20/39] tests: Make crash test accept commandline args
- Date: Tue, 20 Oct 2015 12:35:26 +0000 (UTC)
commit 7b2c324614cc789cb127bb8f7f98fb9403c72a07
Author: Benjamin Otte <otte redhat com>
Date: Wed Oct 14 20:22:22 2015 +0200
tests: Make crash test accept commandline args
Again, copied from gdk-pixbuf
tests/crash.c | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/tests/crash.c b/tests/crash.c
index 832f9be..57c2ba7 100644
--- a/tests/crash.c
+++ b/tests/crash.c
@@ -28,12 +28,24 @@ main (int argc, char *argv[])
RSVG_G_TYPE_INIT;
g_test_init (&argc, &argv, NULL);
- base = g_file_new_for_path (test_utils_get_test_data_path ());
- crash = g_file_get_child (base, "crash");
- test_utils_add_test_for_all_files ("/crash", crash, crash, test_crash, NULL);
- g_object_unref (base);
- g_object_unref (crash);
-
+ if (argc < 2) {
+ base = g_file_new_for_path (test_utils_get_test_data_path ());
+ crash = g_file_get_child (base, "crash");
+ test_utils_add_test_for_all_files ("/crash", crash, crash, test_crash, NULL);
+ g_object_unref (base);
+ g_object_unref (crash);
+ } else {
+ guint i;
+
+ for (i = 1; i < argc; i++) {
+ GFile *file = g_file_new_for_commandline_arg (argv[i]);
+
+ test_utils_add_test_for_all_files ("/crash", NULL, file, test_crash, NULL);
+
+ g_object_unref (file);
+ }
+ }
+
result = g_test_run ();
rsvg_cleanup ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]