gyptest-link-mapfile.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/env python
  2. # Copyright (c) 2013 Google Inc. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. """
  6. Make sure mapfile settings are extracted properly.
  7. """
  8. import TestGyp
  9. import sys
  10. if sys.platform == 'win32':
  11. test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
  12. CHDIR = 'linker-flags'
  13. test.run_gyp('mapfile.gyp', chdir=CHDIR)
  14. test.build('mapfile.gyp', test.ALL, chdir=CHDIR)
  15. map_file = test.built_file_path('test_mapfile_unset.map', chdir=CHDIR)
  16. test.must_not_exist(map_file)
  17. map_file = test.built_file_path('test_mapfile_generate.map', chdir=CHDIR)
  18. test.must_exist(map_file)
  19. test.must_contain(map_file, '?AnExportedFunction@@YAXXZ')
  20. test.must_not_contain(map_file, 'void __cdecl AnExportedFunction(void)')
  21. map_file = test.built_file_path('test_mapfile_generate_exports.map',
  22. chdir=CHDIR)
  23. test.must_exist(map_file)
  24. test.must_contain(map_file, 'void __cdecl AnExportedFunction(void)')
  25. map_file = test.built_file_path('test_mapfile_generate_filename.map',
  26. chdir=CHDIR)
  27. test.must_not_exist(map_file)
  28. map_file = test.built_file_path('custom_file_name.map', chdir=CHDIR)
  29. test.must_exist(map_file)
  30. test.must_contain(map_file, '?AnExportedFunction@@YAXXZ')
  31. test.must_not_contain(map_file, 'void __cdecl AnExportedFunction(void)')
  32. test.pass_test()