test_cmake_resolve.py

tests/test_cmake_resolve.py

CMake variables in generation rules expanded where the build file alone settles them (2.1).

test_a_quoted_argument_resolves_without_its_quotes

None test_cmake_resolve.test_a_quoted_argument_resolves_without_its_quotes()

FOUND MEASURING mbedtls: `"./framework/x.py"` kept its quotes as part of the path.

tests/test_cmake_resolve.py:101

Checks

  • assert (resolve_argument('"${CMAKE_CURRENT_SOURCE_DIR}/gen.py"', "tests", {}, True) == "tests/gen.py" )
  • assert resolve_argument('"${CMAKE_SOURCE_DIR}/./x.py"', "tests", {}, True) == "x.py"

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-PIPE-012measuredtest_a_quoted_argument_resolves_without_its_quotes → resolve_argument
Source · 9 lines
def test_a_quoted_argument_resolves_without_its_quotes() -> None:
    """@brief FOUND MEASURING mbedtls: `"./framework/x.py"` kept its quotes as part of the path."""
    assert (
        resolve_argument('"${CMAKE_CURRENT_SOURCE_DIR}/gen.py"', "tests", {}, True)
        == "tests/gen.py"
    )
    assert resolve_argument('"${CMAKE_SOURCE_DIR}/./x.py"', "tests", {}, True) == "x.py"

Activity · 2 steps
lines 103–106assert ( resolve_argument('"${CMAKE_CURRENT_SOURCE_DIR}/gen.py"', "tests", {}, True) == "tests/gen.py" )lines 107–107assert resolve_argument('"${CMAKE_SOURCE_DIR}/./x.py"', "tests", {}, True) == "x.py"

test_a_quoted_set_value_expands_without_its_quotes

None test_cmake_resolve.test_a_quoted_set_value_expands_without_its_quotes()

FOUND MEASURING mbedtls: `set(x "${CMAKE_CURRENT_SOURCE_DIR}/gen.sh")` kept its quotes.

tests/test_cmake_resolve.py:110

Show on the map →

Called by none

Calls _variables, resolve_argument

Checks

  • assert variables["gen"] == "${CMAKE_CURRENT_SOURCE_DIR}/gen.sh"
  • assert resolve_argument('"${gen}"', "programs/test", variables, True) == "programs/test/gen.sh"
  • assert resolve_argument("${empty}", "programs/test", variables, True) == ""

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-PIPE-012measuredtest_a_quoted_set_value_expands_without_its_quotes → resolve_argument
Source · 11 lines
def test_a_quoted_set_value_expands_without_its_quotes() -> None:
    """@brief FOUND MEASURING mbedtls: `set(x "${CMAKE_CURRENT_SOURCE_DIR}/gen.sh")` kept its quotes."""
    from tests.test_cmake_generation import _tree

    from clew.cmakeast import _variables

    tree = _tree(b'set(gen "${CMAKE_CURRENT_SOURCE_DIR}/gen.sh")\nset(empty "")\n')
    variables = _variables(tree.root_node)
    assert variables["gen"] == "${CMAKE_CURRENT_SOURCE_DIR}/gen.sh"
    assert resolve_argument('"${gen}"', "programs/test", variables, True) == "programs/test/gen.sh"
    assert resolve_argument("${empty}", "programs/test", variables, True) == ""

1 more lines, not shown

Activity · 7 steps
lines 112–112from tests.test_cmake_generation import _treelines 114–114from clew.cmakeast import _variableslines 116–116tree = _tree(b'set(gen "${CMAKE_CURRENT_SOURCE_DIR}/gen.sh")\nset(empty "")\n')lines 117–117variables = _variables(tree.root_node)lines 118–118assert variables["gen"] == "${CMAKE_CURRENT_SOURCE_DIR}/gen.sh"lines 119–119assert resolve_argument('"${gen}"', "programs/test", variables, True) == "programs/test/gen.sh"lines 120–120assert resolve_argument("${empty}", "programs/test", variables, True) == ""

test_a_variable_set_in_the_file_expands

None test_cmake_resolve.test_a_variable_set_in_the_file_expands()

`set()` / `file(GLOB)` values, one level of nesting.

tests/test_cmake_resolve.py:35

Checks

  • assert resolve_argument("${hdrs}", "library", variables, True) == "include/*.h"
  • assert (resolve_argument("${CMAKE_CURRENT_SOURCE_DIR}/${GEN}", "scripts", variables, True) == "scripts/gen.pl" )

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-PIPE-012measuredtest_a_variable_set_in_the_file_expands → resolve_argument
Source · 10 lines
def test_a_variable_set_in_the_file_expands() -> None:
    """@brief `set()` / `file(GLOB)` values, one level of nesting."""
    variables = {"hdrs": "${CMAKE_CURRENT_SOURCE_DIR}/../include/*.h", "GEN": "gen.pl"}
    assert resolve_argument("${hdrs}", "library", variables, True) == "include/*.h"
    assert (
        resolve_argument("${CMAKE_CURRENT_SOURCE_DIR}/${GEN}", "scripts", variables, True)
        == "scripts/gen.pl"
    )

