#!/bin/bash
-TEMP=`getopt -o dhsSmfq --long debug,help,failnorerun,quiet,serial,tct,modules -n 'execute.sh' -- "$@"`
+TEMP=`getopt -o dhsSmfqp: --long debug,help,failnorerun,quiet,serial,tct,modules,prefix: -n 'execute.sh' -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
echo -e " execute.sh\t\tExecute test cases from all modules in parallel"
echo -e " execute.sh -f \tExecute test cases from all modules in parallel without rerunning failed test cases"
echo -e " execute.sh -d <testcase>\tDebug testcase"
+ echo -e " execute.sh -p <prefix>\tExecute all testcases named with <prefix>"
echo -e " execute.sh [module]\tExecute test cases from the given module in parallel"
echo -e " execute.sh -s [module]\t\tExecute test cases in serial using Testkit-Lite"
echo -e " execute.sh -S [module]\t\tExecute test cases in serial"
opt_debug=0
opt_noFailedRerun="";
opt_quiet="";
+opt_match="";
while true ; do
case "$1" in
-h|--help) usage ;;
-f|--nofailedrerun) opt_noFailedRerun="-f" ; shift ;;
-S|--serial) opt_serial="-s" ; shift ;;
-q|--quiet) opt_quiet="-q" ; shift ;;
+ -p|--prefix) opt_match="-m $2" ; shift 2;;
-m|--modules) opt_modules=1 ; shift ;;
--) shift; break;;
*) echo "Internal error $1!" ; exit 1 ;;
echo -e "$ASCII_BOLD"
echo -e "Executing $mod$ASCII_RESET"
output_start $mod
- dbus-launch build/src/$mod/tct-$mod-core $opt_serial $opt_noFailedRerun $opt_quiet
+ dbus-launch build/src/$mod/tct-$mod-core $opt_serial $opt_noFailedRerun $opt_quiet $opt_match
output_end $mod
done
summary_end
module=$1
shift;
output_start ${module}
- dbus-launch build/src/$module/tct-$module-core $opt_serial $opt_noFailedRerun $opt_quiet $*
+ dbus-launch build/src/$module/tct-$module-core $opt_serial $opt_noFailedRerun $opt_quiet $opt_match $*
output_end ${module}
summary_end
my $numFailures = $modules{$module}->{"fail"};
$totalFailures += $numFailures;
print( "$ASCII_BOLD$module results:$ASCII_RESET\n" );
- printf("Number of test passes: %s%4d (%5.2f%%)%s\n", $ASCII_BOLD, $numPasses, 100.0 * $numPasses / ($numPasses+$numFailures), $ASCII_RESET);
+ printf("Number of test passes: %s%4d (%5.2f%%)%s\n", $ASCII_BOLD, $numPasses, $numPasses>0?100.0 * $numPasses / ($numPasses+$numFailures):0, $ASCII_RESET);
printf("%sNumber of test failures:%s %s%4d%s\n\n", $result_colour, $ASCII_RESET, $ASCII_BOLD, $numFailures, $ASCII_RESET);
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
basename(processName),
numPasses + numFailures,
numPasses,
- (float)numPasses * 100.0f / (numPasses + numFailures),
+ numPasses > 0 ? (float)numPasses * 100.0f / (numPasses + numFailures) : 0.0f,
numFailures,
- (float)numFailures * 100.0f / (numPasses + numFailures));
+ numPasses > 0 ? (float)numFailures * 100.0f / (numPasses + numFailures) : 0.0f);
fclose(fp);
}
}
return testResult;
}
-int32_t RunAll(const char* processName, ::testcase tc_array[], bool quiet)
+int32_t RunAll(const char* processName, ::testcase tc_array[], std::string match, bool quiet)
{
int32_t numFailures = 0;
int32_t numPasses = 0;
std::string startTime(buffer);
TestCase testCase(i, &tc_array[i]);
- testCase.result = RunTestCaseInChildProcess(testCase, quiet);
-
- tt = system_clock::to_time_t(system_clock::now());
- strftime(buffer, BUFSIZE, "%c", localtime(&tt));
- std::string endTime(buffer);
-
- if(testCase.result == 0)
+ bool run = true;
+ if(!match.empty())
{
- numPasses++;
- }
- else
- {
- numFailures++;
+ if(match.compare(0, match.size(), testCase.name, match.size()))
+ {
+ run = false;
+ }
}
- if(!quiet)
+
+ if(run)
{
- OutputTestResult(ofs, processName, moduleName, testCase, startTime, endTime);
+ testCase.result = RunTestCaseInChildProcess(testCase, quiet);
+
+ tt = system_clock::to_time_t(system_clock::now());
+ strftime(buffer, BUFSIZE, "%c", localtime(&tt));
+ std::string endTime(buffer);
+
+ if(testCase.result == 0)
+ {
+ numPasses++;
+ }
+ else
+ {
+ numFailures++;
+ }
+ if(!quiet)
+ {
+ OutputTestResult(ofs, processName, moduleName, testCase, startTime, endTime);
+ }
}
}
ofs.close();
}
// Constantly runs up to MAX_NUM_CHILDREN processes
-int32_t RunAllInParallel(const char* processName, ::testcase tc_array[], bool reRunFailed, bool quiet)
+int32_t RunAllInParallel(const char* processName, ::testcase tc_array[], std::string match, bool reRunFailed, bool quiet)
{
int32_t numFailures = 0;
int32_t numPasses = 0;
// Create more children (up to the max number or til the end of the array)
while(numRunningChildren < MAX_NUM_CHILDREN && tc_array[nextTestCase].name)
{
- int32_t pid = fork();
- if(pid == 0) // Child process
+ bool run = true;
+ if(!match.empty())
{
- TestCase testCase(nextTestCase, &tc_array[nextTestCase]);
- int status = RunTestCaseRedirectOutput(testCase, quiet);
- exit(status);
+ if(match.compare(0, match.size(), tc_array[nextTestCase].name, match.size()))
+ {
+ run = false;
+ }
}
- else if(pid == -1)
+ if(run)
{
- perror("fork");
- exit(EXIT_STATUS_FORK_FAILED);
+ int32_t pid = fork();
+ if(pid == 0) // Child process
+ {
+ TestCase testCase(nextTestCase, &tc_array[nextTestCase]);
+ int status = RunTestCaseRedirectOutput(testCase, quiet);
+ exit(status);
+ }
+ else if(pid == -1)
+ {
+ perror("fork");
+ exit(EXIT_STATUS_FORK_FAILED);
+ }
+ else // Parent process
+ {
+ TestCase tc(nextTestCase, tc_array[nextTestCase].name);
+ tc.startTime = steady_clock::now();
+ tc.startSystemTime = system_clock::now();
+ tc.childPid = pid;
+
+ children[pid] = tc;
+ nextTestCase++;
+ numRunningChildren++;
+ }
}
- else // Parent process
+ else
{
- TestCase tc(nextTestCase, tc_array[nextTestCase].name);
- tc.startTime = steady_clock::now();
- tc.startSystemTime = system_clock::now();
- tc.childPid = pid;
-
- children[pid] = tc;
nextTestCase++;
- numRunningChildren++;
}
}
- // Check to see if any children have finished yet
int32_t status = 0;
- int32_t childPid = waitpid(-1, &status, WNOHANG);
+ int32_t childPid = 0;
+ if(numRunningChildren > 0) // Only wait if there are running children.
+ {
+ // Check to see if any children have finished yet
+ childPid = waitpid(-1, &status, WNOHANG);
+ }
+
if(childPid == 0)
{
// No children have finished.
int RunTests(int argc, char* const argv[], ::testcase tc_array[])
{
int result = TestHarness::EXIT_STATUS_BAD_ARGUMENT;
- const char* optString = "sfq";
+ const char* optString = "sfqm:";
bool optRerunFailed(true);
bool optRunSerially(false);
bool optQuiet(false);
+ std::string optMatch;
int nextOpt = 0;
do
case 'q':
optQuiet = true;
break;
+ case 'm':
+ optMatch = optarg;
+ break;
case '?':
TestHarness::Usage(argv[0]);
exit(TestHarness::EXIT_STATUS_BAD_ARGUMENT);
{
if(optRunSerially)
{
- result = TestHarness::RunAll(argv[0], tc_array, optQuiet);
+ result = TestHarness::RunAll(argv[0], tc_array, optMatch, optQuiet);
}
else
{
- result = TestHarness::RunAllInParallel(argv[0], tc_array, optRerunFailed, optQuiet);
+ result = TestHarness::RunAllInParallel(argv[0], tc_array, optMatch, optRerunFailed, optQuiet);
}
}
else
Dali::Integration::SceneHolder::WheelEventSignalType& WheelEventSignal();
+ Dali::Integration::SceneHolder::WheelEventGeneratedSignalType& WheelEventGeneratedSignal();
+
Integration::Scene GetScene();
Dali::RenderSurfaceInterface& GetRenderSurface();
return mScene.WheelEventSignal();
}
+Dali::Integration::SceneHolder::WheelEventGeneratedSignalType& SceneHolder::WheelEventGeneratedSignal()
+{
+ return mScene.WheelEventGeneratedSignal();
+}
+
Integration::Scene SceneHolder::GetScene()
{
return mScene;
return GetImplementation( *this ).WheelEventSignal();
}
+SceneHolder::WheelEventGeneratedSignalType& SceneHolder::WheelEventGeneratedSignal()
+{
+ return GetImplementation( *this ).WheelEventGeneratedSignal();
+}
+
} // Integration
} // Dali
return true;
}
- bool AddResponseBody(const std::string& body, uint32_t length) override
+ bool AddResponseBody(const int8_t* body, uint32_t length) override
{
return true;
}
- bool AddResponse(const std::string& headers, const std::string& body, uint32_t length) override
+ bool AddResponse(const std::string& headers, const int8_t* body, uint32_t length) override
{
return true;
}
- bool WriteResponseChunk(const std::string& chunk, uint32_t length) override
+ bool WriteResponseChunk(const int8_t* chunk, uint32_t length) override
{
return true;
}
return GetImplementation( window ).WheelEventSignal();
}
+WheelEventGeneratedSignalType& WheelEventGeneratedSignal( Window window )
+{
+ return GetImplementation( window ).WheelEventGeneratedSignal();
+}
+
VisibilityChangedSignalType& VisibilityChangedSignal( Window window )
{
return GetImplementation( window ).mVisibilityChangedSignal;
typedef Signal< void () > EventProcessingFinishedSignalType;
typedef Signal< bool (const KeyEvent&) > KeyEventGeneratedSignalType;
typedef Signal< void (const WheelEvent&) > WheelEventSignalType;
+typedef Signal< bool (const WheelEvent&) > WheelEventGeneratedSignalType;
typedef Signal< void ( Window, bool ) > VisibilityChangedSignalType;
Dali::Window Get( Actor actor );
EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window );
KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Dali::Window window );
WheelEventSignalType& WheelEventSignal( Window window );
+WheelEventGeneratedSignalType& WheelEventGeneratedSignal( Dali::Window window );
VisibilityChangedSignalType& VisibilityChangedSignal( Window window );
}
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/integration-api/events/touch-event-integ.h>
+#include <dali/integration-api/events/wheel-event-integ.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/focus-manager/keyboard-focus-manager-devel.h>
bool mIsCalled;
};
+class WheelEventCallback : public Dali::ConnectionTracker
+{
+public:
+ /**
+ * Constructor
+ * @param[in] returnValue Set return value of WheelEvent callback.
+ * */
+ WheelEventCallback( bool consumed )
+ : mConsumed( consumed ),
+ mIsCalled( false )
+ {
+ }
+
+ bool Callback( Actor actor, const WheelEvent& wheelEvent )
+ {
+ mIsCalled = true;
+ return mConsumed;
+ }
+
+ void Callback( const WheelEvent& wheelEvent )
+ {
+ mIsCalled = true;
+ }
+
+ bool mConsumed;
+ bool mIsCalled;
+};
+
// Used to connect to signals via the ConnectSignal Handle method
struct CallbackFunctor
{
DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
END_TEST;
+}
+
+int UtcDaliKeyboardFocusManagerCheckWheelEvent(void)
+{
+ ToolkitTestApplication application;
+
+ tet_infoline( "UtcDaliKeyboardFocusManagerCheckWheelEvent" );
+ Dali::Integration::Scene scene = application.GetScene();
+
+ KeyboardFocusManager manager = KeyboardFocusManager::Get();
+ DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() );
+
+ // Create the first actor and add it to the stage
+ Actor parent = Actor::New();
+ parent.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+
+ Actor child = Actor::New();
+ child.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+
+ parent.Add(child);
+ scene.Add(parent);
+
+ WheelEventCallback childCallback( false );
+ child.WheelEventSignal().Connect( &childCallback, &WheelEventCallback::Callback );
+
+ WheelEventCallback parentCallback( true );
+ parent.WheelEventSignal().Connect( &parentCallback, &WheelEventCallback::Callback );
+
+ WheelEventCallback sceneCallback( false );
+ scene.WheelEventSignal().Connect( &sceneCallback, &WheelEventCallback::Callback );
+
+ manager.SetCurrentFocusActor( child );
+
+ // Emit custom wheel event is comming to KeyboardFocusManager
+ Integration::WheelEvent event(Integration::WheelEvent::CUSTOM_WHEEL, 0, 0u, Vector2(0.0f, 0.0f), 1, 1000u);
+ application.ProcessEvent(event);
+
+ DALI_TEST_CHECK( childCallback.mIsCalled );
+ DALI_TEST_CHECK( parentCallback.mIsCalled );
+ DALI_TEST_CHECK( !sceneCallback.mIsCalled );
+
+ END_TEST;
}
\ No newline at end of file
Dali::Property::Map testHeaders;
testHeaders.Insert("key2", "value2");
DALI_TEST_CHECK(gRequestInterceptorInstance->AddResponseHeaders(testHeaders));
- DALI_TEST_CHECK(gRequestInterceptorInstance->AddResponseBody("test", 4));
- DALI_TEST_CHECK(gRequestInterceptorInstance->AddResponse("key:value", "test", 4));
- DALI_TEST_CHECK(gRequestInterceptorInstance->WriteResponseChunk("test", 4));
+ DALI_TEST_CHECK(gRequestInterceptorInstance->AddResponseBody((const int8_t*)"test", 4));
+ DALI_TEST_CHECK(gRequestInterceptorInstance->AddResponse("key:value", (const int8_t*)"test", 4));
+ DALI_TEST_CHECK(gRequestInterceptorInstance->WriteResponseChunk((const int8_t*)"test", 4));
std::string testUrl("http://test.html");
DALI_TEST_EQUALS(gRequestInterceptorInstance->GetUrl(), testUrl, TEST_LOCATION);
std::string testMethod("GET");
{
(*iter).KeyEventSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnKeyEvent);
(*iter).TouchedSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnTouch);
+ (*iter).WheelEventGeneratedSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnWheelEvent);
Dali::Window window = DevelWindow::DownCast(*iter);
if(window)
{
{
sceneHolder.KeyEventSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnKeyEvent);
sceneHolder.TouchedSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnTouch);
+ sceneHolder.WheelEventGeneratedSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnWheelEvent);
Dali::Window window = DevelWindow::DownCast(sceneHolder);
if(window)
{
// "Shift-Tab" key changes it in the backward direction.
if(!DoMoveFocusToNextFocusGroup(!event.IsShiftModifier()))
{
- // If the focus group is not changed, Move the focus towards right, "Shift-Tap" key moves the focus towards left.
- if(!MoveFocus(event.IsShiftModifier() ? Toolkit::Control::KeyboardFocus::LEFT : Toolkit::Control::KeyboardFocus::RIGHT))
- {
- // If the focus is not moved, Move the focus towards down, "Shift-Tap" key moves the focus towards up.
- MoveFocus(event.IsShiftModifier() ? Toolkit::Control::KeyboardFocus::UP : Toolkit::Control::KeyboardFocus::DOWN);
- }
+ // If the focus group is not changed, Move the focus towards forward, "Shift-Tap" key moves the focus towards backward.
+ MoveFocus(event.IsShiftModifier() ? Toolkit::Control::KeyboardFocus::BACKWARD : Toolkit::Control::KeyboardFocus::FORWARD);
}
}
}
}
+bool KeyboardFocusManager::OnWheelEvent(const WheelEvent& event)
+{
+ bool consumed = false;
+ Actor actor = GetCurrentFocusActor();
+ if(actor)
+ {
+ // Notify the actor about the wheel event
+ consumed = EmitWheelSignals(actor, event);
+ }
+ return consumed;
+}
+
+bool KeyboardFocusManager::EmitWheelSignals(Actor actor, const WheelEvent& event)
+{
+ bool consumed = false;
+
+ if(actor)
+ {
+ Dali::Actor oldParent(actor.GetParent());
+
+ // Only do the conversion and emit the signal if the actor's wheel signal has connections.
+ if(!actor.WheelEventSignal().Empty())
+ {
+ // Emit the signal to the parent
+ consumed = actor.WheelEventSignal().Emit(actor, event);
+ }
+ // if actor doesn't consume WheelEvent, give WheelEvent to its parent.
+ if(!consumed)
+ {
+ // The actor may have been removed/reparented during the signal callbacks.
+ Dali::Actor parent = actor.GetParent();
+
+ if(parent &&
+ (parent == oldParent))
+ {
+ consumed = EmitWheelSignals(parent, event);
+ }
+ }
+ }
+
+ return consumed;
+}
+
void KeyboardFocusManager::OnWindowFocusChanged(Window window, bool focusIn)
{
if(focusIn && mCurrentFocusedWindow.GetHandle() != window.GetRootLayer())
void OnTouch(const TouchEvent& touch);
/**
+ * Callback for the wheel event when the custom wheel event occurs.
+ * @param[in] wheel The WheelEvent information
+ */
+ bool OnWheelEvent(const WheelEvent& wheel);
+
+ /**
* Called when the window focus is changed.
* @param[in] window The window whose focus is changed
* @param[in] focusIn Whether the focus is in/out
*/
Actor GetFocusActorFromCurrentWindow();
+ /**
+ * Recursively deliver events to the control and its parents, until the event is consumed or the stage is reached.
+ * @param[in] actor The actor got WheelEvent.
+ * @param[in] event The WheelEvent.
+ * @return True if WheelEvent is consumed.
+ */
+ bool EmitWheelSignals(Actor actor, const WheelEvent& event);
+
private:
// Undefined
KeyboardFocusManager(const KeyboardFocusManager&);
*/
enum Direction
{
- LEFT, ///< Move keyboard focus towards the left direction @SINCE_1_0.0
- RIGHT, ///< Move keyboard focus towards the right direction @SINCE_1_0.0
- UP, ///< Move keyboard focus towards the up direction @SINCE_1_0.0
- DOWN, ///< Move keyboard focus towards the down direction @SINCE_1_0.0
- PAGE_UP, ///< Move keyboard focus towards the previous page direction @SINCE_1_2.14
- PAGE_DOWN ///< Move keyboard focus towards the next page direction @SINCE_1_2.14
+ LEFT, ///< Move keyboard focus towards the left direction @SINCE_1_0.0
+ RIGHT, ///< Move keyboard focus towards the right direction @SINCE_1_0.0
+ UP, ///< Move keyboard focus towards the up direction @SINCE_1_0.0
+ DOWN, ///< Move keyboard focus towards the down direction @SINCE_1_0.0
+ PAGE_UP, ///< Move keyboard focus towards the previous page direction @SINCE_1_2.14
+ PAGE_DOWN, ///< Move keyboard focus towards the next page direction @SINCE_1_2.14
+ FORWARD, ///< Move keyboard focus towards the forward direction @SINCE_2_1.10
+ BACKWARD, ///< Move keyboard focus towards the backward direction @SINCE_2_1.10
};
};
{
const unsigned int TOOLKIT_MAJOR_VERSION = 2;
const unsigned int TOOLKIT_MINOR_VERSION = 1;
-const unsigned int TOOLKIT_MICRO_VERSION = 8;
+const unsigned int TOOLKIT_MICRO_VERSION = 10;
const char* const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali2-toolkit
Summary: Dali 3D engine Toolkit
-Version: 2.1.8
+Version: 2.1.10
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT