![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/local/lib/node_modules/mediasoup/worker/deps/gyp/test/defines/ |
Upload File : |
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies build of an executable with C++ define specified by a gyp define, and the use of the environment during regeneration when the gyp file changes. """ import os import TestGyp # Regenerating build files when a gyp file changes is currently only supported # by the make generator. test = TestGyp.TestGyp(formats=['make']) try: os.environ['GYP_DEFINES'] = 'value=50' test.run_gyp('defines.gyp') finally: # We clear the environ after calling gyp. When the auto-regeneration happens, # the same define should be reused anyway. Reset to empty string first in # case the platform doesn't support unsetenv. os.environ['GYP_DEFINES'] = '' del os.environ['GYP_DEFINES'] test.build('defines.gyp') expect = """\ FOO is defined VALUE is 1 2*PAREN_VALUE is 12 HASH_VALUE is a#1 """ test.run_built_executable('defines', stdout=expect) # Sleep so that the changed gyp file will have a newer timestamp than the # previously generated build files. test.sleep() test.write('defines.gyp', test.read('defines-env.gyp')) test.build('defines.gyp', test.ALL) expect = """\ VALUE is 50 """ test.run_built_executable('defines', stdout=expect) test.pass_test()