Example #1
0
int main(int argc, char **argv)
{
	int lc;
	char *msg;		/* message returned from parse_opts */
	int sfd;

	if ((tst_kvercmp(2, 6, 22)) < 0) {
		tst_resm(TWARN,
			 "This test can only run on kernels that are 2.6.22 and higher");
		exit(0);
	}

	if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL) {
		tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
	}

	setup();
	for (lc = 0; TEST_LOOPING(lc); lc++) {
		Tst_count = 0;

		sfd = do_test1(lc, SIGUSR1);
		if (sfd < 0)
			continue;

		do_test2(lc, sfd, SIGUSR2);
		close(sfd);
	}

	cleanup();

	return 0;
}
Example #2
0
int main(void)
{
	do_test1();
	do_test2();

	return 0;
}
void DoInstall::run() {
    if (testing) device_path = "/dev/vda";

    parted::Device dev(device_path);

    if (!dev.open()) {
        qDebug() << "unable to open disk";
    }
    PartitionState state = do_test1(dev.dev, label_type::gpt);
    if (!dev.close()) {
        qDebug() << "unable to close disk";
    }
    partition_drives(state);

    hostWindow->mounts.clear();
    hostWindow->mounts.append(installer::MountPoint(state.root_path,"/mnt"));
    hostWindow->mounts.append(installer::MountPoint(state.boot_path,"/mnt/boot"));

    hostWindow->installer = new LibInstaller;
    if (!hostWindow->installer->mountPaths(hostWindow->mounts)) {
        qDebug() << "failed to mount all paths";
        abort();
    }
    QProcess::execute("nixos-generate-config --root /mnt");
    QFile config("/mnt/etc/nixos/configuration.nix");
    config.open(QFile::WriteOnly);
    QString cfg = QString("{ lib, config, pkgs, ...}:\n"
                          "{\n"
                          "  imports = [\n"
                          "    ./hardware-configuration.nix\n"
                          "    <nixpkgs/nixos/modules/testing/test-instrumentation.nix>\n"
                          "  ];\n"
                          "  users.mutableUsers = false;\n"
                          "  boot.loader.grub.device = \"/dev/vda\";\n"
                          "}");
    QByteArray bytes = cfg.toLocal8Bit();
    config.write(bytes.data(),bytes.size());
    config.close();
    emit start_install();
}
Example #4
0
int main(int argc, char **argv)
{
   int i, j, k, l, m;
   ALLEGRO_COLOR src_colors[2];
   ALLEGRO_COLOR dst_colors[2];
   ALLEGRO_COLOR blend_colors[2];
   int src_formats[2] = {
      ALLEGRO_PIXEL_FORMAT_ABGR_8888,
      ALLEGRO_PIXEL_FORMAT_BGR_888
      };
   int dst_formats[2] = {
      ALLEGRO_PIXEL_FORMAT_ABGR_8888,
      ALLEGRO_PIXEL_FORMAT_BGR_888
      };
   src_colors[0] = C(0, 0, 0, 1);
   src_colors[1] = C(1, 1, 1, 1);
   dst_colors[0] = C(1, 1, 1, 1);
   dst_colors[1] = C(0, 0, 0, 0);
   blend_colors[0] = C(1, 1, 1, 0.5);
   blend_colors[1] = C(1, 1, 1, 1);

   for (i = 1; i < argc; i++) {
      if (!strcmp(argv[i], "-d"))
         test_display = 1;
      else
         test_only_index = strtol(argv[i], NULL, 10);
   }

   al_init();
   
   if (test_display)
      al_create_display(100, 100);

   for (i = 0; i < 2; i++) {
      for (j = 0; j < 2; j++) {
         for (k = 0; k < 2; k++) {
            for (l = 0; l < 2; l++) {
               for (m = 0; m < 2; m++) {
                  do_test1(
                     src_colors[i],
                     dst_colors[j],
                     blend_colors[k],
                     src_formats[l],
                     dst_formats[m]);
               }
            }
         }
      }
   }
   printf("\n");
   
   if (test_only_index && test_display) {
      ALLEGRO_EVENT_QUEUE *queue;
      ALLEGRO_EVENT event;
      al_flip_display();
      al_install_keyboard();
      queue = al_create_event_queue();
      al_register_event_source(queue, al_get_keyboard_event_source());
      al_wait_for_event(queue, &event);
   }

   return 0;
}
Example #5
0
int main(int argc, char **argv)
{
   int i, j, l, m;
   ALLEGRO_COLOR src_colors[2];
   ALLEGRO_COLOR dst_colors[2];
   int src_formats[2] = {
      ALLEGRO_PIXEL_FORMAT_ABGR_8888,
      ALLEGRO_PIXEL_FORMAT_BGR_888
      };
   int dst_formats[2] = {
      ALLEGRO_PIXEL_FORMAT_ABGR_8888,
      ALLEGRO_PIXEL_FORMAT_BGR_888
      };
   src_colors[0] = C(0, 0, 0, 1);
   src_colors[1] = C(1, 1, 1, 1);
   dst_colors[0] = C(1, 1, 1, 1);
   dst_colors[1] = C(0, 0, 0, 0);

   for (i = 1; i < argc; i++) {
      if (!strcmp(argv[i], "-d"))
         test_display = 1;
      else
         test_only_index = strtol(argv[i], NULL, 10);
   }

   if (!al_init()) {
       abort_example("Could not initialise Allegro\n");
   }

   open_log();

   al_init_primitives_addon();
   if (test_display) {
      display = al_create_display(100, 100);
      if (!display) {
         abort_example("Unable to create display\n");
      }
   }

   for (i = 0; i < 2; i++) {
      for (j = 0; j < 2; j++) {
         for (l = 0; l < 2; l++) {
            for (m = 0; m < 2; m++) {
               do_test1(
                  src_colors[i],
                  dst_colors[j],
                  src_formats[l],
                  dst_formats[m]);
            }
         }
      }
   }
   log_printf("\nDone\n");
   
   if (test_only_index && test_display) {
      ALLEGRO_EVENT_QUEUE *queue;
      ALLEGRO_EVENT event;
      al_flip_display();
      al_install_keyboard();
      queue = al_create_event_queue();
      al_register_event_source(queue, al_get_keyboard_event_source());
      al_wait_for_event(queue, &event);
   }

   close_log(true);

   return 0;
}