Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b52c273

Browse files
HalCanarySkia Commit-Bot
authored and
Skia Commit-Bot
committed
SkQP: SK_DO_NOT_REGISTER_NONGPU_UNIT_TESTS no longer uses __attribute_
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Debian9-Clang-NUC7i5BNK-CPU-Emulator-x86-devrel-All-Android_SKQP Change-Id: I6b845ff8030b64df64165b1a43fbb7331b35d9e6 Reviewed-on: https://skia-review.googlesource.com/c/169320 Commit-Queue: Hal Canary <halcanary@google.com> Commit-Queue: Ben Wagner <bungeman@google.com> Auto-Submit: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
1 parent 34d7a16 commit b52c273

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tests/Test.h

+9-5
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,16 @@ class Timer {
176176
} \
177177
} while (0)
178178

179-
// SK_DO_NOT_REGISTER_NONGPU_UNIT_TESTS is experimental and does not work with
180-
// compilers that don't understand `__attribute__ ((unused))`.
181179
#ifdef SK_DO_NOT_REGISTER_NONGPU_UNIT_TESTS
182-
#define DEF_TEST(name, reporter) \
183-
__attribute__ ((unused)) \
184-
static void test_##name(skiatest::Reporter* reporter, const GrContextOptions&)
180+
namespace skiatest {
181+
struct NonRegister {
182+
NonRegister(TestProc) {}
183+
};
184+
}
185+
#define DEF_TEST(name, reporter) \
186+
static void test_##name(skiatest::Reporter*, const GrContextOptions&); \
187+
static skiatest::NonRegister name##_NonTestRegistry(test_##name); \
188+
void test_##name(skiatest::Reporter* reporter, const GrContextOptions&)
185189
#else
186190
#define DEF_TEST(name, reporter) \
187191
static void test_##name(skiatest::Reporter*, const GrContextOptions&); \

0 commit comments

Comments
 (0)