aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Test.h
Commit message (Collapse)AuthorAge
* Reland "implemented metal gpu backend texture upload testing"Gravatar Timothy Liang2018-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a80a012456a95a6996a8901268ec34ed0cc3aecb. Reason for revert: Fix bot failure. Original change's description: > Revert "implemented metal gpu backend texture upload testing" > > This reverts commit 36848f6b30ddaca461c98e13b9976b2c449ca547. > > Reason for revert: Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR failing. > > Original change's description: > > implemented metal gpu backend texture upload testing > > > > Bug: skia: > > Change-Id: Ia3af58a0710f7f9792b37682a3cc45dd14282b71 > > Reviewed-on: https://skia-review.googlesource.com/140248 > > Commit-Queue: Timothy Liang <timliang@google.com> > > Reviewed-by: Greg Daniel <egdaniel@google.com> > > TBR=egdaniel@google.com,ethannicholas@google.com,timliang@google.com > > Change-Id: Idf40fc78b82aec1efbcc64221b6d2bbf63353960 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/141182 > Reviewed-by: Timothy Liang <timliang@google.com> > Commit-Queue: Timothy Liang <timliang@google.com> Bug: skia: Change-Id: Ib8c5b2e0cf9de25c11c14741a32846bcc874d712 Reviewed-on: https://skia-review.googlesource.com/141183 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Timothy Liang <timliang@google.com>
* Revert "implemented metal gpu backend texture upload testing"Gravatar Timothy Liang2018-07-13
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 36848f6b30ddaca461c98e13b9976b2c449ca547. Reason for revert: Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR failing. Original change's description: > implemented metal gpu backend texture upload testing > > Bug: skia: > Change-Id: Ia3af58a0710f7f9792b37682a3cc45dd14282b71 > Reviewed-on: https://skia-review.googlesource.com/140248 > Commit-Queue: Timothy Liang <timliang@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,ethannicholas@google.com,timliang@google.com Change-Id: Idf40fc78b82aec1efbcc64221b6d2bbf63353960 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/141182 Reviewed-by: Timothy Liang <timliang@google.com> Commit-Queue: Timothy Liang <timliang@google.com>
* implemented metal gpu backend texture upload testingGravatar Timothy Liang2018-07-13
| | | | | | | | Bug: skia: Change-Id: Ia3af58a0710f7f9792b37682a3cc45dd14282b71 Reviewed-on: https://skia-review.googlesource.com/140248 Commit-Queue: Timothy Liang <timliang@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Remove SK_SUPPORT_GPU checks in tool-only codeGravatar Brian Osman2018-05-31
| | | | | | | | | | | | | | | | Most of this is (obviously) not necessary to do, but once I started, I figured I'd just get it all. Tools (nanobench, DM, skiaserve), all GMs, benches, and unit tests, plus support code (command line parsing and config stuff). This is almost entirely mechanical. Bug: skia: Change-Id: I209500f8df8c5bd43f8298ff26440d1c4d7425fb Reviewed-on: https://skia-review.googlesource.com/131153 Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Allow printf style var args for messages in REPORTER_ASSERT.Gravatar Brian Salomon2018-01-29
| | | | | | | | | Remove REPORTER_ASSERT_MESSAGE. Change-Id: I6d00715901159c93e22d182fe24aac92b5fdbcf4 Reviewed-on: https://skia-review.googlesource.com/100361 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Use GrContextFactories that produce a single GrContext in unit tests.Gravatar Brian Salomon2017-11-15
| | | | | | | | | | | | | | | | | | | | | This is to alleviate problems due to the command buffer getting bent out of shape when the current OpenGL context is switched out from under it (because we ran a test with a native GL context). This, however is not a full solution. More changes will be required to ensure that after running each command buffer or native test we bind the null context. This does allow us to take a step in that direction without breaking anything too badly. Moreover, there is no real benefit to reusing a GrContextFactory. Modifies DEF_GPUTEST to take GrContextOptions rather than a factory to use. Tests were already using their own factories anyway. In tests that use GrContextFactory the factory instance is moved to the inner loop. Modifies gpucts and skia_test to not use persistent GrContextFactories. Change-Id: Ie7a36793545c775f2f30653ead6fec93a3d22717 Reviewed-on: https://skia-review.googlesource.com/71861 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Fix Debian9-Clang build""Gravatar Robert Phillips2017-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit dd992c4a461040e798a02cba028e55cdcd856026. Reason for revert: Suppression have landed for failing tests Original change's description: > Revert "Fix Debian9-Clang build" > > This reverts commit 08d73a4850f528917c69167f0072721406689484. > > Reason for revert: vulkan failure > > Original change's description: > > Fix Debian9-Clang build > > > > TBR=bsalomon@google.com > > Change-Id: I2e86aa0381d409f1205bdaba4117253cb381b404 > > Reviewed-on: https://skia-review.googlesource.com/65020 > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Commit-Queue: Robert Phillips <robertphillips@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com > > Change-Id: Ie934d2c85857d087721885c28aa02c3c8579e7fc > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/65200 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=bsalomon@google.com,robertphillips@google.com Change-Id: I6cea9a2d580e68a6ed8228bb7f076a98766d4bf9 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/65203 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Revert "Fix GrDefaultPathRender inversely wound path bug""Gravatar Robert Phillips2017-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fc28138c0422637741ac2839914ef10c56438054. Reason for revert: Suppression have landed for failing tests Original change's description: > Revert "Fix GrDefaultPathRender inversely wound path bug" > > This reverts commit 511a9d49998ec6a74c375e6cfc55f660f7987c40. > > Reason for revert: vulkan > > Original change's description: > > Fix GrDefaultPathRender inversely wound path bug > > > > Bug: 769898 > > Change-Id: I3b1a43b1e114b35105493a0cfa01a1f01b65fa56 > > Reviewed-on: https://skia-review.googlesource.com/64065 > > Commit-Queue: Robert Phillips <robertphillips@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com > > Change-Id: Ib1a987294d14f0526bf5ff5a8fd90bbd5f6f3a0d > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 769898 > Reviewed-on: https://skia-review.googlesource.com/65201 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=bsalomon@google.com,robertphillips@google.com Change-Id: I3a3543c46b3192f1ffd31a5566cf337dc03561a8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 769898 Reviewed-on: https://skia-review.googlesource.com/65202 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Fix GrDefaultPathRender inversely wound path bug"Gravatar Robert Phillips2017-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 511a9d49998ec6a74c375e6cfc55f660f7987c40. Reason for revert: vulkan Original change's description: > Fix GrDefaultPathRender inversely wound path bug > > Bug: 769898 > Change-Id: I3b1a43b1e114b35105493a0cfa01a1f01b65fa56 > Reviewed-on: https://skia-review.googlesource.com/64065 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,robertphillips@google.com Change-Id: Ib1a987294d14f0526bf5ff5a8fd90bbd5f6f3a0d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 769898 Reviewed-on: https://skia-review.googlesource.com/65201 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Fix Debian9-Clang build"Gravatar Robert Phillips2017-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 08d73a4850f528917c69167f0072721406689484. Reason for revert: vulkan failure Original change's description: > Fix Debian9-Clang build > > TBR=bsalomon@google.com > Change-Id: I2e86aa0381d409f1205bdaba4117253cb381b404 > Reviewed-on: https://skia-review.googlesource.com/65020 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=bsalomon@google.com,robertphillips@google.com Change-Id: Ie934d2c85857d087721885c28aa02c3c8579e7fc No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/65200 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Fix Debian9-Clang buildGravatar Robert Phillips2017-10-30
| | | | | | | | TBR=bsalomon@google.com Change-Id: I2e86aa0381d409f1205bdaba4117253cb381b404 Reviewed-on: https://skia-review.googlesource.com/65020 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Fix GrDefaultPathRender inversely wound path bugGravatar Robert Phillips2017-10-30
| | | | | | | | Bug: 769898 Change-Id: I3b1a43b1e114b35105493a0cfa01a1f01b65fa56 Reviewed-on: https://skia-review.googlesource.com/64065 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* sprinkle more tracing in GM, tests, and ok, and add TRACE_FUNCGravatar Mike Klein2017-07-24
| | | | | | | Change-Id: I562d438bd65e9fd900cfc6831f971b4af25c8ae6 Reviewed-on: https://skia-review.googlesource.com/26361 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* move SkTRegister.h into toolsGravatar Mike Reed2017-01-11
| | | | | | | | | BUG=skia: Change-Id: Ie7d4fac3024b361a281f456fec2b3a837e2bfe43 Reviewed-on: https://skia-review.googlesource.com/6881 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* change SkClipOp to a class enumGravatar Mike Reed2016-12-12
| | | | | | | | | BUG=skia: Change-Id: I25dbe6d6b8666a2a0a7be7bdd2ae0b067868d14e Reviewed-on: https://skia-review.googlesource.com/5718 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Add a context stack to Reporter, for better error messagesGravatar Brian Osman2016-12-05
| | | | | | | | | | | | | Currently, just inject the Ganesh context type when running unit tests. Obviously, we can use this to supply other contextual information around tests that do many variations of configs, formats, etc... BUG=skia: Change-Id: Iab96632a92ec632e4d132bbcc17a91a8dd251e78 Reviewed-on: https://skia-review.googlesource.com/5565 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Explicit control in tools of ANGLE frontend and backendGravatar bsalomon2016-10-14
| | | | | | | | | | | | | | | Update the ANGLE test GL context, GrContextFactory, and config parsing to allow explicit control of ANGLE front/backend. This will allow us to explicitly test ES2 vs ES3 interfaces to ANGLE as well as D3D9, D3D11, and OpenGL backends. Also makes the angle api types valid in all builds (but will just fail when SK_ANGLE=1 or not on windows for the d3d backends). BUG=skia:5804 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2381033002 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win-MSVC-ShuttleC-GPU-GTX960-x86_64-Debug-ANGLE-Trybot Review-Url: https://codereview.chromium.org/2381033002
* coin debugging runs all tests in extendedGravatar Cary Clark2016-10-04
| | | | | | | | | | | | | | | | | | | This extends path ops concidence debugging to find unused algorithms and determine the extent of loops. This verifies that all 140M tests run without error in release and debug. TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2391733002 patch from issue 2391733002 at patchset 1 (http://crrev.com/2391733002#ps1) Change-Id: I02ca29764405c5ac3e7ca3b2621fba28dbaaffc2 Reviewed-on: https://skia-review.googlesource.com/2923 Reviewed-by: Cary Clark <caryclark@google.com>
* SkDocument/PDF: new APIGravatar halcanary2016-04-27
| | | | | | | | | | has a pdf/a switch. sets metadata in factory. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1916093002 Review URL: https://codereview.chromium.org/1916093002
* Make more unit tests run on VulkanGravatar bsalomon2016-04-12
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1885623002 Review URL: https://codereview.chromium.org/1885623002
* Convert some unit tests from running on GL contexts to running on all contextsGravatar bsalomon2016-04-11
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1873313002 Review URL: https://codereview.chromium.org/1873313002
* Vulkan config in dmGravatar bsalomon2016-04-11
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1872283003 Review URL: https://codereview.chromium.org/1872283003
* Make existing unit tests only run on GL contextsGravatar bsalomon2016-04-06
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1869503002 Review URL: https://codereview.chromium.org/1869503002
* One signature for creating unit tests that run on premade GrContextsGravatar bsalomon2016-04-05
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1860593002 Review URL: https://codereview.chromium.org/1860593002
* Remove 'native' context unit test macro.Gravatar bsalomon2016-04-05
| | | | | | | | | The only test ran long is GLPrograms. I halved its iteration count to preserve the runtime on devices that support GL and GLES. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1855993002 Review URL: https://codereview.chromium.org/1855993002
* rename sk_gpu_test::GLContext to sk_gpu_test::GLTestContextGravatar bsalomon2016-03-31
| | | | | | | | | | | | | rename subclasses Fix up the EGL native GLTestContext GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1849463002 TBR=jvanverth@google.com Committed: https://skia.googlesource.com/skia/+/4c7f0a16312c374eba4e8d5d46435ce9eb0b9971 Review URL: https://codereview.chromium.org/1849463002
* Revert of rename sk_gpu_test::GLContext to sk_gpu_test::GLTestContext ↵Gravatar bsalomon2016-03-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #5 id:80001 of https://codereview.chromium.org/1849463002/ ) Reason for revert: breaking bots Original issue's description: > rename sk_gpu_test::GLContext to sk_gpu_test::GLTestContext > > rename subclasses > > Fix up the EGL native GLTestContext > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1849463002 > > TBR=jvanverth@google.com > > Committed: https://skia.googlesource.com/skia/+/4c7f0a16312c374eba4e8d5d46435ce9eb0b9971 TBR=jvanverth@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1850543003
* rename sk_gpu_test::GLContext to sk_gpu_test::GLTestContextGravatar bsalomon2016-03-31
| | | | | | | | | | | rename subclasses Fix up the EGL native GLTestContext GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1849463002 TBR=jvanverth@google.com Review URL: https://codereview.chromium.org/1849463002
* Move SkGLContext and some GrGLInterface implementations to skgputest moduleGravatar bsalomon2016-03-30
| | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1815823002 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot Committed: https://skia.googlesource.com/skia/+/fe3456cb006110d045b26ff3f8681b893a757b58 Review URL: https://codereview.chromium.org/1815823002
* Revert of Move SkGLContext and some GrGLInterface implementations to ↵Gravatar robertphillips2016-03-30
| | | | | | | | | | | | | | | | | | | | | | | | | skgputest module (patchset #13 id:240001 of https://codereview.chromium.org/1815823002/ ) Reason for revert: red bots Original issue's description: > Move SkGLContext and some GrGLInterface implementations to skgputest module > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1815823002 > CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot > > Committed: https://skia.googlesource.com/skia/+/fe3456cb006110d045b26ff3f8681b893a757b58 TBR=jvanverth@google.com,bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1845473004
* Move SkGLContext and some GrGLInterface implementations to skgputest moduleGravatar bsalomon2016-03-30
| | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1815823002 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot Review URL: https://codereview.chromium.org/1815823002
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* Change SkTime::GetMSecs to double; ensure values stored in SkMSec do not ↵Gravatar benjaminwagner2016-03-25
| | | | | | | | | | | | | | | | | | | | | | | overflow. The following are currently unused in Android, Google3, Chromium, and Mozilla: - SkEvent - SkTime::GetMSecs - SK_TIME_FACTOR (also unused in Skia) - SkAutoTime I left uses of SkMSec more-or-less intact for SkEvent, SkAnimator, and SkInterpolator. SkInterpolator is used in Chromium, so I did not want to change the API. The views/ and animator/ code is crufty, so it didn't seem worthwhile to refactor it. Instead, I added SkEvent::GetMSecsSinceStartup, which is likely to be adequate for use in SampleApp. I also left SkMSec where it is used to measure a duration rather than a timestamp. With the exception of SkMovie, which is used in Android, all of the uses appear to measure the execution time of a piece of code, which I would hope does not exceed 2^31 milliseconds. Added skiatest::Timer to support a common idiom in tests where we want to measure the wallclock time in integer milliseconds. (Not used in tests/PathOpsSkpClipTest.cpp because it redefines things in Test.h.) Removed tabs in tests/StrokerTest.cpp. BUG=skia:4632 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1811613004 Review URL: https://codereview.chromium.org/1811613004
* Unit Tests: eliminate stray SkDebugf()s.Gravatar halcanary2016-02-24
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1733113002 Review URL: https://codereview.chromium.org/1733113002
* Run debug gl context for DEF_GPU_TEST_FOR_ALL_CONTEXTSGravatar kkinnunen2015-12-10
| | | | | | | Run debug gl context for tests defined with DEF_GPU_TEST_FOR_ALL_CONTEXTS. Review URL: https://codereview.chromium.org/1514023002
* Generate list of GPU contexts outside SurfaceTest testsGravatar kkinnunen2015-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for feeding the tests with contexts directly to the unit test framework. This fixes the problem where tests are more complex than needed just in order to run the test code with multiple backends. Also makes it possible to change the logic how contexts are created. Instead of direct numbering, the different testable contexts may be generated from filtered cross-product of context options. For example: currently NVPR is a type of context. However, it could be also an on/off feature of any context. In order to test this kind of context, the enumeration can not be just of context type. It's simpler to move the enumeration out of the tests. A test targeting both normal and GPU backends would look like: static void test_obj_behavior(skiatest::Reporter* reporter, SkObj* obj, [other params] ) { ... test with obj and param .. } DEF_TEST(ObjBehavior, reporter) { for (auto& object : generate_object) { for (auto& other_param : generate_other_variant) { test_obj_behavior(reporter, object, other_param); } } } #if SK_SUPPORT_GPU DEF_GPUTEST_FOR_ALL_CONTEXTS(ObjBehavior_Gpu, reporter, context) { for (auto& object : generate_gpu_object) { for (auto& other_param : generate_other_variant) { test_obj_behavior(reporter, object, other_param); } } } #endif Uses the feature in SurfaceTests as an example. Moves SkSurface -related tests from ImageTest to SurfaceTest. BUG=skia:2992 Review URL: https://codereview.chromium.org/1446453003
* SkPDF: clean up overuse of SK_SUPPORT_PDFGravatar halcanary2015-08-11
| | | | | | | When possible use run-time checks (via SkDocument::CreatePDF) When PDF is disabled, do not compile tests/PDF*.cpp Review URL: https://codereview.chromium.org/1278403006
* Simplify skiatest framework.Gravatar halcanary2015-01-20
| | | | | | | | | | | | | skiatest::Test class is now a simple struct. Some functionalty, such as counting errors or timing is now handled elsewhere. skiatest:Reporter is now a simpler abstract class. The two implementations handle test errors. DM and pathops_unittest updated. Review URL: https://codereview.chromium.org/830513004
* Fix up all the easy virtual ... SK_OVERRIDE cases.Gravatar mtklein2015-01-09
| | | | | | | | | | | | This fixes every case where virtual and SK_OVERRIDE were on the same line, which should be the bulk of cases. We'll have to manually clean up the rest over time unless I level up in regexes. for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end BUG=skia: Review URL: https://codereview.chromium.org/806653007
* When running DM, write test failures to json.Gravatar scroggo2014-11-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add skiatest::Failure to keep track of data about a test failure. Reporter::reportFailed and ::onReportFailed now take Failure as a parameter. This allows the implementation to treat the failure as it wishes. Provide a helper to format the failure the same as prior to the change. Update the macros for calling reportFailed (REPORTER_ASSERT etc) to create a Failure object. Convert a direct call to reportFailed to the macro ERRORF. Write Failures to Json. Sample output when running dm on the dummy test crrev.com/705723004: { "test_results" : { "failures" : [ { "condition" : "0 > 3", "file_name" : "../../tests/DummyTest.cpp", "line_no" : 10, "message" : "" }, { "condition" : "false", "file_name" : "../../tests/DummyTest.cpp", "line_no" : 4, "message" : "" }, { "condition" : "1 == 3", "file_name" : "../../tests/DummyTest.cpp", "line_no" : 5, "message" : "I can too count!" }, { "condition" : "", "file_name" : "../../tests/DummyTest.cpp", "line_no" : 6, "message" : "seven is 7" }, { "condition" : "1 == 3", "file_name" : "../../tests/DummyTest.cpp", "line_no" : 14, "message" : "I can too count!" } ] } } Report all of the failures from one test. Previously, if one test had multiple failures, only one was reportered. e.g: Failures: test Dummy: ../../tests/DummyTest.cpp:6 seven is 7 test Dummy2: ../../tests/DummyTest.cpp:10 0 > 3 test Dummy3: ../../tests/DummyTest.cpp:14 I can too count!: 1 == 3 3 failures. Now, we get all the messages: Failures: test Dummy: ../../tests/DummyTest.cpp:4 false ../../tests/DummyTest.cpp:5 I can too count!: 1 == 3 ../../tests/DummyTest.cpp:6 seven is 7 test Dummy2: ../../tests/DummyTest.cpp:10 0 > 3 test Dummy3: ../../tests/DummyTest.cpp:14 I can too count!: 1 == 3 3 failures. (Note that we still state "3 failures" because 3 DM::Tasks failed.) BUG=skia:3082 BUG=skia:2454 Review URL: https://codereview.chromium.org/694703005
* SkThreadPool ~~> SkTaskGroupGravatar mtklein2014-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkTaskGroup is like SkThreadPool except the threads stay in one global pool. Each SkTaskGroup itself is tiny (4 bytes) and its wait() method applies only to tasks add()ed to that instance, not the whole thread pool. This means we don't need to bring up new thread pools when tests themselves want to use multithreading (e.g. pathops, quilt). We just create a new SkTaskGroup and wait for that to complete. This should be more efficient, and allow us to expand where we use threads to really latency sensitive places. E.g. we can probably now use these in nanobench for CPU .skp rendering. Now that all threads are sharing the same pool, I think we can remove most of the custom mechanism pathops tests use to control threading. They'll just ride on the global pool with all other tests now. This (temporarily?) removes the GPU multithreading feature from DM, which we don't use. On my desktop, DM runs a little faster (57s -> 55s) in Debug, and a lot faster in Release (36s -> 24s). The bots show speedups of similar proportions, cutting more than a minute off the N4/Release and Win7/Debug runtimes. BUG=skia: Committed: https://skia.googlesource.com/skia/+/9c7207b5dc71dc5a96a2eb107d401133333d5b6f R=caryclark@google.com, bsalomon@google.com, bungeman@google.com, mtklein@google.com, reed@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/531653002
* Revert of SkThreadPool ~~> SkTaskGroup (patchset #4 id:60001 of ↵Gravatar mtklein2014-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/531653002/) Reason for revert: Leaks, leaks, leaks. Original issue's description: > SkThreadPool ~~> SkTaskGroup > > SkTaskGroup is like SkThreadPool except the threads stay in > one global pool. Each SkTaskGroup itself is tiny (4 bytes) > and its wait() method applies only to tasks add()ed to that > instance, not the whole thread pool. > > This means we don't need to bring up new thread pools when > tests themselves want to use multithreading (e.g. pathops, > quilt). We just create a new SkTaskGroup and wait for that > to complete. This should be more efficient, and allow us > to expand where we use threads to really latency sensitive > places. E.g. we can probably now use these in nanobench > for CPU .skp rendering. > > Now that all threads are sharing the same pool, I think we > can remove most of the custom mechanism pathops tests use > to control threading. They'll just ride on the global pool > with all other tests now. > > This (temporarily?) removes the GPU multithreading feature > from DM, which we don't use. > > On my desktop, DM runs a little faster (57s -> 55s) in > Debug, and a lot faster in Release (36s -> 24s). The bots > show speedups of similar proportions, cutting more than a > minute off the N4/Release and Win7/Debug runtimes. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/9c7207b5dc71dc5a96a2eb107d401133333d5b6f R=caryclark@google.com, bsalomon@google.com, bungeman@google.com, reed@google.com, mtklein@chromium.org TBR=bsalomon@google.com, bungeman@google.com, caryclark@google.com, mtklein@chromium.org, reed@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: mtklein@google.com Review URL: https://codereview.chromium.org/533393002
* SkThreadPool ~~> SkTaskGroupGravatar mtklein2014-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkTaskGroup is like SkThreadPool except the threads stay in one global pool. Each SkTaskGroup itself is tiny (4 bytes) and its wait() method applies only to tasks add()ed to that instance, not the whole thread pool. This means we don't need to bring up new thread pools when tests themselves want to use multithreading (e.g. pathops, quilt). We just create a new SkTaskGroup and wait for that to complete. This should be more efficient, and allow us to expand where we use threads to really latency sensitive places. E.g. we can probably now use these in nanobench for CPU .skp rendering. Now that all threads are sharing the same pool, I think we can remove most of the custom mechanism pathops tests use to control threading. They'll just ride on the global pool with all other tests now. This (temporarily?) removes the GPU multithreading feature from DM, which we don't use. On my desktop, DM runs a little faster (57s -> 55s) in Debug, and a lot faster in Release (36s -> 24s). The bots show speedups of similar proportions, cutting more than a minute off the N4/Release and Win7/Debug runtimes. BUG=skia: R=caryclark@google.com, bsalomon@google.com, bungeman@google.com, mtklein@google.com, reed@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/531653002
* Preprend Test to test function name generated by DEF_TEST() macro.Gravatar tfarina2014-06-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | That way when declaring a test with DEF_TEST() macro, you don't have to uniquify the test name because it might colide with the class it is being testing. For example, if you are testing SkBase64 and do: DEF_TEST(SkBase64, reporter) { } That will generate an error because the macro will declare a function named SkBase64 which colides with the type SkBase64. By adding Test to the function name we avoid this problem. Fixed the entries found with the following command line: $ git grep "Test, r" | grep DEF BUG=None TEST=make tests && out/Debug/tests R=mtklein@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/345753007
* Refactor how we handle resources path in Tests.Gravatar tfarina2014-06-18
| | | | | | | | | | | | | This idea emerged while doing https://codereview.chromium.org/321723002/ (commit 880914c35c8f7fc2e9c57134134c883baf66e538). BUG=None TEST=make tests && out/Debug/tests R=mtklein@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/346453002
* Reland "Clean up Test's resourcePath code."Gravatar tfarina2014-06-09
| | | | | | | | | | | | | This relands commit 91359bed48bc006a4319da86eb26db3b2e6d4afb (Clean up Test's resourcePath code." BUG=None TEST=make dm && out/Debug/dm R=mtklein@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/321723002
* Revert of Clean up Test's resourcePath code. ↵Gravatar mtklein2014-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/319473003/) Reason for revert: Some benchmarks are written in a way that makes this change unsafe (e.g. const char* resPath = GetResourcePath().c_str(); in SkipZeroesBench) and Valgrind and ASAN caught that. We can try again after a more careful cleanup of GetResourcePath(). Original issue's description: > Clean up resourcePath code. > > 1) Make the implementation of SetResourcePath/GetResourcePath of GM and SkBenchmark match with the one in Test. > 2) Make gResourcePath a static pointer to const char and move it inside the classes. > > BUG=None > TEST=make tests && out/Debug/tests > make gm && out/Debug/gm > make bench && out/Debug/bench > R=mtklein@google.com > > Committed: https://skia.googlesource.com/skia/+/52e4f413ffe2d281f9e90ff2147db08083ffcba7 R=tfarina@chromium.org TBR=tfarina@chromium.org NOTREECHECKS=true NOTRY=true BUG=None Author: mtklein@google.com Review URL: https://codereview.chromium.org/320733002
* Clean up resourcePath code.Gravatar tfarina2014-06-07
| | | | | | | | | | | | | | | | 1) Make the implementation of SetResourcePath/GetResourcePath of GM and SkBenchmark match with the one in Test. 2) Make gResourcePath a static pointer to const char and move it inside the classes. BUG=None TEST=make tests && out/Debug/tests make gm && out/Debug/gm make bench && out/Debug/bench R=mtklein@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/319473003
* Let DM run unit tests.Gravatar commit-bot@chromium.org2014-02-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | - refactor GYPs and a few flags - make GPU tests grab a thread-local GrContextFactory when needed as we do in DM for GMs - add a few more UI features to make DM more like tests I believe this makes the program 'tests' obsolete. It should be somewhat faster to run the two sets together than running the old binaries serially: - serial: tests 20s (3m18s CPU), dm 21s (3m01s CPU) - together: 27s (6m21s CPU) Next up is to incorporate benches. I'm only planning there on a single-pass sanity check, so that won't obsolete the program 'bench' just yet. Tested: out/Debug/tests && out/Debug/dm && echo ok BUG=skia: Committed: http://code.google.com/p/skia/source/detail?r=13586 R=reed@google.com, bsalomon@google.com, mtklein@google.com, tfarina@chromium.org Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/178273002 git-svn-id: http://skia.googlecode.com/svn/trunk@13592 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of Let DM run unit tests. (https://codereview.chromium.org/178273002/)Gravatar commit-bot@chromium.org2014-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reason for revert: broke tests Original issue's description: > Let DM run unit tests. > - refactor GYPs and a few flags > - make GPU tests grab a thread-local GrContextFactory when needed as we do in DM for GMs > - add a few more UI features to make DM more like tests > > I believe this makes the program 'tests' obsolete. > > It should be somewhat faster to run the two sets together than running the old binaries serially: > - serial: tests 20s (3m18s CPU), dm 21s (3m01s CPU) > - together: 27s (6m21s CPU) > > Next up is to incorporate benches. I'm only planning there on a single-pass sanity check, so that won't obsolete the program 'bench' just yet. > > Tested: out/Debug/tests && out/Debug/dm && echo ok > BUG=skia: > > Committed: http://code.google.com/p/skia/source/detail?r=13586 R=bsalomon@google.com, mtklein@google.com, tfarina@chromium.org, mtklein@chromium.org TBR=bsalomon@google.com, mtklein@chromium.org, mtklein@google.com, tfarina@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Author: reed@google.com Review URL: https://codereview.chromium.org/179403010 git-svn-id: http://skia.googlecode.com/svn/trunk@13587 2bbb7eff-a529-9590-31e7-b0007b416f81