Tizen 2.0 Release
[framework/graphics/cairo.git] / TC / testcase / utc_spline_decomposition_image.c
1 #include <tet_api.h>
2 #include <cairo/cairo.h>
3 #include <cairo/cairo-script-interpreter.h>
4
5 #include "cairo-test.h"
6
7 #include <unistd.h>
8 #include <sys/wait.h>
9
10 static void startup(void);
11 static void cleanup(void);
12
13 void (*tet_startup)(void) = startup;
14 void (*tet_cleanup)(void) = cleanup;
15
16 static void utc_cairo_spline_decomposition1(void);
17
18 struct tet_testlist tet_testlist[] = {
19         { utc_cairo_spline_decomposition1, 1 },
20         { NULL, 0 },
21 };
22
23 static void startup(void)
24 {
25         /* start of TC */
26 }
27
28 static void cleanup(void)
29 {
30         /* end of TC */
31 }
32
33 static void utc_cairo_spline_decomposition1(void)
34 {
35         char buf[128];
36         int ret;
37         sprintf(buf, "cd %s && ./cairo-test-suite spline-decomposition", getenv("CAIRO_TC_ROOT_PATH"));
38         int pid=0;
39         int status=0;
40
41         pid = fork();
42         if(pid > 0) {
43                 if (waitpid(pid,&status,0) != pid) {
44                         fprintf(stderr, "Failed to wait!!!");
45                         exit(EXIT_FAILURE);
46                 }
47                 if(WIFEXITED(status)) {
48                         ret=status;
49                         if(WEXITSTATUS(ret) == CAIRO_TEST_SUCCESS)
50                                 dts_pass("utc_cairo_spline_decomposition1");
51                         else
52                                 dts_fail("utc_cairo_spline_decomposition1");
53                 }
54         }
55         else if(pid == 0) {
56                 char *env[]={"CAIRO_TEST_TARGET=image", (char *)0};
57                 char parse0[4]={0,};
58                 char parse1[1024]={0,};
59                 char parse2[4]={0,};
60                 char parse3[32]={0,};
61                 char parse4[32]={0,};
62                 sscanf(buf,"%s %s %s %s %s", parse0, parse1, parse2, parse3, parse4 );
63                 chdir(parse1);
64                 execle(parse3, parse3, parse4, NULL, env);
65         }
66         else {
67                 fprintf(stderr, "Failed to fork!!!");
68                 exit(EXIT_FAILURE);
69         }
70 }