Changeset 161857 in webkit


Ignore:
Timestamp:
Jan 12, 2014 8:09:39 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL][WK2] Make API tests work again
https://bugs.webkit.org/show_bug.cgi?id=126769

Patch by Sergio Correia <Sergio Correia> on 2014-01-12
Reviewed by Gyuyoung Kim.

The EFL and WK2 test binaries are currently being generated at *TestWebKitAPI/
[E]WebKit2, respectively, and this causes problems because the logic to find
where WebProcess is to look in the same directory of the running process and
then proceed to use LIBEXECDIR (typically /usr/loca/bin).

This patch introduces a WEBKIT_EXEC_PATH environment variable, inspired in the
Gtk port, which allows us to look for WebProcess initially in this directory,
if it's defined.

.:

  • Source/cmake/OptionsEfl.cmake: Define WEBKIT_EXEC_PATH, to be used by

[E]WebKit2 tests.

Source/WebKit2:

  • Shared/efl/ProcessExecutablePathEfl.cpp:

(WebKit::findProcessPath): Change the logic to look initially in
WEBKIT_EXEC_PATH, then proceed with the existing checks.

  • UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp:

(EWK2UnitTest::EWK2UnitTestEnvironment::EWK2UnitTestEnvironment):
Define WEBKIT_EXEC_PATH to be used by EWebKit2 tests.

Tools:

  • TestWebKitAPI/efl/main.cpp:

(main): Define WEBKIT_EXEC_PATH to be used by WebKit2 API tests.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r161772 r161857  
     12014-01-12  Sergio Correia  <sergio.correia@openbossa.org>
     2
     3        [EFL][WK2] Make API tests work again
     4        https://bugs.webkit.org/show_bug.cgi?id=126769
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        The EFL and WK2 test binaries are currently being generated at *TestWebKitAPI/
     9        [E]WebKit2, respectively, and this causes problems because the logic to find
     10        where WebProcess is to look in the same directory of the running process and
     11        then proceed to use LIBEXECDIR (typically /usr/loca/bin).
     12
     13        This patch introduces a WEBKIT_EXEC_PATH environment variable, inspired in the
     14        Gtk port, which allows us to look for WebProcess initially in this directory,
     15        if it's defined.
     16
     17        * Source/cmake/OptionsEfl.cmake: Define WEBKIT_EXEC_PATH, to be used by
     18        [E]WebKit2 tests.
     19
    1202014-01-11  Dan Bernstein  <mitz@apple.com>
    221
  • trunk/Source/WebKit2/ChangeLog

    r161851 r161857  
     12014-01-12  Sergio Correia  <sergio.correia@openbossa.org>
     2
     3        [EFL][WK2] Make API tests work again
     4        https://bugs.webkit.org/show_bug.cgi?id=126769
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        The EFL and WK2 test binaries are currently being generated at *TestWebKitAPI/
     9        [E]WebKit2, respectively, and this causes problems because the logic to find
     10        where WebProcess is to look in the same directory of the running process and
     11        then proceed to use LIBEXECDIR (typically /usr/loca/bin).
     12
     13        This patch introduces a WEBKIT_EXEC_PATH environment variable, inspired in the
     14        Gtk port, which allows us to look for WebProcess initially in this directory,
     15        if it's defined.
     16
     17        * Shared/efl/ProcessExecutablePathEfl.cpp:
     18        (WebKit::findProcessPath): Change the logic to look initially in
     19        WEBKIT_EXEC_PATH, then proceed with the existing checks.
     20        * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp:
     21        (EWK2UnitTest::EWK2UnitTestEnvironment::EWK2UnitTestEnvironment):
     22        Define WEBKIT_EXEC_PATH to be used by EWebKit2 tests.
     23
    1242014-01-12  Darin Adler  <darin@apple.com>
    225
  • trunk/Source/WebKit2/Shared/efl/ProcessExecutablePathEfl.cpp

    r155934 r161857  
    2929#include "FileSystem.h"
    3030#include <libgen.h>
    31 #include <sys/stat.h>
    32 #include <sys/types.h>
    3331#include <unistd.h>
    3432#include <wtf/StdLibExtras.h>
     
    3735namespace WebKit {
    3836
     37// We initially look for the process in WEBKIT_EXEC_PATH, then proceed to try the working
     38// directory of the running process, and finally we try LIBEXECDIR (usually /usr/local/bin).
    3939static String findProcessPath(const char* processName)
    4040{
     41    String executablePath;
     42    static const char* execDirectory = getenv("WEBKIT_EXEC_PATH");
     43    if (execDirectory) {
     44        executablePath = WebCore::pathByAppendingComponent(String::fromUTF8(execDirectory), processName);
     45        if (WebCore::fileExists(executablePath))
     46            return executablePath;
     47    }
     48
    4149#if OS(UNIX)
    4250    char readLinkBuffer[PATH_MAX] = {0};
     
    4957    if (result > 0) {
    5058        char* executablePathPtr = dirname(readLinkBuffer);
    51         String executablePath = WebCore::pathByAppendingComponent(String(executablePathPtr), processName);
    52 
    53         // Checks whether process exist on the current path.
    54         struct stat fileStat;
    55         if (!stat(executablePath.utf8().data(), &fileStat))
     59        executablePath = WebCore::pathByAppendingComponent(String::fromUTF8(executablePathPtr), processName);
     60        if (WebCore::fileExists(executablePath))
    5661            return executablePath;
    5762    }
    5863#endif
    59 
    60     return WebCore::pathByAppendingComponent(String(LIBEXECDIR), processName);
     64    executablePath = WebCore::pathByAppendingComponent(String(LIBEXECDIR), processName);
     65    ASSERT(WebCore::fileExists(executablePath));
     66    return executablePath;
    6167}
    6268
  • trunk/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp

    r155163 r161857  
    3131    , m_defaultHeight(600)
    3232{
     33    setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, false);
    3334}
    3435
  • trunk/Source/cmake/OptionsEfl.cmake

    r161672 r161857  
    288288    set(HAVE_LLVM ON)
    289289endif ()
     290
     291# [E]WebKit2 tests need a hint to find out where processes such as WebProcess are located at.
     292add_definitions(-DWEBKIT_EXEC_PATH=\"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}\")
  • trunk/Tools/ChangeLog

    r161845 r161857  
     12014-01-12  Sergio Correia  <sergio.correia@openbossa.org>
     2
     3        [EFL][WK2] Make API tests work again
     4        https://bugs.webkit.org/show_bug.cgi?id=126769
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        The EFL and WK2 test binaries are currently being generated at *TestWebKitAPI/
     9        [E]WebKit2, respectively, and this causes problems because the logic to find
     10        where WebProcess is to look in the same directory of the running process and
     11        then proceed to use LIBEXECDIR (typically /usr/loca/bin).
     12
     13        This patch introduces a WEBKIT_EXEC_PATH environment variable, inspired in the
     14        Gtk port, which allows us to look for WebProcess initially in this directory,
     15        if it's defined.
     16
     17        * TestWebKitAPI/efl/main.cpp:
     18        (main): Define WEBKIT_EXEC_PATH to be used by WebKit2 API tests.
     19
    1202014-01-12  Daniel Bates  <dabates@apple.com>
    221
  • trunk/Tools/TestWebKitAPI/efl/main.cpp

    r124327 r161857  
    5151{
    5252    WTFInstallReportBacktraceOnCrashHook();
     53    setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, false);
    5354
    5455    if (!eina_init())
Note: See TracChangeset for help on using the changeset viewer.