Changeset 247244 in webkit


Ignore:
Timestamp:
Jul 8, 2019 6:03:27 PM (5 years ago)
Author:
Fujii Hironori
Message:

JSTestGlobalObject.cpp of bindings-generation-tests is failing for Windows Python
https://bugs.webkit.org/show_bug.cgi?id=199487

Reviewed by Ross Kirsling.

In Windows Python, preprocessor.pm is using cl.exe. cl.exe was
failing to open testglobalscope_constructors_file which was
created by using tempfile.mkstemp() because it keeps the file
open. Use tempfile.mkdtemp() to create temporary files in the
temporary directory instead of tempfile.mkstemp().

  • Scripts/webkitpy/bindings/main.py:

(BindingsTests.run_tests):
(BindingsTests.main):
(BindingsTests.close_and_remove): Deleted.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r247242 r247244  
     12019-07-08  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        JSTestGlobalObject.cpp of bindings-generation-tests is failing for Windows Python
     4        https://bugs.webkit.org/show_bug.cgi?id=199487
     5
     6        Reviewed by Ross Kirsling.
     7
     8        In Windows Python, preprocessor.pm is using cl.exe. cl.exe was
     9        failing to open testglobalscope_constructors_file which was
     10        created by using tempfile.mkstemp() because it keeps the file
     11        open. Use tempfile.mkdtemp() to create temporary files in the
     12        temporary directory instead of tempfile.mkstemp().
     13
     14        * Scripts/webkitpy/bindings/main.py:
     15        (BindingsTests.run_tests):
     16        (BindingsTests.main):
     17        (BindingsTests.close_and_remove): Deleted.
     18
    1192019-07-08  Aakash Jain  <aakash_jain@apple.com>
    220
  • trunk/Tools/Scripts/webkitpy/bindings/main.py

    r245036 r247244  
    175175        return passed
    176176
    177     def close_and_remove(self, temporary_file):
    178         os.close(temporary_file[0])
    179         os.remove(temporary_file[1])
    180 
    181177    def main(self):
    182178        current_scm = detect_scm_system(os.curdir)
     
    185181        all_tests_passed = True
    186182
     183        work_directory = tempfile.mkdtemp()
    187184        input_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test')
    188         supplemental_dependency_file = tempfile.mkstemp()
    189         window_constructors_file = tempfile.mkstemp()
    190         workerglobalscope_constructors_file = tempfile.mkstemp()
    191         dedicatedworkerglobalscope_constructors_file = tempfile.mkstemp()
    192         serviceworkerglobalscope_constructors_file = tempfile.mkstemp()
    193         workletglobalscope_constructors_file = tempfile.mkstemp()
    194         paintworkletglobalscope_constructors_file = tempfile.mkstemp()
    195         testglobalscope_constructors_file = tempfile.mkstemp()
    196         if self.generate_supplemental_dependency(input_directory, supplemental_dependency_file[1], window_constructors_file[1], workerglobalscope_constructors_file[1], dedicatedworkerglobalscope_constructors_file[1], serviceworkerglobalscope_constructors_file[1], workletglobalscope_constructors_file[1], paintworkletglobalscope_constructors_file[1], testglobalscope_constructors_file[1]):
     185        supplemental_dependency_file = os.path.join(work_directory, 'supplemental_dependency.tmp')
     186        window_constructors_file = os.path.join(work_directory, 'DOMWindowConstructors.idl')
     187        workerglobalscope_constructors_file = os.path.join(work_directory, 'WorkerGlobalScopeConstructors.idl')
     188        dedicatedworkerglobalscope_constructors_file = os.path.join(work_directory, 'DedicatedWorkerGlobalScopeConstructors.idl')
     189        serviceworkerglobalscope_constructors_file = os.path.join(work_directory, 'ServiceWorkerGlobalScopeConstructors.idl')
     190        workletglobalscope_constructors_file = os.path.join(work_directory, 'WorkletGlobalScopeConstructors.idl')
     191        paintworkletglobalscope_constructors_file = os.path.join(work_directory, 'PaintWorkletGlobalScopeConstructors.idl')
     192        testglobalscope_constructors_file = os.path.join(work_directory, 'BindingTestGlobalConstructors.idl')
     193        if self.generate_supplemental_dependency(input_directory, supplemental_dependency_file, window_constructors_file, workerglobalscope_constructors_file, dedicatedworkerglobalscope_constructors_file, serviceworkerglobalscope_constructors_file, workletglobalscope_constructors_file, paintworkletglobalscope_constructors_file, testglobalscope_constructors_file):
    197194            print('Failed to generate a supplemental dependency file.')
    198             self.close_and_remove(supplemental_dependency_file)
    199             self.close_and_remove(window_constructors_file)
    200             self.close_and_remove(workerglobalscope_constructors_file)
    201             self.close_and_remove(dedicatedworkerglobalscope_constructors_file)
    202             self.close_and_remove(serviceworkerglobalscope_constructors_file)
    203             self.close_and_remove(workletglobalscope_constructors_file)
    204             self.close_and_remove(paintworkletglobalscope_constructors_file)
    205             self.close_and_remove(testglobalscope_constructors_file)
     195            shutil.rmtree(work_directory)
    206196            return -1
    207197
     
    209199            input_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test')
    210200            reference_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test', generator)
    211             if not self.run_tests(generator, input_directory, reference_directory, supplemental_dependency_file[1]):
     201            if not self.run_tests(generator, input_directory, reference_directory, supplemental_dependency_file):
    212202                all_tests_passed = False
    213203
    214         self.close_and_remove(supplemental_dependency_file)
    215         self.close_and_remove(window_constructors_file)
    216         self.close_and_remove(workerglobalscope_constructors_file)
    217         self.close_and_remove(dedicatedworkerglobalscope_constructors_file)
    218         self.close_and_remove(serviceworkerglobalscope_constructors_file)
    219         self.close_and_remove(workletglobalscope_constructors_file)
    220         self.close_and_remove(paintworkletglobalscope_constructors_file)
    221         self.close_and_remove(testglobalscope_constructors_file)
     204        shutil.rmtree(work_directory)
    222205
    223206        if self.json_file_name:
Note: See TracChangeset for help on using the changeset viewer.