예제 #1
0
파일: testnotify.c 프로젝트: jeffhammond/ga
int main(int argc, char *argv[])
{
  int ndim;

  armci_msg_init(&argc, &argv);
  ARMCI_Init_args(&argc, &argv);
  nproc = armci_msg_nproc();
  me = armci_msg_me();

  ARMCI_Barrier();
  if (me == 0) {
    printf("\nTesting armci_notify\n");
    fflush(stdout);
    sleep(1);
  }
  ARMCI_Barrier();

  for (ndim = 1; ndim <= MAXDIMS; ndim++) {
    test_notify(ndim);
  }
  ARMCI_Barrier();

  ARMCI_Finalize();
  armci_msg_finalize();
  return(0);
}
예제 #2
0
void test_diff_notify__notify_catchall_with_empty_pathspecs(void)
{
	char *searched_pathspecs[] = {
		"",
		""
	};
	notify_expected expected_matched_pathspecs[] = {
		{ "file_deleted", NULL },
		{ "ignored_file", NULL },
		{ "modified_file", NULL },
		{ "new_file", NULL },
		{ "\xe8\xbf\x99", NULL },
		{ "staged_changes_file_deleted", NULL },
		{ "staged_changes_modified_file", NULL },
		{ "staged_delete_modified_file", NULL },
		{ "staged_new_file_deleted_file", NULL },
		{ "staged_new_file_modified_file", NULL },
		{ "subdir/deleted_file", NULL },
		{ "subdir/modified_file", NULL },
		{ "subdir/new_file", NULL },
		{ NULL, NULL }
	};

	test_notify(searched_pathspecs, 1, expected_matched_pathspecs, 13);
}
예제 #3
0
void test_diff_notify__notify_single_pathspec(void)
{
	char *searched_pathspecs[] = {
		"*_deleted",
	};
	notify_expected expected_matched_pathspecs[] = {
		{ "file_deleted", "*_deleted" },
		{ "staged_changes_file_deleted", "*_deleted" },
		{ NULL, NULL }
	};

	test_notify(searched_pathspecs, 1, expected_matched_pathspecs, 2);
}
예제 #4
0
void test_diff_notify__notify_multiple_pathspec(void)
{
	char *searched_pathspecs[] = {
		"staged_changes_cant_find_me",
		"subdir/modified_cant_find_me",
		"subdir/*",
		"staged*"
	};
	notify_expected expected_matched_pathspecs[] = {
		{ "staged_changes_file_deleted", "staged*" },
		{ "staged_changes_modified_file", "staged*" },
		{ "staged_delete_modified_file", "staged*" },
		{ "staged_new_file_deleted_file", "staged*" },
		{ "staged_new_file_modified_file", "staged*" },
		{ "subdir/deleted_file", "subdir/*" },
		{ "subdir/modified_file", "subdir/*" },
		{ "subdir/new_file", "subdir/*" },
		{ NULL, NULL }
	};

	test_notify(searched_pathspecs, 4, expected_matched_pathspecs, 8);
}