summaryrefslogtreecommitdiffstatsci
path: root/src/caskbench.cpp
diff options
context:
space:
mode:
authorBryce Harrington <b.harrington@samsung.com>2014-06-07 03:29:54 +0900
committerBryce Harrington <b.harrington@samsung.com>2014-06-07 03:29:54 +0900
commit44e4036a74e0be8e960bc30a77b57fa6f44bea72 (patch)
tree54811f7a5b823559fd2166c5ac74cdeca938f9d7 /src/caskbench.cpp
parent79c8e88722f523363abeef95d2a4ce1511fc80d8 (diff)
parent49500c1a630e8df30ae2ba189c8d982bf2d6fac6 (diff)
Merge pull request #86 from Samsung/Issue_77
Add ENABLE_CAIRO option to permit building caskbench without Cairo support. ref: https://github.com/Samsung/caskbench/issues/77
Diffstat (limited to 'src/caskbench.cpp')
-rw-r--r--src/caskbench.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/caskbench.cpp b/src/caskbench.cpp
index 3260ed1..e813363 100644
--- a/src/caskbench.cpp
+++ b/src/caskbench.cpp
@@ -393,6 +393,10 @@ process_drawing_libs (const char *libs, int &num_tests, int *test_ids)
bool skia_cairo = false;
memset(filter, 0, sizeof(filter));
+#ifndef USE_CAIRO
+ if (strstr(libs, "cairo"))
+ errx (0, "cairo is unavailable in the build\n");
+#endif
#ifndef USE_SKIA
if (strstr(libs, "skia"))
errx (0, "skia is unavailable in this build\n");
@@ -430,27 +434,43 @@ process_drawing_libs (const char *libs, int &num_tests, int *test_ids)
void populate_user_tests (const char** tests, int& num_tests, int* test_ids)
{
int i = 0, id = -1, test_index = 0;
+ char skia_test[MAX_BUFFER];
+ char cairo_test[MAX_BUFFER];
+ strncpy(cairo_test, "cairo-", 6);
+ strncpy(skia_test, "skia-", 5);
if (tests == NULL)
return;
while (tests[i] != NULL) {
- id = convertToTestId (tests[i]);
- if (id < 0)
+ if (strlen(tests[i]) >= MAX_BUFFER)
errx (0, "Incorrect test case, please check the test case provided as input \n");
+ /* We can assume no more that skia test will be next to cairo */
+ cairo_test[6] = skia_test[5] = '\0';
+ strncat(cairo_test, tests[i], strlen(tests[i]));
+ strncat(skia_test, tests[i], strlen(tests[i]));
+
+#ifdef USE_CAIRO
/* Add cairo test index to the test list */
+ id = convertToTestId (cairo_test);
+ if (id < 0)
+ errx (0, "Incorrect test case, please check the test case provided as input \n");
test_ids[test_index++] = id;
+ num_tests = num_tests + 1;
+#endif
#ifdef USE_SKIA
/* Add skia test index to the test list */
- test_ids[test_index++] = id + 1;
- num_tests = num_tests + 2;
-#else
+ id = convertToTestId (skia_test);
+ if (id < 0)
+ errx (0, "Incorrect test case, please check the test case provided as input \n");
+ test_ids[test_index++] = id;
num_tests = num_tests + 1;
#endif
i++;
}
}
+
int
main (int argc, char *argv[])
{