Activity · 3 steps
lines 37–37variables = {"hdrs": "${CMAKE_CURRENT_SOURCE_DIR}/../include/*.h", "GEN": "gen.pl"}lines 38–38assert resolve_argument("${hdrs}", "library", variables, True) == "include/*.h"lines 39–42assert ( resolve_argument("${CMAKE_CURRENT_SOURCE_DIR}/${GEN}", "scripts", variables, True) == "scripts/gen.pl" )

test_an_indexed_build_records_the_resolved_path

None test_cmake_resolve.test_an_indexed_build_records_the_resolved_path(Path tmp_path)

`generated_files.arg_resolved`, beside the literal as written.

tests/test_cmake_resolve.py:57

Show on the map →

Called by none

Calls _build_argparser, _run_pipeline

Checks

  • assert rows["${CMAKE_CURRENT_SOURCE_DIR}/../scripts/gen.pl"] == "scripts/gen.pl"
  • assert rows["${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data/error.fmt"] == "scripts/data/error.fmt"
  • assert rows["${hdrs}"] == "include/*.h"
  • assert rows["${PERL_EXECUTABLE}"] == ""

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CLI-001measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → report_stats
REQ-DDB-CLI-002inferredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → _doxygen_or_partial → _doxygen_stage → _run_doxygen_from_args → run_doxygen → doxygen_supports_sqlite3
REQ-DDB-CONFIG-001measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _apply_declared_document → stated_document_meta
REQ-DDB-CONFIG-003inferredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml → _is_flat_req_list
REQ-DDB-CONFIG-004measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_preprocessor
REQ-DDB-CONFIG-005measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig
REQ-DDB-CONFIG-006measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _recorded_entry_patterns → recorded_explicit
REQ-DDB-CONFIG-007measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature
REQ-DDB-CONFIG-009measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _apply_toolchain_exclusions → load_toolchain_config
REQ-DDB-GUARD-012inferredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → load_guard_config → read_guard_config → read_requirements_section
REQ-DDB-GUARD-019inferredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → parse_doxygen_tags
REQ-DDB-GUARD-024inferredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → apply_autobrief
REQ-DDB-INDEX-001measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _verify_extra_input_is_read → effective_file_patterns
REQ-DDB-INDEX-002measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → build_lock
REQ-DDB-INDEX-003measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → report_index_coverage
REQ-DDB-INDEX-004measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols
REQ-DDB-INDEX-005measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → stamp_external_provenance
REQ-DDB-INDEX-006measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → record_code_text → code_text_rows
REQ-DDB-INDEX-007measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → record_owners
REQ-DDB-INDEX-008measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_licenses
REQ-DDB-INDEX-009measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc
REQ-DDB-INDEX-010measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes
REQ-DDB-INDEX-011measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → import_property_keys
REQ-DDB-MCP-001measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _operator_excludes → meta_section
REQ-DDB-MCP-004measured
REQ-DDB-PIPE-001measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_database
REQ-DDB-PIPE-003measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → build_call_edges
REQ-DDB-PIPE-004measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → python_entry_seeds
REQ-DDB-PIPE-005measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature
REQ-DDB-PIPE-006measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → run_rustdoc → _require_nightly_rustdoc → clean_subprocess_env
REQ-DDB-PIPE-007measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig_gates
REQ-DDB-PIPE-008measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs
REQ-DDB-PIPE-009measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → prune_dominated_fuzzy_call_edges
REQ-DDB-PIPE-010measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _build_inferred_edges
REQ-DDB-PIPE-011measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes → run_harvest → _harvest_one_file → _parseable_file
REQ-DDB-PIPE-012measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → build_harvest_plan → js_symbol_harvester
REQ-DDB-PIPE-013measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings
REQ-DDB-PIPE-014measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc → within_repo
REQ-DDB-PIPE-015measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → import_config_defaults
REQ-DDB-QUERY-003measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → mark_test_scope
REQ-DDB-QUERY-011measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads → _ensure_threads_tables
REQ-DDB-SCHEMA-001measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads
REQ-DDB-SCHEMA-002measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _writer_dispatch_map
REQ-DDB-SCHEMA-003measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table
REQ-DDB-SCHEMA-004measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest
REQ-DDB-SCHEMA-005measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_key_alias_prefixes
REQ-DDB-SCHEMA-006measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml
REQ-DDB-SCHEMA-007measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table
REQ-DDB-SCHEMA-009measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → import_event_edges
REQ-DDB-SCHEMA-011measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → extract_context_conflicts
REQ-DDB-SCHEMA-012measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest → declaration_origin
REQ-DDB-SCHEMA-013measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → import_data_model_keys
REQ-DDB-SCHEMA-014measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs → ensure_file_docs_table
REQ-DDB-SCHEMA-015measuredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml
REQ-DDB-WIKI-054inferredtest_an_indexed_build_records_the_resolved_path → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols → _recover_into → all
Source · 33 lines
def test_an_indexed_build_records_the_resolved_path(tmp_path: Path) -> None:
    """@brief `generated_files.arg_resolved`, beside the literal as written."""
    from clew.cli import _build_argparser, _run_pipeline

    repo = tmp_path / "repo"
    (repo / "library").mkdir(parents=True)
    (repo / "scripts" / "data").mkdir(parents=True)
    (repo / "include").mkdir()
    (repo / "CMakeLists.txt").write_text("project(demo C)\nadd_subdirectory(library)\n")
    (repo / "library" / "CMakeLists.txt").write_text(
        "file(GLOB hdrs ${CMAKE_CURRENT_SOURCE_DIR}/../include/*.h)\n"
        "add_custom_command(\n  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/error.c\n"
        "  COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/gen.pl\n"
        "  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data/error.fmt ${hdrs}\n)\n"
    )
    (repo / "scripts" / "gen.pl").write_text("print 1;\n")
    (repo / "scripts" / "data" / "error.fmt").write_text("x\n")
    (repo / "include" / "a.h").write_text("int a(void);\n")
    db = tmp_path / "x.db"
    _run_pipeline(_build_argparser().parse_args(["--output", str(db), "--repo-root", str(repo)]))
    rows = dict(
        sqlite3.connect(db)
        .execute(
            "SELECT arg_literal, arg_resolved FROM generated_files WHERE output_name = 'error.c'"
        )
        .fetchall()
    )
    assert rows["${CMAKE_CURRENT_SOURCE_DIR}/../scripts/gen.pl"] == "scripts/gen.pl"
    assert rows["${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data/error.fmt"] == "scripts/data/error.fmt"
    assert rows["${hdrs}"] == "include/*.h"
    assert rows["${PERL_EXECUTABLE}"] == ""

Activity · 17 steps
lines 59–59from clew.cli import _build_argparser, _run_pipelinelines 61–61repo = tmp_path / "repo"lines 62–62(repo / "library").mkdir(parents=True)lines 63–63(repo / "scripts" / "data").mkdir(parents=True)lines 64–64(repo / "include").mkdir()lines 65–65(repo / "CMakeLists.txt").write_text("project(demo C)\nadd_subdirectory(library)\n")lines 66–71(repo / "library" / "CMakeLists.txt").write_text( "file(GLOB hdrs ${CMAKE_CURRENT_SOURCE_DIR}/../include/*.h)\n" "add_custom_command(\n OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/error.c\n" " COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/gen.pl\n" " DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data/error.fmt ${hdrs}\n)\n" )lines 72–72(repo / "scripts" / "gen.pl").write_text("print 1;\n")lines 73–73(repo / "scripts" / "data" / "error.fmt").write_text("x\n")lines 74–74(repo / "include" / "a.h").write_text("int a(void);\n")lines 75–75db = tmp_path / "x.db"lines 76–76_run_pipeline(_build_argparser().parse_args(["--output", str(db), "--repo-root", str(repo)]))lines 77–83rows = dict( sqlite3.connect(db) .execute( "SELECT arg_literal, arg_resolved FROM generated_files WHERE output_name = 'error.c'" ) .fetchall() )lines 84–84assert rows["${CMAKE_CURRENT_SOURCE_DIR}/../scripts/gen.pl"] == "scripts/gen.pl"lines 85–85assert rows["${CMAKE_CURRENT_SOURCE_DIR}/../scripts/data/error.fmt"] == "scripts/data/error.fmt"lines 86–86assert rows["${hdrs}"] == "include/*.h"lines 87–87assert rows["${PERL_EXECUTABLE}"] == ""

test_only_an_expanded_variable_resolves

None test_cmake_resolve.test_only_an_expanded_variable_resolves()

Plain words do not resolve.

tests/test_cmake_resolve.py:90

Checks

  • assert resolve_argument(word, "library", {}, True) == "", word

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-PIPE-012measuredtest_only_an_expanded_variable_resolves → resolve_argument
Source · 11 lines
def test_only_an_expanded_variable_resolves() -> None:
    """FOUND MEASURING mbedtls: 67 of 94 "resolved" values were command words (`sed`, `-i.bak`,
    `ctest`) passed through because they held no variable. Only an expanded variable resolves;
    a plain literal already says all it can.

    @brief Plain words do not resolve.
    """
    for word in ("sed", "-i.bak", "ctest", "scripts/gen.pl"):
        assert resolve_argument(word, "library", {}, True) == "", word

