Fixed testing dependencies

This commit is contained in:
2026-06-26 17:36:08 -05:00
parent 6c4da250c3
commit 58aff1b2bb
4 changed files with 6 additions and 11 deletions
+2 -8
View File
@@ -24,21 +24,15 @@ class Destination:
def objpath(self) -> Path:
return self._objpath
def __init__(self, outpath: Path, mkdirs=True) -> None:
def __init__(self, outpath: Path) -> None:
self._root = outpath / ".chinook"
self._binpath = self._root / "bin"
self._libpath = self._root / "lib"
self._objpath = self._root / "obj"
if mkdirs:
self._root.mkdir(parents=True, exist_ok=True)
self._binpath.mkdir(parents=True, exist_ok=True)
self._libpath.mkdir(parents=True, exist_ok=True)
self._objpath.mkdir(parents=True, exist_ok=True)
@staticmethod
def cwd() -> 'Destination':
return Destination(Path.cwd(), mkdirs=False)
return Destination(Path.cwd())
def bin(self, file: str) -> Path:
return self.binpath / file
+1
View File
@@ -53,6 +53,7 @@ def prepare(
dstfile.parent.mkdir(parents=True, exist_ok=True)
commands.append(CompileObject(compiler, defopts, logger, srcfile, dstfile))
if not latest(srcfile, outfile):
outfile.parent.mkdir(parents=True, exist_ok=True)
objects.append(dstfile)
defopts.objfiles.update(objects)
+2 -2
View File
@@ -55,6 +55,6 @@ def _prepare_dependencies(
continue
parent = find_project_by_target(required.value)
if project.cid != parent.cid and required not in parent.exports:
raise Exception(f"Cannot depend on non-exported target: {required}")
commands.extend(prepare(appcfg, parent, target, logger))
raise Exception(f"Cannot depend on non-exported target: {required.value}")
commands.extend(prepare(appcfg, parent, dependency, logger))
return commands
+1 -1
View File
@@ -9,7 +9,7 @@ targets:
- ./fibonacci.cpp
tests:
- name: factorial_test
- name: testing
type: program
deps: [fibonacci]
srcs: