Skip to content

Commit

Permalink
Try to fix tests for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
thejohnfreeman committed Jan 16, 2024
1 parent 54dcf96 commit 6548266
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 28 deletions.
18 changes: 14 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
)
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
Expand Down Expand Up @@ -80,13 +86,17 @@ def install(self, params, source_dir):
},
check=True
)
yield build_dir
yield (source_dir, build_dir)

def test(self, build_dir, source_dir):
def test(self, params, source_dir, build_dir):
subprocess.run(
['make', 'test'],
cwd=root / source_dir,
env={ **os.environ, 'build_dir': build_dir },
env={
**os.environ,
'build_dir': build_dir,
'flavor': CMAKE_FLAVORS[params['flavor']],
},
check=True,
)

Expand All @@ -104,7 +114,7 @@ def install(self, params, source_dir):
], check=True)
yield build_dir

def test(self, build_dir, source_dir):
def test(self, params, source_dir, build_dir):
subprocess.run([
'cupcake', 'test',
'--source-dir', root / source_dir,
Expand Down
8 changes: 4 additions & 4 deletions tests/test_add_subdirectory.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def test_two(builder, two):
builder.test(two, '02-add-subdirectory')
def test_two(params, builder, two):
builder.test(params, *two)

def test_four(builder, four):
builder.test(four, '04-as-fp')
def test_four(params, builder, four):
builder.test(params, *four)
4 changes: 2 additions & 2 deletions tests/test_fetch_content.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def test_five(builder, five):
builder.test(five, '05-fetch-content')
def test_five(params, builder, five):
builder.test(params, *five)
12 changes: 6 additions & 6 deletions tests/test_pcf.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
def test_zero(builder, zero):
builder.test(zero, '00-upstream')
def test_zero(params, builder, zero):
builder.test(params, *zero)

def test_one(builder, one):
builder.test(one, '01-find-package')
def test_one(params, builder, one):
builder.test(params, *one)

def test_three(builder, three):
builder.test(three, '03-fp-fp')
def test_three(params, builder, three):
builder.test(params, *three)
12 changes: 6 additions & 6 deletions tests/test_requires_nothing.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
def test_seven(builder, seven):
builder.test(seven, '07-as-fc')
def test_seven(params, builder, seven):
builder.test(params, *seven)

def test_nine(builder, nine):
builder.test(nine, '09-external-project')
def test_nine(params, builder, nine):
builder.test(params, *nine)

def test_ten(builder, ten):
builder.test(ten, '10-conan')
def test_ten(params, builder, ten):
builder.test(params, *ten)
12 changes: 6 additions & 6 deletions tests/test_requires_zero.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
def test_six(builder, six):
builder.test(six, '06-fp-fc')
def test_six(params, builder, six):
builder.test(params, *six)

def test_eight(builder, eight):
builder.test(eight, '08-find-module')
def test_eight(params, builder, eight):
builder.test(params, *eight)

def test_eleven(builder, eleven):
builder.test(eleven, '11-no-cupcake')
def test_eleven(params, builder, eleven):
builder.test(params, *eleven)

0 comments on commit 6548266

Please sign in to comment.