Activity · 2 steps
lines 97–97◇ for word in ("sed", "-i.bak", "ctest", "scripts/gen.pl")lines 98–98assert resolve_argument(word, "library", {}, True) == "", word

test_the_files_own_directory_and_the_root_expand

None test_cmake_resolve.test_the_files_own_directory_and_the_root_expand()

Source-dir variables expand; the path is normalised inside the tree.

tests/test_cmake_resolve.py:24

Checks

  • assert (resolve_argument("${CMAKE_CURRENT_SOURCE_DIR}/../scripts/gen.pl", "library", {}, True) == "scripts/gen.pl" )
  • assert resolve_argument("${CMAKE_CURRENT_LIST_DIR}/gen.py", "tools", {}, True) == "tools/gen.py"
  • assert resolve_argument("${CMAKE_SOURCE_DIR}/include/a.h", "library", {}, True) == "include/a.h"
  • assert resolve_argument("${PROJECT_SOURCE_DIR}/x.fmt", "", {}, True) == "x.fmt"

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-PIPE-012measuredtest_the_files_own_directory_and_the_root_expand → resolve_argument
Source · 11 lines
def test_the_files_own_directory_and_the_root_expand() -> None:
    """@brief Source-dir variables expand; the path is normalised inside the tree."""
    assert (
        resolve_argument("${CMAKE_CURRENT_SOURCE_DIR}/../scripts/gen.pl", "library", {}, True)
        == "scripts/gen.pl"
    )
    assert resolve_argument("${CMAKE_CURRENT_LIST_DIR}/gen.py", "tools", {}, True) == "tools/gen.py"
    assert resolve_argument("${CMAKE_SOURCE_DIR}/include/a.h", "library", {}, True) == "include/a.h"
    assert resolve_argument("${PROJECT_SOURCE_DIR}/x.fmt", "", {}, True) == "x.fmt"

Activity · 4 steps
lines 26–29assert ( resolve_argument("${CMAKE_CURRENT_SOURCE_DIR}/../scripts/gen.pl", "library", {}, True) == "scripts/gen.pl" )lines 30–30assert resolve_argument("${CMAKE_CURRENT_LIST_DIR}/gen.py", "tools", {}, True) == "tools/gen.py"lines 31–31assert resolve_argument("${CMAKE_SOURCE_DIR}/include/a.h", "library", {}, True) == "include/a.h"lines 32–32assert resolve_argument("${PROJECT_SOURCE_DIR}/x.fmt", "", {}, True) == "x.fmt"

test_what_the_build_file_does_not_settle_stays_unresolved

None test_cmake_resolve.test_what_the_build_file_does_not_settle_stays_unresolved()

The binary dir, a found program, an unknown variable, a path out of the tree: "".

tests/test_cmake_resolve.py:45

Checks

  • assert resolve_argument("${CMAKE_CURRENT_BINARY_DIR}/error.c", "library", {}, True) == ""
  • assert resolve_argument("${PERL_EXECUTABLE}", "library", {}, True) == ""
  • assert (resolve_argument("${CMAKE_CURRENT_SOURCE_DIR}/../../outside.pl", "library", {}, True) == "" )
  • assert resolve_argument("${CMAKE_SOURCE_DIR}/a.h", "library", {}, False) == "", ("no root CMakeLists" )

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-PIPE-012measuredtest_what_the_build_file_does_not_settle_stays_unresolved → resolve_argument
Source · 12 lines
def test_what_the_build_file_does_not_settle_stays_unresolved() -> None:
    """@brief The binary dir, a found program, an unknown variable, a path out of the tree: ""."""
    assert resolve_argument("${CMAKE_CURRENT_BINARY_DIR}/error.c", "library", {}, True) == ""
    assert resolve_argument("${PERL_EXECUTABLE}", "library", {}, True) == ""
    assert (
        resolve_argument("${CMAKE_CURRENT_SOURCE_DIR}/../../outside.pl", "library", {}, True) == ""
    )
    assert resolve_argument("${CMAKE_SOURCE_DIR}/a.h", "library", {}, False) == "", (
        "no root CMakeLists"
    )

Activity · 4 steps
lines 47–47assert resolve_argument("${CMAKE_CURRENT_BINARY_DIR}/error.c", "library", {}, True) == ""lines 48–48assert resolve_argument("${PERL_EXECUTABLE}", "library", {}, True) == ""lines 49–51assert ( resolve_argument("${CMAKE_CURRENT_SOURCE_DIR}/../../outside.pl", "library", {}, True) == "" )lines 52–54assert resolve_argument("${CMAKE_SOURCE_DIR}/a.h", "library", {}, False) == "", ( "no root CMakeLists" )