Skip to content

Commit

Permalink
Merge pull request #8169 from gottesmm/asan_build_subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
swift-ci committed Mar 18, 2017
2 parents ad12346 + 824ffa6 commit 3525f78
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions utils/swift_build_support/swift_build_support/workspace.py
Expand Up @@ -85,4 +85,7 @@ def compute_build_subdir(args):
build_subdir += "+swift-" + swift_build_dir_label
build_subdir += "+stdlib-" + swift_stdlib_build_dir_label

# IF we have asan enabled, mangle it into the build directory name.
if args.enable_asan:
build_subdir += "+asan"
return build_subdir
13 changes: 10 additions & 3 deletions utils/swift_build_support/tests/test_workspace.py
Expand Up @@ -50,7 +50,7 @@ def test_workspace(self):

class ComputeBuildSubdirTestCase(unittest.TestCase):

def create_basic_args(self, generator, variant, assertions):
def create_basic_args(self, generator, variant, assertions, enable_asan=False):
return argparse.Namespace(
cmake_generator=generator,
cmark_build_variant=variant,
Expand All @@ -61,7 +61,14 @@ def create_basic_args(self, generator, variant, assertions):
cmark_assertions=assertions,
llvm_assertions=assertions,
swift_assertions=assertions,
swift_stdlib_assertions=assertions)
swift_stdlib_assertions=assertions,
enable_asan=enable_asan)

def test_Ninja_ReleaseAssert_asan(self): # noqa (N802 function name should be lowercase)
args = self.create_basic_args(
"Ninja", variant="Release", assertions=True, enable_asan=True)
self.assertEqual(compute_build_subdir(args),
"Ninja-ReleaseAssert+asan")

def test_Ninja_ReleaseAssert(self): # noqa (N802 function name should be lowercase)
# build-script -R
Expand Down Expand Up @@ -132,7 +139,7 @@ def test_all_combinations_are_unique(self):

def generate():
for c in productions:
args = argparse.Namespace(cmake_generator="Ninja")
args = argparse.Namespace(cmake_generator="Ninja", enable_asan=False)
for key, val in zip(keys, c):
setattr(args, key, val)
yield compute_build_subdir(args)
Expand Down

0 comments on commit 3525f78

Please sign in to comment.