Fixed testing dependencies
This commit is contained in:
@@ -24,21 +24,15 @@ class Destination:
|
|||||||
def objpath(self) -> Path:
|
def objpath(self) -> Path:
|
||||||
return self._objpath
|
return self._objpath
|
||||||
|
|
||||||
def __init__(self, outpath: Path, mkdirs=True) -> None:
|
def __init__(self, outpath: Path) -> None:
|
||||||
self._root = outpath / ".chinook"
|
self._root = outpath / ".chinook"
|
||||||
self._binpath = self._root / "bin"
|
self._binpath = self._root / "bin"
|
||||||
self._libpath = self._root / "lib"
|
self._libpath = self._root / "lib"
|
||||||
self._objpath = self._root / "obj"
|
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
|
@staticmethod
|
||||||
def cwd() -> 'Destination':
|
def cwd() -> 'Destination':
|
||||||
return Destination(Path.cwd(), mkdirs=False)
|
return Destination(Path.cwd())
|
||||||
|
|
||||||
def bin(self, file: str) -> Path:
|
def bin(self, file: str) -> Path:
|
||||||
return self.binpath / file
|
return self.binpath / file
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ def prepare(
|
|||||||
dstfile.parent.mkdir(parents=True, exist_ok=True)
|
dstfile.parent.mkdir(parents=True, exist_ok=True)
|
||||||
commands.append(CompileObject(compiler, defopts, logger, srcfile, dstfile))
|
commands.append(CompileObject(compiler, defopts, logger, srcfile, dstfile))
|
||||||
if not latest(srcfile, outfile):
|
if not latest(srcfile, outfile):
|
||||||
|
outfile.parent.mkdir(parents=True, exist_ok=True)
|
||||||
objects.append(dstfile)
|
objects.append(dstfile)
|
||||||
|
|
||||||
defopts.objfiles.update(objects)
|
defopts.objfiles.update(objects)
|
||||||
|
|||||||
@@ -55,6 +55,6 @@ def _prepare_dependencies(
|
|||||||
continue
|
continue
|
||||||
parent = find_project_by_target(required.value)
|
parent = find_project_by_target(required.value)
|
||||||
if project.cid != parent.cid and required not in parent.exports:
|
if project.cid != parent.cid and required not in parent.exports:
|
||||||
raise Exception(f"Cannot depend on non-exported target: {required}")
|
raise Exception(f"Cannot depend on non-exported target: {required.value}")
|
||||||
commands.extend(prepare(appcfg, parent, target, logger))
|
commands.extend(prepare(appcfg, parent, dependency, logger))
|
||||||
return commands
|
return commands
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ targets:
|
|||||||
- ./fibonacci.cpp
|
- ./fibonacci.cpp
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
- name: factorial_test
|
- name: testing
|
||||||
type: program
|
type: program
|
||||||
deps: [fibonacci]
|
deps: [fibonacci]
|
||||||
srcs:
|
srcs:
|
||||||
|
|||||||
Reference in New Issue
Block a user