Fixed testing dependencies
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,7 +9,7 @@ targets:
|
||||
- ./fibonacci.cpp
|
||||
|
||||
tests:
|
||||
- name: factorial_test
|
||||
- name: testing
|
||||
type: program
|
||||
deps: [fibonacci]
|
||||
srcs:
|
||||
|
||||
Reference in New Issue
Block a user