[PATCH] D29677: [buildbot] Add check-fuzzer to Asan buildbot on Windows.
Marcos Pividori via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 7 15:49:36 PST 2017
mpividori updated this revision to Diff 87535.
mpividori added a comment.
+ Split build and testing into 2 steps so it is easier to understand when it fails.
+ Add asan dll path to `Path`, so it is found when executing the tests.
+ Add bin dir to `Path`, so tools like `FileCheck`, `not` and `sancov` are found when executing the tests.
https://reviews.llvm.org/D29677
Files:
zorg/buildbot/builders/SanitizerBuilderWindows.py
Index: zorg/buildbot/builders/SanitizerBuilderWindows.py
===================================================================
--- zorg/buildbot/builders/SanitizerBuilderWindows.py
+++ zorg/buildbot/builders/SanitizerBuilderWindows.py
@@ -1,4 +1,5 @@
import os
+import glob
import buildbot
import buildbot.process.factory
@@ -64,6 +65,7 @@
# Global configurations
build_dir='build'
+ build_fuzzer_dir='build-fuzzer'
############# CLEANING
cleanBuildRequested = lambda step: step.build.getProperty("clean") or clean
@@ -112,4 +114,51 @@
workdir=build_dir,
env=Property('slave_env')))
+ # Clean fuzzer build dir.
+ f.addStep(RemoveDirectory(name='clean '+build_fuzzer_dir,
+ dir=build_fuzzer_dir,
+ haltOnFailure=False,
+ flunkOnFailure=False,
+ doStepIf=cleanBuildRequested
+ ))
+
+ # Get absolute path to fresh clang.
+ config_path = os.path.abspath(os.path.join("..", build_dir, config))
+ bin_path = os.path.join(config_path, "bin")
+ dll_path = glob.glob(config_path + "\lib\clang\*\lib\windows")[0]
+ clang_cl = os.path.join(bin_path, "clang-cl")
+
+ # Add fresh clang, tools and compiler-rt dlls to path.
+ Property('slave_env')['Path'] = ";".join([bin_path, dll_path,
+ Property('slave_env')['Path']])
+
+ f.addStep(ShellCommand(name='cmake',
+ command=[cmake, "-G", "Ninja", "../llvm",
+ "-DCMAKE_BUILD_TYPE="+config,
+ "-DLLVM_ENABLE_ASSERTIONS=ON",
+ "-DCMAKE_C_COMPILER="+clang_cl,
+ "-DCMAKE_CXX_COMPILER="+clang_cl,
+ "-DLLVM_USE_SANITIZER=Address",
+ "-DLLVM_USE_SANITIZE_COVERAGE=YES"]
+ + extra_cmake_args,
+ haltOnFailure=True,
+ workdir=build_fuzzer_dir,
+ env=Property('slave_env')))
+
+ # Build libFuzzer.
+ f.addStep(NinjaCommand(name='build LLVMFuzzer',
+ targets=['LLVMFuzzer'],
+ haltOnFailure=True,
+ description='ninja LLVMFuzzer',
+ workdir=build_dir,
+ env=Property('slave_env')))
+
+ # Run libFuzzer's tests.
+ f.addStep(NinjaCommand(name='run fuzzer tests',
+ targets=['check-fuzzer'],
+ haltOnFailure=True,
+ description='ninja check-fuzzer',
+ workdir=build_fuzzer_dir,
+ env=Property('slave_env')))
+
return f
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29677.87535.patch
Type: text/x-patch
Size: 2867 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170207/6a536407/attachment.bin>
More information about the llvm-commits
mailing list