aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/imgui/examples/imgui_impl_marmalade.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/imgui/examples/imgui_impl_marmalade.h')
0 files changed, 0 insertions, 0 deletions
href='#n1'>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363
require 'ceedling/defaults'
require 'ceedling/constants'
require 'ceedling/file_path_utils'
require 'deep_merge'



class Configurator

  attr_reader :project_config_hash, :script_plugins, :rake_plugins
  attr_accessor :project_logging, :project_debug, :project_verbosity, :sanity_checks

  constructor(:configurator_setup, :configurator_builder, :configurator_plugins, :cmock_builder, :yaml_wrapper, :system_wrapper) do
    @project_logging   = false
    @project_debug     = false
    @project_verbosity = Verbosity::NORMAL
    @sanity_checks     = TestResultsSanityChecks::NORMAL
  end

  def setup
    # special copy of cmock config to provide to cmock for construction
    @cmock_config_hash = {}

    # note: project_config_hash is an instance variable so constants and accessors created
    # in eval() statements in build() have something of proper scope and persistence to reference
    @project_config_hash = {}
    @project_config_hash_backup = {}

    @script_plugins = []
    @rake_plugins   = []
  end


  def replace_flattened_config(config)
    @project_config_hash.merge!(config)
    @configurator_setup.build_constants_and_accessors(@project_config_hash, binding())
  end


  def store_config
    @project_config_hash_backup = @project_config_hash.clone
  end


  def restore_config
    @project_config_hash = @project_config_hash_backup
    @configurator_setup.build_constants_and_accessors(@project_config_hash, binding())
  end


  def reset_defaults(config)
    [:test_compiler,
     :test_linker,
     :test_fixture,
     :test_includes_preprocessor,
     :test_file_preprocessor,
     :test_dependencies_generator,
     :release_compiler,
     :release_assembler,
     :release_linker,
     :release_dependencies_generator].each do |tool|
      config[:tools].delete(tool) if (not (config[:tools][tool].nil?))
    end
  end


  # The default values defined in defaults.rb (eg. DEFAULT_TOOLS_TEST) are populated
  # into @param config
  def populate_defaults(config)
    new_config = DEFAULT_CEEDLING_CONFIG.deep_clone
    new_config.deep_merge!(config)
    config.replace(new_config)

    @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST )
    @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST_PREPROCESSORS ) if (config[:project][:use_test_preprocessor])
    @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST_DEPENDENCIES )  if (config[:project][:use_deep_dependencies])

    @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE )              if (config[:project][:release_build])
    @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE_ASSEMBLER )    if (config[:project][:release_build] and config[:release_build][:use_assembly])
    @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE_DEPENDENCIES ) if (config[:project][:release_build] and config[:project][:use_deep_dependencies])
  end


  def populate_unity_defaults(config)
      unity = config[:unity] || {}
      @runner_config = unity.merge(@runner_config || config[:test_runner] || {})
  end

  def populate_cmock_defaults(config)
    # cmock has its own internal defaults handling, but we need to set these specific values
    # so they're present for the build environment to access;
    # note: these need to end up in the hash given to initialize cmock for this to be successful
    cmock = config[:cmock] || {}

    # yes, we're duplicating the default mock_prefix in cmock, but it's because we need CMOCK_MOCK_PREFIX always available in Ceedling's environment
    cmock[:mock_prefix] = 'Mock' if (cmock[:mock_prefix].nil?)

    # just because strict ordering is the way to go
    cmock[:enforce_strict_ordering] = true                                                  if (cmock[:enforce_strict_ordering].nil?)

    cmock[:mock_path] = File.join(config[:project][:build_root], TESTS_BASE_PATH, 'mocks')  if (cmock[:mock_path].nil?)
    cmock[:verbosity] = @project_verbosity                                                  if (cmock[:verbosity].nil?)

    cmock[:plugins] = []                             if (cmock[:plugins].nil?)
    cmock[:plugins].map! { |plugin| plugin.to_sym }
    cmock[:plugins] << (:cexception)                 if (!cmock[:plugins].include?(:cexception) and (config[:project][:use_exceptions]))
    cmock[:plugins].uniq!

    cmock[:unity_helper] = false                     if (cmock[:unity_helper].nil?)

    if (cmock[:unity_helper])
      cmock[:unity_helper] = [cmock[:unity_helper]] if cmock[:unity_helper].is_a? String
      cmock[:includes] += cmock[:unity_helper].map{|helper| File.basename(helper) }
      cmock[:includes].uniq!
    end

    @runner_config = cmock.merge(@runner_config || config[:test_runner] || {})

    @cmock_builder.manufacture(cmock)
  end


  def get_runner_config
    @runner_config
  end


  # grab tool names from yaml and insert into tool structures so available for error messages
  # set up default values
  def tools_setup(config)
    config[:tools].each_key do |name|
      tool = config[:tools][name]

      # populate name if not given
      tool[:name] = name.to_s if (tool[:name].nil?)

      # handle inline ruby string substitution in executable
      if (tool[:executable] =~ RUBY_STRING_REPLACEMENT_PATTERN)
        tool[:executable].replace(@system_wrapper.module_eval(tool[:executable]))
      end

      # populate stderr redirect option
      tool[:stderr_redirect] = StdErrRedirect::NONE if (tool[:stderr_redirect].nil?)

      # populate background execution option
      tool[:background_exec] = BackgroundExec::NONE if (tool[:background_exec].nil?)

      # populate optional option to control verification of executable in search paths
      tool[:optional] = false if (tool[:optional].nil?)
    end
  end


  def tools_supplement_arguments(config)
    tools_name_prefix = 'tools_'
    config[:tools].each_key do |name|
      tool = @project_config_hash[(tools_name_prefix + name.to_s).to_sym]

      # smoosh in extra arguments if specified at top-level of config (useful for plugins & default gcc tools)
      # arguments are squirted in at _end_ of list
      top_level_tool = (tools_name_prefix + name.to_s).to_sym
      if (not config[top_level_tool].nil?)
         # adding and flattening is not a good idea: might over-flatten if there's array nesting in tool args
         tool[:arguments].concat config[top_level_tool][:arguments]
      end
    end
  end


  def find_and_merge_plugins(config)
    # plugins must be loaded before generic path evaluation & magic that happen later;
    # perform path magic here as discrete step
    config[:plugins][:load_paths].each do |path|
      path.replace(@system_wrapper.module_eval(path)) if (path =~ RUBY_STRING_REPLACEMENT_PATTERN)
      FilePathUtils::standardize(path)
    end

    config[:plugins][:load_paths] << FilePathUtils::standardize(Ceedling.load_path)
    config[:plugins][:load_paths].uniq!

    paths_hash = @configurator_plugins.add_load_paths(config)

    @rake_plugins   = @configurator_plugins.find_rake_plugins(config, paths_hash)
    @script_plugins = @configurator_plugins.find_script_plugins(config, paths_hash)
    config_plugins  = @configurator_plugins.find_config_plugins(config, paths_hash)
    plugin_defaults = @configurator_plugins.find_plugin_defaults(config, paths_hash)

    config_plugins.each do |plugin|