aboutsummaryrefslogtreecommitdiffhomepage
path: root/gyp/canvas_state_lib.gyp
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@google.com>2014-07-22 12:38:55 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-22 12:38:55 -0700
commit24519371cb541db6f59d903d21878ed9c45eb549 (patch)
tree3aeaca2a3da03607d7494c8b3deef5c4045a9d07 /gyp/canvas_state_lib.gyp
parentc0bc9134514a4f138621203a6f7d4553ebec238a (diff)
Run CanvasState test across a library boundary.
Refactor CanvasStateTest to pull out functions which can either be called directly or from a shared library. Add a command line flag to pass in the path to a library to open to call those functions from. Separate different CanvasTest tests into separate DEF_TEST tests. This allows them to be run in parallel. Move the ifdefs outside of function declarations to skip running CanvasTest tests which do nothing. Add the canvas_state_lib target. It is a shared library that exports some functions to be called by another version of Skia. BUG=b/15693384 R=djsollen@google.com, reed@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/400043003
Diffstat (limited to 'gyp/canvas_state_lib.gyp')
-rw-r--r--gyp/canvas_state_lib.gyp37
1 files changed, 37 insertions, 0 deletions
diff --git a/gyp/canvas_state_lib.gyp b/gyp/canvas_state_lib.gyp
new file mode 100644
index 0000000000..1bb2fe4a25
--- /dev/null
+++ b/gyp/canvas_state_lib.gyp
@@ -0,0 +1,37 @@
+# Building test for running CanvasState
+
+# HOW TO USE:
+# This target is not included in normal Skia builds. In order to build it,
+# you need to run gyp_skia on this file. This target also requires the
+# variable skia_pic to be used during building:
+#
+# GYP_DEFINES=skia_pic=1 ./gyp_skia gyp/canvas_state_lib.gyp
+# ninja -C out/Debug canvas_state_lib
+#
+# This will create the shared library libcanvas_state_lib.so. That can
+# be passed to tests to test passing an SkCanvas between versions of
+# Skia. See tests/CanvasStateTest.cpp for more info.
+{
+ 'targets' : [
+ {
+ 'target_name' : 'canvas_state_lib',
+ 'type' : 'shared_library',
+ # FIXME: Is there a way to ensure that -fPIC was used for skia_lib?
+ 'dependencies' : [ 'skia_lib.gyp:skia_lib'],
+ 'sources' : [
+ '../tests/CanvasStateHelpers.cpp',
+ ],
+ 'cflags' : [
+ '-fPIC',
+ ],
+ },
+ {
+ # Dummy 'most' target, since gyp_skia sets 'most' to be the default.
+ 'target_name' : 'most',
+ 'type' : 'none',
+ 'dependencies' : [
+ 'canvas_state_lib',
+ ],
+ }
+ ],
+}