Enlightenment CVS committal
Author : dj2
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src/bin
Modified Files:
main.c
Log Message:
- add an option to hide the passed unit test output
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/main.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -3 -r1.77 -r1.78
--- main.c 8 Nov 2007 23:09:31 -0000 1.77
+++ main.c 10 Nov 2007 03:58:52 -0000 1.78
@@ -84,6 +84,7 @@
static Ecore_Path_Group *tests_path_group = NULL;
static int window_count = 0;
static int current_unit_test = 0;
+static int hide_passed = 0;
static Ecore_Timer *unit_test_timer = NULL;
static Ewl_Test *current_test = NULL;
@@ -111,10 +112,13 @@
"\t-all\tRun tests for all widgets\n"
"\t-help\tDisplay this help text\n"
"\t-list\tPrint available tests\n"
+ "\t-p\tHide passed test information\n"
"\t-unit\tRun unit tests\n",
argv[0]);
exit(0);
}
+ else if (!strncmp(argv[i], "-p", 2))
+ hide_passed = 1;
else if (!strncmp(argv[i], "-all", 4))
all_tests = 1;
else if (!strncmp(argv[i], "-unit", 5))
@@ -126,7 +130,7 @@
/* initialize the ewl library */
if (!ewl_init(&argc, argv))
{
- printf("Unable to init EWL.\n");
+ printf("Unable to init Ewl.\n");
return 1;
}
@@ -136,7 +140,6 @@
return 1;
}
-
if (profile_tests) start_time = ecore_time_get();
/* check for any flags */
@@ -153,14 +156,12 @@
if (unit_test)
ret = run_unit_tests(t);
else
- run_window_test(t, MAIN_WIDTH,
- MAIN_HEIGHT);
+ run_window_test(t, MAIN_WIDTH,
MAIN_HEIGHT);
ran_test ++;
if (!all_tests) break;
}
}
-
if (all_tests) break;
}
@@ -302,11 +303,13 @@
{
int ret;
- printf("Running %s: ", test->unit_tests[i].name);
ret = test->unit_tests[i].func(buf, sizeof(buf));
- printf("%s %s\n", (ret ? "PASSED" : "FAILED"),
- (ret ? "" : buf));
-
+ if (!ret || !hide_passed)
+ {
+ printf("Running %s: ", test->unit_tests[i].name);
+ printf("%s %s\n", (ret ? "PASSED" : "FAILED"),
+ (ret ? "" : buf));
+ }
buf[0] = '\0';
if (!ret) failures++;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs