From 25a763a310c41764dd95cdcc63bbb0cb41afeed4 Mon Sep 17 00:00:00 2001 From: David Steele Date: Fri, 18 Aug 2023 11:42:16 +0100 Subject: [PATCH] Test harness sync Change-Id: Ie023e8f74624f0d25cf2c93509f7486742a740d7 --- .../dali/dali-test-suite-utils/test-compare-types.h | 21 +++++++++++++++++---- .../src/dali/dali-test-suite-utils/test-harness.cpp | 6 +++++- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-compare-types.h b/automated-tests/src/dali/dali-test-suite-utils/test-compare-types.h index fcadd6f..a31f162 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-compare-types.h +++ b/automated-tests/src/dali/dali-test-suite-utils/test-compare-types.h @@ -2,7 +2,7 @@ #define DALI_TEST_COMPARE_TYPES_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,9 +27,9 @@ inline bool CompareType(Type value1, Type value2, float epsilon) } /** - * A helper for fuzzy-comparing Vector2 objects - * @param[in] vector1 the first object - * @param[in] vector2 the second object + * A helper for matching floats + * @param[in] value1 the first object + * @param[in] value2 the second object * @param[in] epsilon difference threshold * @returns true if difference is smaller than epsilon threshold, false otherwise */ @@ -40,6 +40,19 @@ inline bool CompareType(float value1, float value2, float epsilon) } /** + * A helper for matching doubles + * @param[in] value1 the first object + * @param[in] value2 the second object + * @param[in] epsilon difference threshold + * @returns true if difference is smaller than epsilon threshold, false otherwise + */ +template<> +inline bool CompareType(double value1, double value2, float epsilon) +{ + return fabs(value1 - value2) < double(epsilon); +} + +/** * A helper for fuzzy-comparing Vector2 objects * @param[in] vector1 the first object * @param[in] vector2 the second object diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-harness.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-harness.cpp index 31080a4..4237327 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-harness.cpp +++ b/automated-tests/src/dali/dali-test-suite-utils/test-harness.cpp @@ -510,7 +510,11 @@ int32_t RunAllInParallel(const char* processName, ::testcase tc_array[], std::st std::chrono::steady_clock::duration timeSpan = endTime - tc.second.startTime; double seconds = double(timeSpan.count()) * std::chrono::steady_clock::period::num / std::chrono::steady_clock::period::den; - if(seconds > MAXIMUM_CHILD_LIFETIME) + if(4.9999 < seconds && seconds < 5 && !tc.second.finished) + { + printf("Child process %s is delayed: WCHAN:%s\n", tc.second.name, GetWChan(tc.first).c_str()); + } + else if(seconds > MAXIMUM_CHILD_LIFETIME) { // Kill the child process. A subsequent call to waitpid will process signal result below. if(!tc.second.finished) -- 2.7.4