bsalomon | 3724e57 | 2016-03-30 18:56:19 -0700 | [diff] [blame] | 1 | |
djsollen | e454521 | 2014-11-13 11:12:41 -0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2014 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
| 9 | #include "GrContextFactory.h" |
bsalomon | 273c0f5 | 2016-03-31 10:59:06 -0700 | [diff] [blame] | 10 | #include "gl/GLTestContext.h" |
djsollen | e454521 | 2014-11-13 11:12:41 -0800 | [diff] [blame] | 11 | |
Mike Klein | c168a3a | 2016-11-14 14:53:13 +0000 | [diff] [blame] | 12 | #if SK_ANGLE |
| 13 | #include "gl/angle/GLTestContext_angle.h" |
| 14 | #endif |
mtklein | 605d952 | 2016-09-21 14:01:32 -0700 | [diff] [blame] | 15 | #include "gl/command_buffer/GLTestContext_command_buffer.h" |
bsalomon | 273c0f5 | 2016-03-31 10:59:06 -0700 | [diff] [blame] | 16 | #include "gl/debug/DebugGLTestContext.h" |
djsollen | e454521 | 2014-11-13 11:12:41 -0800 | [diff] [blame] | 17 | #if SK_MESA |
bsalomon | 273c0f5 | 2016-03-31 10:59:06 -0700 | [diff] [blame] | 18 | #include "gl/mesa/GLTestContext_mesa.h" |
djsollen | e454521 | 2014-11-13 11:12:41 -0800 | [diff] [blame] | 19 | #endif |
djsollen | 7e73108 | 2016-06-09 13:07:13 -0700 | [diff] [blame] | 20 | #ifdef SK_VULKAN |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 21 | #include "vk/VkTestContext.h" |
bsalomon | 7c62b47 | 2016-04-01 07:42:05 -0700 | [diff] [blame] | 22 | #endif |
bsalomon | 273c0f5 | 2016-03-31 10:59:06 -0700 | [diff] [blame] | 23 | #include "gl/null/NullGLTestContext.h" |
kkinnunen | cfe62e3 | 2015-07-01 02:58:50 -0700 | [diff] [blame] | 24 | #include "gl/GrGLGpu.h" |
| 25 | #include "GrCaps.h" |
djsollen | e454521 | 2014-11-13 11:12:41 -0800 | [diff] [blame] | 26 | |
Brian Osman | 3f375d0 | 2016-12-28 11:19:22 -0500 | [diff] [blame] | 27 | #if defined(SK_BUILD_FOR_WIN32) && defined(SK_ENABLE_DISCRETE_GPU) |
| 28 | extern "C" { |
| 29 | // NVIDIA documents that the presence and value of this symbol programmatically enable the high |
| 30 | // performance GPU in laptops with switchable graphics. |
| 31 | // https://docs.nvidia.com/gameworks/content/technologies/desktop/optimus.htm |
| 32 | // From testing, including this symbol, even if it is set to 0, we still get the NVIDIA GPU. |
| 33 | _declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; |
| 34 | |
| 35 | // AMD has a similar mechanism, although I don't have an AMD laptop, so this is untested. |
| 36 | // https://community.amd.com/thread/169965 |
| 37 | __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; |
| 38 | } |
| 39 | #endif |
| 40 | |
bsalomon | 3724e57 | 2016-03-30 18:56:19 -0700 | [diff] [blame] | 41 | namespace sk_gpu_test { |
kkinnunen | 3405800 | 2016-01-06 23:49:30 -0800 | [diff] [blame] | 42 | GrContextFactory::GrContextFactory() { } |
| 43 | |
| 44 | GrContextFactory::GrContextFactory(const GrContextOptions& opts) |
| 45 | : fGlobalOptions(opts) { |
| 46 | } |
| 47 | |
| 48 | GrContextFactory::~GrContextFactory() { |
| 49 | this->destroyContexts(); |
| 50 | } |
| 51 | |
| 52 | void GrContextFactory::destroyContexts() { |
| 53 | for (Context& context : fContexts) { |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 54 | if (context.fTestContext) { |
| 55 | context.fTestContext->makeCurrent(); |
kkinnunen | 3405800 | 2016-01-06 23:49:30 -0800 | [diff] [blame] | 56 | } |
| 57 | if (!context.fGrContext->unique()) { |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 58 | context.fGrContext->releaseResourcesAndAbandonContext(); |
| 59 | context.fAbandoned = true; |
kkinnunen | 3405800 | 2016-01-06 23:49:30 -0800 | [diff] [blame] | 60 | } |
| 61 | context.fGrContext->unref(); |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 62 | delete context.fTestContext; |
kkinnunen | 3405800 | 2016-01-06 23:49:30 -0800 | [diff] [blame] | 63 | } |
| 64 | fContexts.reset(); |
| 65 | } |
| 66 | |
| 67 | void GrContextFactory::abandonContexts() { |
| 68 | for (Context& context : fContexts) { |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 69 | if (!context.fAbandoned) { |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 70 | if (context.fTestContext) { |
| 71 | context.fTestContext->makeCurrent(); |
| 72 | context.fTestContext->testAbandon(); |
| 73 | delete(context.fTestContext); |
| 74 | context.fTestContext = nullptr; |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 75 | } |
| 76 | context.fGrContext->abandonContext(); |
| 77 | context.fAbandoned = true; |
kkinnunen | 3405800 | 2016-01-06 23:49:30 -0800 | [diff] [blame] | 78 | } |
kkinnunen | 3405800 | 2016-01-06 23:49:30 -0800 | [diff] [blame] | 79 | } |
| 80 | } |
| 81 | |
bsalomon | 6e2aad4 | 2016-04-01 11:54:31 -0700 | [diff] [blame] | 82 | void GrContextFactory::releaseResourcesAndAbandonContexts() { |
| 83 | for (Context& context : fContexts) { |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 84 | if (!context.fAbandoned) { |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 85 | if (context.fTestContext) { |
| 86 | context.fTestContext->makeCurrent(); |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 87 | } |
bsalomon | 6e2aad4 | 2016-04-01 11:54:31 -0700 | [diff] [blame] | 88 | context.fGrContext->releaseResourcesAndAbandonContext(); |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 89 | context.fAbandoned = true; |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 90 | if (context.fTestContext) { |
| 91 | delete context.fTestContext; |
| 92 | context.fTestContext = nullptr; |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 93 | } |
bsalomon | 6e2aad4 | 2016-04-01 11:54:31 -0700 | [diff] [blame] | 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
bsalomon | 85b4b53 | 2016-04-05 11:06:27 -0700 | [diff] [blame] | 98 | #if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_FOR_MAC) |
| 99 | const GrContextFactory::ContextType GrContextFactory::kNativeGL_ContextType = |
| 100 | GrContextFactory::kGL_ContextType; |
| 101 | #else |
| 102 | const GrContextFactory::ContextType GrContextFactory::kNativeGL_ContextType = |
| 103 | GrContextFactory::kGLES_ContextType; |
| 104 | #endif |
| 105 | |
csmartdalton | e812d49 | 2017-02-21 12:36:05 -0700 | [diff] [blame^] | 106 | ContextInfo GrContextFactory::getContextInfo(ContextType type, ContextOverrides overrides) { |
djsollen | e454521 | 2014-11-13 11:12:41 -0800 | [diff] [blame] | 107 | for (int i = 0; i < fContexts.count(); ++i) { |
kkinnunen | 3405800 | 2016-01-06 23:49:30 -0800 | [diff] [blame] | 108 | Context& context = fContexts[i]; |
kkinnunen | 3405800 | 2016-01-06 23:49:30 -0800 | [diff] [blame] | 109 | if (context.fType == type && |
csmartdalton | e812d49 | 2017-02-21 12:36:05 -0700 | [diff] [blame^] | 110 | context.fOverrides == overrides && |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 111 | !context.fAbandoned) { |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 112 | context.fTestContext->makeCurrent(); |
| 113 | return ContextInfo(context.fBackend, context.fTestContext, context.fGrContext); |
djsollen | e454521 | 2014-11-13 11:12:41 -0800 | [diff] [blame] | 114 | } |
| 115 | } |
Ben Wagner | 145dbcd | 2016-11-03 14:40:50 -0400 | [diff] [blame] | 116 | std::unique_ptr<TestContext> testCtx; |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 117 | sk_sp<GrContext> grCtx; |
| 118 | GrBackendContext backendContext = 0; |
| 119 | sk_sp<const GrGLInterface> glInterface; |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 120 | GrBackend backend = ContextTypeBackend(type); |
| 121 | switch (backend) { |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 122 | case kOpenGL_GrBackend: { |
| 123 | GLTestContext* glCtx; |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 124 | switch (type) { |
| 125 | case kGL_ContextType: |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 126 | glCtx = CreatePlatformGLTestContext(kGL_GrGLStandard); |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 127 | break; |
| 128 | case kGLES_ContextType: |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 129 | glCtx = CreatePlatformGLTestContext(kGLES_GrGLStandard); |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 130 | break; |
Mike Klein | c168a3a | 2016-11-14 14:53:13 +0000 | [diff] [blame] | 131 | #if SK_ANGLE |
bsalomon | 11abd8d | 2016-10-14 08:13:48 -0700 | [diff] [blame] | 132 | case kANGLE_D3D9_ES2_ContextType: |
Ben Wagner | 12e8dc2 | 2016-11-03 15:43:44 -0400 | [diff] [blame] | 133 | glCtx = MakeANGLETestContext(ANGLEBackend::kD3D9, ANGLEContextVersion::kES2).release(); |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 134 | break; |
bsalomon | 11abd8d | 2016-10-14 08:13:48 -0700 | [diff] [blame] | 135 | case kANGLE_D3D11_ES2_ContextType: |
Ben Wagner | 12e8dc2 | 2016-11-03 15:43:44 -0400 | [diff] [blame] | 136 | glCtx = MakeANGLETestContext(ANGLEBackend::kD3D11, ANGLEContextVersion::kES2).release(); |
bsalomon | 11abd8d | 2016-10-14 08:13:48 -0700 | [diff] [blame] | 137 | break; |
| 138 | case kANGLE_D3D11_ES3_ContextType: |
Ben Wagner | 12e8dc2 | 2016-11-03 15:43:44 -0400 | [diff] [blame] | 139 | glCtx = MakeANGLETestContext(ANGLEBackend::kD3D11, ANGLEContextVersion::kES3).release(); |
bsalomon | 11abd8d | 2016-10-14 08:13:48 -0700 | [diff] [blame] | 140 | break; |
| 141 | case kANGLE_GL_ES2_ContextType: |
Ben Wagner | 12e8dc2 | 2016-11-03 15:43:44 -0400 | [diff] [blame] | 142 | glCtx = MakeANGLETestContext(ANGLEBackend::kOpenGL, ANGLEContextVersion::kES2).release(); |
bsalomon | 11abd8d | 2016-10-14 08:13:48 -0700 | [diff] [blame] | 143 | break; |
| 144 | case kANGLE_GL_ES3_ContextType: |
Ben Wagner | 12e8dc2 | 2016-11-03 15:43:44 -0400 | [diff] [blame] | 145 | glCtx = MakeANGLETestContext(ANGLEBackend::kOpenGL, ANGLEContextVersion::kES3).release(); |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 146 | break; |
Mike Klein | c168a3a | 2016-11-14 14:53:13 +0000 | [diff] [blame] | 147 | #endif |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 148 | case kCommandBuffer_ContextType: |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 149 | glCtx = CommandBufferGLTestContext::Create(); |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 150 | break; |
kkinnunen | 3e980c3 | 2015-12-23 01:33:00 -0800 | [diff] [blame] | 151 | #if SK_MESA |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 152 | case kMESA_ContextType: |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 153 | glCtx = CreateMesaGLTestContext(); |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 154 | break; |
djsollen | e454521 | 2014-11-13 11:12:41 -0800 | [diff] [blame] | 155 | #endif |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 156 | case kNullGL_ContextType: |
csmartdalton | e812d49 | 2017-02-21 12:36:05 -0700 | [diff] [blame^] | 157 | glCtx = CreateNullGLTestContext(ContextOverrides::kRequireNVPRSupport & overrides); |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 158 | break; |
| 159 | case kDebugGL_ContextType: |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 160 | glCtx = CreateDebugGLTestContext(); |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 161 | break; |
| 162 | default: |
| 163 | return ContextInfo(); |
| 164 | } |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 165 | if (!glCtx) { |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 166 | return ContextInfo(); |
| 167 | } |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 168 | testCtx.reset(glCtx); |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 169 | glInterface.reset(SkRef(glCtx->gl())); |
csmartdalton | e812d49 | 2017-02-21 12:36:05 -0700 | [diff] [blame^] | 170 | if (ContextOverrides::kDisableNVPR & overrides) { |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 171 | glInterface.reset(GrGLInterfaceRemoveNVPR(glInterface.get())); |
| 172 | if (!glInterface) { |
| 173 | return ContextInfo(); |
| 174 | } |
| 175 | } |
| 176 | backendContext = reinterpret_cast<GrBackendContext>(glInterface.get()); |
djsollen | e454521 | 2014-11-13 11:12:41 -0800 | [diff] [blame] | 177 | break; |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 178 | } |
jvanverth | a50e17a | 2015-08-12 12:19:36 -0700 | [diff] [blame] | 179 | #ifdef SK_VULKAN |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 180 | case kVulkan_GrBackend: |
| 181 | SkASSERT(kVulkan_ContextType == type); |
csmartdalton | e812d49 | 2017-02-21 12:36:05 -0700 | [diff] [blame^] | 182 | if (ContextOverrides::kRequireNVPRSupport & overrides) { |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 183 | return ContextInfo(); |
| 184 | } |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 185 | testCtx.reset(CreatePlatformVkTestContext()); |
| 186 | if (!testCtx) { |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 187 | return ContextInfo(); |
| 188 | } |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 189 | |
Brian Salomon | 7f9c29a | 2017-01-24 22:22:05 +0000 | [diff] [blame] | 190 | // There is some bug (either in Skia or the NV Vulkan driver) where VkDevice |
| 191 | // destruction will hang occaisonally. For some reason having an existing GL |
| 192 | // context fixes this. |
| 193 | if (!fSentinelGLContext) { |
| 194 | fSentinelGLContext.reset(CreatePlatformGLTestContext(kGL_GrGLStandard)); |
| 195 | if (!fSentinelGLContext) { |
| 196 | fSentinelGLContext.reset(CreatePlatformGLTestContext(kGLES_GrGLStandard)); |
| 197 | } |
| 198 | } |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 199 | backendContext = testCtx->backendContext(); |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 200 | break; |
jvanverth | a50e17a | 2015-08-12 12:19:36 -0700 | [diff] [blame] | 201 | #endif |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 202 | default: |
| 203 | return ContextInfo(); |
| 204 | } |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 205 | testCtx->makeCurrent(); |
| 206 | SkASSERT(testCtx && testCtx->backend() == backend); |
csmartdalton | e0d3629 | 2016-07-29 08:14:20 -0700 | [diff] [blame] | 207 | GrContextOptions grOptions = fGlobalOptions; |
csmartdalton | e812d49 | 2017-02-21 12:36:05 -0700 | [diff] [blame^] | 208 | if (ContextOverrides::kUseInstanced & overrides) { |
csmartdalton | e0d3629 | 2016-07-29 08:14:20 -0700 | [diff] [blame] | 209 | grOptions.fEnableInstancedRendering = true; |
| 210 | } |
csmartdalton | e812d49 | 2017-02-21 12:36:05 -0700 | [diff] [blame^] | 211 | if (ContextOverrides::kAllowSRGBWithoutDecodeControl & overrides) { |
| 212 | grOptions.fRequireDecodeDisableForSRGB = false; |
| 213 | } |
csmartdalton | e0d3629 | 2016-07-29 08:14:20 -0700 | [diff] [blame] | 214 | grCtx.reset(GrContext::Create(backend, backendContext, grOptions)); |
djsollen | e454521 | 2014-11-13 11:12:41 -0800 | [diff] [blame] | 215 | if (!grCtx.get()) { |
kkinnunen | 3405800 | 2016-01-06 23:49:30 -0800 | [diff] [blame] | 216 | return ContextInfo(); |
djsollen | e454521 | 2014-11-13 11:12:41 -0800 | [diff] [blame] | 217 | } |
csmartdalton | e812d49 | 2017-02-21 12:36:05 -0700 | [diff] [blame^] | 218 | if (ContextOverrides::kRequireNVPRSupport & overrides) { |
kkinnunen | cfe62e3 | 2015-07-01 02:58:50 -0700 | [diff] [blame] | 219 | if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) { |
kkinnunen | 3405800 | 2016-01-06 23:49:30 -0800 | [diff] [blame] | 220 | return ContextInfo(); |
kkinnunen | cfe62e3 | 2015-07-01 02:58:50 -0700 | [diff] [blame] | 221 | } |
| 222 | } |
csmartdalton | e812d49 | 2017-02-21 12:36:05 -0700 | [diff] [blame^] | 223 | if (ContextOverrides::kUseInstanced & overrides) { |
csmartdalton | e0d3629 | 2016-07-29 08:14:20 -0700 | [diff] [blame] | 224 | if (GrCaps::InstancedSupport::kNone == grCtx->caps()->instancedSupport()) { |
| 225 | return ContextInfo(); |
| 226 | } |
| 227 | } |
csmartdalton | e812d49 | 2017-02-21 12:36:05 -0700 | [diff] [blame^] | 228 | if (ContextOverrides::kRequireSRGBSupport & overrides) { |
brianosman | 61d3b08 | 2016-03-30 11:19:36 -0700 | [diff] [blame] | 229 | if (!grCtx->caps()->srgbSupport()) { |
| 230 | return ContextInfo(); |
| 231 | } |
| 232 | } |
kkinnunen | cfe62e3 | 2015-07-01 02:58:50 -0700 | [diff] [blame] | 233 | |
kkinnunen | 3405800 | 2016-01-06 23:49:30 -0800 | [diff] [blame] | 234 | Context& context = fContexts.push_back(); |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 235 | context.fBackend = backend; |
| 236 | context.fTestContext = testCtx.release(); |
kkinnunen | 3405800 | 2016-01-06 23:49:30 -0800 | [diff] [blame] | 237 | context.fGrContext = SkRef(grCtx.get()); |
| 238 | context.fType = type; |
csmartdalton | e812d49 | 2017-02-21 12:36:05 -0700 | [diff] [blame^] | 239 | context.fOverrides = overrides; |
bsalomon | dc0fcd4 | 2016-04-11 14:21:33 -0700 | [diff] [blame] | 240 | context.fAbandoned = false; |
bsalomon | 18a2f9d | 2016-05-11 10:09:18 -0700 | [diff] [blame] | 241 | return ContextInfo(context.fBackend, context.fTestContext, context.fGrContext); |
djsollen | e454521 | 2014-11-13 11:12:41 -0800 | [diff] [blame] | 242 | } |
bsalomon | 3724e57 | 2016-03-30 18:56:19 -0700 | [diff] [blame] | 243 | } // namespace sk_gpu_test |