Skip to content

Commit

Permalink
Fix Cupcake builder
Browse files Browse the repository at this point in the history
  • Loading branch information
thejohnfreeman committed Jan 16, 2024
1 parent 6548266 commit ee5fc06
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,6 @@

root = pathlib.Path(__file__).parents[1]

try:
os.symlink(
root / '00-upstream',
root / '02-add-subdirectory/external/00-upstream',
)
except FileExistsError:
pass
except OSError:
import shutil
shutil.copytree(
root / '00-upstream',
root / '02-add-subdirectory/external/00-upstream',
)

GENERATOR = [
x.strip() for x in
os.getenv('GENERATOR', 'Unix Makefiles,Ninja').split(',')
Expand Down Expand Up @@ -112,7 +98,7 @@ def install(self, params, source_dir):
'--shared' if params['shared'] else '--static',
'--prefix', params['install_dir'],
], check=True)
yield build_dir
yield (source_dir, build_dir)

def test(self, params, source_dir, build_dir):
subprocess.run([
Expand Down Expand Up @@ -140,6 +126,19 @@ def one(builder, params, zero):

@pytest.fixture(scope='module')
def two(builder, params):
try:
os.symlink(
root / '00-upstream',
root / '02-add-subdirectory/external/00-upstream',
)
except FileExistsError:
pass
except OSError:
import shutil
shutil.copytree(
root / '00-upstream',
root / '02-add-subdirectory/external/00-upstream',
)
yield from builder.install(params, '02-add-subdirectory')

@pytest.fixture(scope='module')
Expand Down

0 comments on commit ee5fc06

Please sign in to comment.