Skip to content

Commit

Permalink
Merge pull request #2092 from realm/nn-test_tsan
Browse files Browse the repository at this point in the history
Add `test_tsan` target to Makefile
  • Loading branch information
jpsim authored Apr 9, 2018
2 parents ef1994f + 98029f8 commit 7dddbd6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ endif

SWIFTLINT_EXECUTABLE=$(shell swift build $(SWIFT_BUILD_FLAGS) --show-bin-path)/swiftlint

TSAN_LIB=$(subst bin/swift,lib/swift/clang/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib,$(shell xcrun --find swift))
TSAN_SWIFT_BUILD_FLAGS=-Xswiftc -sanitize=thread
TSAN_TEST_BUNDLE=$(shell swift build $(TSAN_SWIFT_BUILD_FLAGS) --show-bin-path)/SwiftLintPackageTests.xctest
TSAN_XCTEST=$(shell xcrun --find xctest)

FRAMEWORKS_FOLDER=/Library/Frameworks
BINARIES_FOLDER=/usr/local/bin
LICENSE_PATH="$(shell pwd)/LICENSE"
Expand Down Expand Up @@ -50,6 +55,10 @@ bootstrap:
test: clean_xcode bootstrap
$(BUILD_TOOL) $(XCODEFLAGS) test

test_tsan:
swift build --build-tests $(TSAN_SWIFT_BUILD_FLAGS)
DYLD_INSERT_LIBRARIES=$(TSAN_LIB) $(TSAN_XCTEST) $(TSAN_TEST_BUNDLE)

clean:
rm -f "$(OUTPUT_PACKAGE)"
rm -rf "$(TEMPORARY_FOLDER)"
Expand Down
2 changes: 2 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
- run: swift run -Xswiftc -sanitize=thread swiftlint lint --lenient
# Post-cache
- run: swift run -Xswiftc -sanitize=thread swiftlint lint --lenient
# Test
- run: make test_tsan

osscheck:
shell: /bin/bash --login -eo pipefail
Expand Down

0 comments on commit 7dddbd6

Please sign in to comment.