Skip to content

Commit

Permalink
feat: integrate auto mocking for gtest
Browse files Browse the repository at this point in the history
  • Loading branch information
cuinixam committed Apr 28, 2024
1 parent b1f9f1c commit 8b8540b
Show file tree
Hide file tree
Showing 8 changed files with 252 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
"editor.defaultFormatter": "charliermarsh.ruff"
},
"python.analysis.typeCheckingMode": "basic",
"cSpell.words": ["yanga", "typer", "cookiecutter"]
"cSpell.words": ["yanga", "typer", "cookiecutter", "hammocking"]
}
35 changes: 34 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pillow = "^10.1.0"
kspl = "^1.0.0"
pick = "^2.2.0"
typer = "^0.11.1"
hammocking = "^0.2.5"

[tool.poetry.group.dev.dependencies]
pytest = "^8.0"
Expand Down Expand Up @@ -80,7 +81,7 @@ match = "(?!main$)"
prerelease = true

[tool.pytest.ini_options]
addopts = "-v -Wdefault --cov=yanga --cov-report=term-missing:skip-covered -s"
addopts = "-vv -Wdefault --cov=yanga --cov-report=term-missing:skip-covered -s"
pythonpath = ["src"]

[tool.coverage.run]
Expand Down
5 changes: 2 additions & 3 deletions src/yanga/cmake/cmake_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def __init__(
self.relative_path = relative_path

def to_cmake_element(self) -> Optional[CMakeElement]:
return CMakeVariable(self.variable, self.to_string()) if self.variable else None
return CMakeVariable(self.variable, self.to_path().as_posix()) if self.variable else None

def to_string(self) -> str:
if self.variable:
Expand Down Expand Up @@ -181,7 +181,6 @@ def _add_tabulated_path(self, path: CMakePath) -> str:

@dataclass
class CMakeAddExecutable(CMakeElement):

name: str
sources: List[Union[str, CMakePath, CMakeObjectLibrary]]
libraries: List[str] = field(default_factory=list)
Expand Down Expand Up @@ -292,7 +291,7 @@ def to_string(self) -> str:
return "\n".join(str(line) for line in content)

def _get_outputs(self) -> List[str]:
return [f"{self.tab_prefix}OUTPUT {output.to_string()}" for output in self.outputs]
return [f"{self.tab_prefix}OUTPUT {' '.join([output.to_string() for output in self.outputs])}"]

def _get_commands(self) -> List[str]:
return [self.tab_prefix + str(command) for command in self.commands]
Expand Down
Loading

0 comments on commit 8b8540b

Please sign in to comment.