Nux

Merge lp:~didrocks/nux/unity_support_test_caching into lp:nux

Proposed by Didier Roche-Tolomelli
Status: Merged
Merged at revision: 449
Proposed branch: lp:~didrocks/nux/unity_support_test_caching
Merge into: lp:nux
Diff against target: 65 lines (+24/-6)
1 file modified
tools/unity_support_test.c (+24/-6)
To merge this branch: bzr merge lp:~didrocks/nux/unity_support_test_caching
Reviewer Review Type Date Requested Status
Jay Taoko (community) Approve
Review via email: mp+74214@code.launchpad.net

Description of the change

add a new unity_support_test cache file to speed up consecutive run and an option to bypass it (LP: #842656)

To post a comment you must log in.
Revision history for this message
Jay Taoko (jaytaoko) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tools/unity_support_test.c'
--- tools/unity_support_test.c 2011-06-13 08:17:36 +0000
+++ tools/unity_support_test.c 2011-09-06 13:13:15 +0000
@@ -484,17 +484,14 @@
484 Display *display = NULL;484 Display *display = NULL;
485 GLXContext context = NULL;485 GLXContext context = NULL;
486 TestResults results;486 TestResults results;
487 char resultfilename[30];
488 FILE *resultfile;
489 int forcecheck = 0;
487490
488 results.indirect = 0;491 results.indirect = 0;
489 results.compiz = 0;492 results.compiz = 0;
490 results.flags = 0;493 results.flags = 0;
491 results.error = NULL;494 results.error = NULL;
492 results.flags = 0;
493
494 if (getenv ("UNITY_FORCE_START")) {
495 fprintf (stdout, "Warning: UNITY_FORCE_START enabled, no check for unity or compiz support.\n");
496 return 0;
497 }
498495
499 // Basic command-line parsing.496 // Basic command-line parsing.
500 for (int i = 1; i < argc; i++) {497 for (int i = 1; i < argc; i++) {
@@ -512,6 +509,9 @@
512 } else if ((strncmp (argv[i], "-c", 2) == 0) ||509 } else if ((strncmp (argv[i], "-c", 2) == 0) ||
513 (strncmp (argv[i], "--compiz", 8) == 0)) {510 (strncmp (argv[i], "--compiz", 8) == 0)) {
514 results.compiz = 1;511 results.compiz = 1;
512 } else if ((strncmp (argv[i], "-f", 2) == 0) ||
513 (strncmp (argv[i], "--force-check", 13) == 0)) {
514 forcecheck = 1;
515 } else if ((strncmp (argv[i], "-h", 2) == 0) ||515 } else if ((strncmp (argv[i], "-h", 2) == 0) ||
516 (strncmp (argv[i], "--help", 6) == 0)) {516 (strncmp (argv[i], "--help", 6) == 0)) {
517 print_help ();517 print_help ();
@@ -523,6 +523,19 @@
523 }523 }
524 }524 }
525525
526 // can skip some tests if not forced
527 if (!forcecheck) {
528 resultfile = fopen("/tmp/unity_support_test.0", "r");
529 if (resultfile) {
530 fclose(resultfile);
531 return 0;
532 }
533 if (getenv ("UNITY_FORCE_START")) {
534 fprintf (stdout, "Warning: UNITY_FORCE_START enabled, no check for unity or compiz support.\n");
535 return 0;
536 }
537 }
538
526 // Open a X11 connection and get the root window.539 // Open a X11 connection and get the root window.
527 display = XOpenDisplay (display_name);540 display = XOpenDisplay (display_name);
528 if (display == NULL) {541 if (display == NULL) {
@@ -587,5 +600,10 @@
587 if (results.error != NULL)600 if (results.error != NULL)
588 free (results.error);601 free (results.error);
589602
603 // drop result file
604 sprintf(resultfilename, "/tmp/unity_support_test.%i", results.result);
605 resultfile = fopen(resultfilename, "w");
606 fclose(resultfile);
607
590 return results.result;608 return results.result;
591}609}

Subscribers

People subscribed via source and target branches