示例#1
0
static void
parse_args(int *argc, char **argv,
	   const char ***selected_subtests,
	   size_t *num_selected_subtests)
{
	*selected_subtests = NULL;
	*num_selected_subtests = 0;

	prog_name = basename(argv[0]);
	if (*argc == 1) {
		return;
	}

	if (streq(argv[1], "-h") || streq(argv[1], "--help")) {
		print_usage();
		exit(0);
	}

	/* Strip common piglit args. */
	piglit_strip_arg(argc, argv, "-fbo");
	piglit_strip_arg(argc, argv, "-auto");

	piglit_parse_subtest_args(argc, argv, subtests, selected_subtests,
			          num_selected_subtests);

	if (*argc > 1) {
		piglit_loge("unrecognized option: %s", argv[1]);
		usage_error();
	}
}
int
main(int argc, char **argv)
{
	GLenum internal_format = 0;

	EGLDisplay dpy;
	EGLContext ctx;
	bool ok;

	/* Strip common piglit args. */
	piglit_strip_arg(&argc, argv, "-fbo");
	piglit_strip_arg(&argc, argv, "-auto");

	if (argc == 2) {
		if (streq(argv[1], "GL_RGBA")) {
			internal_format = GL_RGBA;
		} else if (streq(argv[1], "GL_DEPTH_COMPONENT24")) {
			internal_format = GL_DEPTH_COMPONENT24;
		}
	}

	if (internal_format == 0)
		usage_error();

	dpy = create_display();
	ctx = create_context(dpy);

	ok = eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, ctx);
	if (!ok) {
		piglit_loge("failed to make context current without surface");
		piglit_report_result(PIGLIT_FAIL);
	}

	piglit_dispatch_default_init(PIGLIT_DISPATCH_ES2);

	if (!piglit_is_extension_supported("GL_OES_EGL_image")) {
		piglit_loge("context does not support GL_OES_EGL_image");
		piglit_report_result(PIGLIT_SKIP);
	}

	switch (internal_format) {
	case GL_RGBA:
		test_rgba(dpy, ctx);
		break;
	case GL_DEPTH_COMPONENT24:
		test_depth24(dpy, ctx);
		break;
	default:
		break;
	}

	/* unreachable */
	abort();
}
int
main(int argc, char **argv)
{
	prog_name = argv[0];

	piglit_strip_arg(&argc, argv, "-auto");
	piglit_strip_arg(&argc, argv, "-fbo");

	if (argc != 2)
		usage_error();

	if (strcmp(argv[1], "1") == 0) {
		test_1();
	} else if (strcmp(argv[1], "2") == 0) {
		test_2();
	} else if (strcmp(argv[1], "3") == 0) {
		test_3();
	} else {
		usage_error();
	}

	abort();
}
int
main(int argc, char **argv)
{
	enum piglit_result result = PIGLIT_SKIP;
	const char **selected_names = NULL;
	size_t num_selected = 0;

	/* Strip common piglit args. */
	piglit_strip_arg(&argc, argv, "-fbo");
	piglit_strip_arg(&argc, argv, "-auto");

	piglit_parse_subtest_args(&argc, argv, subtests, &selected_names,
				  &num_selected);

	if (argc > 1) {
		fprintf(stderr, "usage error\n");
		piglit_report_result(PIGLIT_FAIL);
	}

	init_egl_extension_funcs();
	result = piglit_run_selected_subtests(subtests, selected_names,
					      num_selected, result);
	piglit_report_result(result);
}
示例#5
0
int
main(int argc, char **argv)
{
	progname = argv[0];
	piglit_strip_arg(&argc, argv, "-auto");

	if (argc != 2)
		usage_error();

	if (strcmp(argv[1], "gl") == 0) {
		try_debug_flag(EGL_OPENGL_API, EGL_OPENGL_BIT);
	} else if (strcmp(argv[1], "gles1") == 0) {
		try_debug_flag(EGL_OPENGL_ES_API, EGL_OPENGL_ES_BIT);
	} else if (strcmp(argv[1], "gles2") == 0) {
		try_debug_flag(EGL_OPENGL_ES_API, EGL_OPENGL_ES2_BIT);
	} else if (strcmp(argv[1], "gles3") == 0) {
		try_debug_flag(EGL_OPENGL_ES_API, EGL_OPENGL_ES3_BIT_KHR);
	} else {
		usage_error();
	}

	abort();
	return EXIT_FAILURE;
}