Author: dsahlberg Date: Thu Jul 3 18:36:03 2025 New Revision: 1926945 URL: http://svn.apache.org/viewvc?rev=1926945&view=rev Log: In the PR-8 branch, catch up with trunk as of r1926944
Modified: serf/branches/PR-8/ (props changed) serf/branches/PR-8/README serf/branches/PR-8/SConstruct Propchange: serf/branches/PR-8/ ------------------------------------------------------------------------------ Merged /serf/trunk:r1926941-1926944 Modified: serf/branches/PR-8/README URL: http://svn.apache.org/viewvc/serf/branches/PR-8/README?rev=1926945&r1=1926944&r2=1926945&view=diff ============================================================================== --- serf/branches/PR-8/README (original) +++ serf/branches/PR-8/README Thu Jul 3 18:36:03 2025 @@ -223,16 +223,15 @@ or, with a multi-config generator: $ ctest -C Release -This is equivalent to +This is equivalent to: $ cmake --build out --target test -or +or: $ cmake --build out --config Release --target test -(or, on Windows using the Visual Studio generator, which always has to be - special and different for no discernible benefit: +or, on Windows using the Visual Studio generator: $ cmake --build out --config Release --target run_tests ) Modified: serf/branches/PR-8/SConstruct URL: http://svn.apache.org/viewvc/serf/branches/PR-8/SConstruct?rev=1926945&r1=1926944&r2=1926945&view=diff ============================================================================== --- serf/branches/PR-8/SConstruct (original) +++ serf/branches/PR-8/SConstruct Thu Jul 3 18:36:03 2025 @@ -418,6 +418,9 @@ if export_filter is not None: env.GenExports(target=export_filter, source=HEADER_FILES) env.Depends(lib_shared, export_filter) +# We do not want or need OpenSSL's compatibility macros. +env.Append(CPPDEFINES=['OPENSSL_NO_DEPRECATED']) + # Define OPENSSL_NO_STDIO to prevent using _fp() API. env.Append(CPPDEFINES=['OPENSSL_NO_STDIO']) @@ -582,7 +585,7 @@ else: env.Append(LIBPATH=['$OPENSSL/lib']) if brotli: - brotli_libs = '-lbrotlicommon -lbrotlienc' + brotli_libs = '-lbrotlicommon -lbrotlidec' env.Append(CPPPATH=['$BROTLI/include'], LIBPATH=['$BROTLI/lib']) else: @@ -727,24 +730,30 @@ env.Alias('install', ['install-lib', 'in ### make move to a separate scons file in the test/ subdir? tenv = env.Clone() +tenv.Append(CPPDEFINES=['MOCKHTTP_OPENSSL']) + +# Build the MockHTTP static library. MockHTTP needs C99 and OpenSSL's +# deprecated APIs. +mockenv = tenv.Clone() +mockenv.Replace(CFLAGS = [f.replace('-std=c89', '-std=c99') + for f in mockenv['CFLAGS']]) +mockenv.Replace(CPPDEFINES = list(filter(lambda d: d != 'OPENSSL_NO_DEPRECATED', + mockenv['CPPDEFINES']))) + +mockhttpinc = mockenv.StaticLibrary('mockhttpinc', + ['test/MockHTTPinC/MockHTTP.c', + 'test/MockHTTPinC/MockHTTP_server.c']) # Check if long-running tests should be enabled if tenv.get('ENABLE_SLOW_TESTS', None): tenv.Append(CPPDEFINES=['SERF_TEST_DEFLATE_4GBPLUS_BUCKETS']) -# MockHTTP requires C99 standard, so use it for the test suite. -cflags = tenv['CFLAGS'] -tenv.Replace(CFLAGS = [f.replace('-std=c89', '-std=c99') for f in cflags]) - -tenv.Append(CPPDEFINES=['MOCKHTTP_OPENSSL']) - TEST_PROGRAMS = [ 'serf_get', 'serf_response', 'serf_request', 'serf_spider', 'serf_httpd', 'test_all', 'serf_bwtp' ] -if sys.platform == 'win32': - TEST_EXES = [ os.path.join('test', '%s.exe' % (prog)) for prog in TEST_PROGRAMS ] -else: - TEST_EXES = [ os.path.join('test', '%s' % (prog)) for prog in TEST_PROGRAMS ] + +_exe = '.exe' if sys.platform == 'win32' else '' +TEST_EXES = [os.path.join('test', '%s%s' % (prog, _exe)) for prog in TEST_PROGRAMS] check_script = env.File('build/check.py').rstr() test_dir = env.File('test/test_all.c').rfile().get_dir() @@ -772,18 +781,18 @@ testall_files = [ 'test/mock_buckets.c', 'test/mock_sock_buckets.c', 'test/test_ssl.c', - 'test/MockHTTPinC/MockHTTP.c', - 'test/MockHTTPinC/MockHTTP_server.c', ] # We link the programs explicitly against the static libraries, to allow # access to private functions +mocklib = mockhttpinc[0].rfile().abspath +serflib = lib_static[0].rfile().abspath for proggie in TEST_EXES: if 'test_all' in proggie: - tenv.Program(proggie, testall_files + [LIBNAME + env['LIBSUFFIX']]) + tenv.Program(proggie, testall_files + [mocklib, serflib]) else: - tenv.Program(target = proggie, source = [proggie.replace('.exe','') + '.c', - LIBNAME + env['LIBSUFFIX']]) + tenv.Program(target=proggie, + source=[proggie.replace('.exe','') + '.c', serflib]) # HANDLE CLEANING