OSDN Git Service

Subzero: Add a "make check-presubmit" target.
authorJim Stichnoth <stichnot@chromium.org>
Mon, 16 Nov 2015 20:47:57 +0000 (12:47 -0800)
committerJim Stichnoth <stichnot@chromium.org>
Mon, 16 Nov 2015 20:47:57 +0000 (12:47 -0800)
BUG= none
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1452553002 .

Makefile.standalone
pydir/szbuild_spec2k.py

index f06ec15..fc1c28d 100644 (file)
@@ -417,16 +417,41 @@ ifeq ($(TARGET),arm32)
   SETUP=SetupGccArmOpt
   SPEC := -O2 --filetype=asm
 endif
-
+SPECFLAGS :=
+SPECBUILDONLY := false
 %.spec2k: % $(OBJDIR)/pnacl-sz make_symlink runtime
-       ./pydir/szbuild_spec2k.py -v --force --target=$(TARGETFLAG) $(SPEC) $<
-       ( cd ../../../tests/spec2k; \
+       ./pydir/szbuild_spec2k.py -v --force \
+          $(SPECFLAGS) --target=$(TARGETFLAG) $(SPEC) $<
+       $(SPECBUILDONLY) || ( cd ../../../tests/spec2k; \
         ./run_all.sh RunTimedBenchmarks $(SETUP) train $< )
 
 check-spec: $(ALLSPEC:=.spec2k)
 
 check: check-lit check-unit check-xtest
 
+NPROCS := $(shell grep processor /proc/cpuinfo | wc -l)
+
+check-presubmit:
+       +make -f Makefile.standalone format
+       git diff --quiet
+       +make -f Makefile.standalone \
+          MINIMAL=1 check
+       +make -f Makefile.standalone \
+          DEBUG=1 CHECK_X86_ASM=1 check-unit
+       +make -f Makefile.standalone \
+          check check-spec
+       +make -f Makefile.standalone \
+          SPECFLAGS='-Om1' SPECBUILDONLY=true check-spec
+       +make -f Makefile.standalone \
+          SPECFLAGS='--sz=--phi-edge-split=0' check-spec
+       +make -f Makefile.standalone \
+          TARGET=arm32 SPECBUILDONLY=true check-spec
+       +make -f Makefile.standalone \
+          TARGET=arm32 SPECFLAGS='-Om1' SPECBUILDONLY=true check-spec
+       +make -f Makefile.standalone \
+          TARGET=arm32 ALLSPEC='176.gcc 181.mcf 254.gap' check-spec
+       echo Success
+
 FORMAT_BLACKLIST =
 # Add one of the following lines for each source file to ignore.
 FORMAT_BLACKLIST += ! -name IceParseInstsTest.cpp
index 84106bb..7acf789 100755 (executable)
@@ -33,9 +33,18 @@ def main():
         print 'Unknown component{s}: '.format(s='s' if len(bad) > 1 else '') + \
             ' '.join(x for x in bad)
         sys.exit(1)
+
+    # Fix up Subzero target strings for the run_all.sh script.
+    target_map = {
+         'arm32':'arm',
+         'x8632':'x8632',
+         'x8664':'x8664'
+         }
+    run_all_target = target_map[args.target] # fail if target not listed above
+
     suffix = (
         'pnacl.opt.{target}' if args.sandbox else 'gcc.opt.{target}').format(
-             target=args.target);
+             target=run_all_target);
     for comp in args.comps:
         name = os.path.splitext(comp)[1] or comp
         if name[0] == '.':