Devuan fork of gpsd
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

143 lines
3.0 KiB

  1. #!/usr/bin/env python
  2. # This code runs compatibly under Python 2 and 3.x for x >= 2.
  3. # Preserve this property!
  4. from __future__ import absolute_import, print_function, division
  5. import os
  6. always_on = [
  7. 'minimal',
  8. ]
  9. always_off = [
  10. 'leapfetch',
  11. ]
  12. other = [
  13. 'debug',
  14. 'chrpath',
  15. 'ipv6',
  16. 'manbuild',
  17. 'nostrip',
  18. 'slow',
  19. 'profiling',
  20. 'libQgpsmm',
  21. ]
  22. knobs = [
  23. 'aivdm',
  24. 'ashtech',
  25. 'bluez',
  26. 'clientdebug',
  27. 'control_socket',
  28. 'controlsend',
  29. 'coveraging',
  30. 'dbus_export',
  31. 'earthmate',
  32. 'evermore',
  33. 'force_global',
  34. 'fury',
  35. 'fv18',
  36. 'garmin',
  37. 'garmintxt',
  38. 'geostar',
  39. 'gpsclock',
  40. 'gpsd',
  41. 'gpsdclients',
  42. 'itrax',
  43. 'libgpsmm',
  44. 'mtk3301',
  45. 'navcom',
  46. 'ncurses',
  47. 'netfeed',
  48. 'nmea0183',
  49. 'nmea2000',
  50. 'nofloats',
  51. 'ntp',
  52. 'ntpshm',
  53. 'ntrip',
  54. 'oceanserver',
  55. 'oncore',
  56. 'passthrough',
  57. 'pps',
  58. 'python',
  59. 'qt',
  60. 'reconfigure',
  61. 'rtcm104v2',
  62. 'rtcm104v3',
  63. 'shared',
  64. 'shm_export',
  65. 'sirf',
  66. 'socket_export',
  67. 'squelch',
  68. 'superstar2',
  69. 'systemd',
  70. 'timing',
  71. 'tnt',
  72. 'tripmate',
  73. 'tsip',
  74. 'ublox',
  75. 'usb',
  76. 'xgps',
  77. ]
  78. def main(starting_number_of_options=0):
  79. import itertools
  80. import multiprocessing
  81. import shutil
  82. import subprocess
  83. num_cpus = multiprocessing.cpu_count()
  84. job_arg = '-j%d' % num_cpus
  85. failed_configurations = []
  86. dev_null = open('/dev/null', 'w')
  87. def _run(command, phase):
  88. if subprocess.call(command, stdout=dev_null) == 0:
  89. return True
  90. failed_configurations.append(command)
  91. print(command)
  92. with open('failed_%s_configs.txt' % phase, 'a') as failed_configs:
  93. failed_configs.write(' '.join(command) + '\n')
  94. return False
  95. static_params = [key + '=on' for key in always_on]
  96. static_params += [key + '=off' for key in always_off]
  97. for i in range(starting_number_of_options, len(knobs)):
  98. print('Testing at length {}'.format(i))
  99. for row in itertools.combinations(knobs, i):
  100. print(row)
  101. params = static_params + [key + '=on' for key in row]
  102. # print {'on_params': row, 'scons_params': params}
  103. # Clean before clearing cached options, in case options
  104. # affect what's cleaned.
  105. subprocess.call(['scons', '-c'], stdout=dev_null)
  106. # Now remove all the scons temporaries
  107. try:
  108. shutil.rmtree('.sconf_temp')
  109. except OSError:
  110. pass
  111. for f in ['.sconsign.dblite', '.scons-option-cache']:
  112. try:
  113. os.remove(f)
  114. except OSError:
  115. pass
  116. if _run(['scons', job_arg, 'build-all'] + params, 'build'):
  117. _run(['scons', job_arg, 'check'] + params, 'check')
  118. return failed_configurations
  119. if __name__ == '__main__':
  120. failed = main(0)
  121. for row in failed:
  122. print(' '.join(row))