# Copyright 2019 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

import("$dir_pw_bloat/bloat.gni")
import("$dir_pw_docgen/docs.gni")
import("$dir_pw_unit_test/test.gni")

config("default_config") {
  include_dirs = [ "public" ]
}

source_set("pw_string") {
  public_configs = [
    "$dir_pw_build:pw_default_cpp",
    ":default_config",
  ]
  public = [
    "public/pw_string/format.h",
    "public/pw_string/to_string.h",
    "public/pw_string/type_to_string.h",
    "public/pw_string/util.h",
  ]
  sources = [
    "format.cc",
    "string_builder.cc",
    "type_to_string.cc",
  ]
  sources += public
  public_deps = [
    "$dir_pw_preprocessor",
    "$dir_pw_span",
    "$dir_pw_status",
  ]
}

pw_test_group("tests") {
  tests = [
    ":format_test",
    ":to_string_test",
    ":type_to_string_test",
  ]
  group_deps = [
    "$dir_pw_preprocessor:tests",
    "$dir_pw_span:tests",
    "$dir_pw_status:tests",
  ]
}

pw_test("format_test") {
  deps = [
    ":pw_string",
  ]
  sources = [
    "format_test.cc",
  ]
}

pw_test("string_builder_test") {
  deps = [
    ":pw_string",
    "$dir_pw_unit_test:main",
  ]
  sources = [
    "string_builder_test.cc",
  ]
}

pw_test("to_string_test") {
  deps = [
    ":pw_string",
  ]
  sources = [
    "to_string_test.cc",
  ]
}

pw_test("type_to_string_test") {
  deps = [
    ":pw_string",
  ]
  sources = [
    "type_to_string_test.cc",
  ]
}

pw_test("util_test") {
  deps = [
    ":pw_string",
    "$dir_pw_unit_test:main",
  ]
  sources = [
    "util_test.cc",
  ]
}

pw_doc_group("docs") {
  sources = [
    "docs.rst",
  ]
  report_deps = [
    ":format_size_report",
    ":string_builder_size_report",
  ]
}

pw_size_report("format_size_report") {
  title = "Using pw::string::Format instead of snprintf"

  binaries = [
    {
      target = "size_report:single_write_format"
      base = "size_report:single_write_snprintf"
      label = "Format instead of snprintf once, return size"
    },
    {
      target = "size_report:multiple_writes_format"
      base = "size_report:multiple_writes_snprintf"
      label = "Format instead of snprintf 10 times, handle errors"
    },
    {
      target = "size_report:many_writes_format"
      base = "size_report:many_writes_snprintf"
      label = "Format instead of snprintf 50 times, no error handling"
    },
  ]
}

pw_size_report("string_builder_size_report") {
  title = "Using pw::StringBuilder instead of snprintf"

  binaries = [
    {
      target = "size_report:build_string_with_string_builder"
      base = "size_report:build_string_with_snprintf"
      label = "Total StringBuilder cost when used alongside snprintf"
    },
    {
      target = "size_report:build_string_with_string_builder_no_base_snprintf"
      base = "size_report:build_string_with_snprintf_no_base_snprintf"
      label = "StringBuilder cost when completely replacing snprintf"
    },
    {
      target = "size_report:build_string_incremental_with_string_builder"
      base = "size_report:build_string_incremental_with_snprintf"
      label = "Incremental cost relative to snprintf for 10 strings"
    },
  ]
}
