Mercurial > hg > truffle
comparison mx/commands.py @ 8211:74896b25297a
Test canonicalization and checkstyle early in gate process
Run the unittests in hosted mode (server)
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Mon, 11 Mar 2013 19:21:31 +0100 |
parents | 4b11a0983557 |
children | b9eb0d939e60 |
comparison
equal
deleted
inserted
replaced
8210:c64ecb1ef1a9 | 8211:74896b25297a |
---|---|
782 if eclipse_exe is not None: | 782 if eclipse_exe is not None: |
783 t = Task('CodeFormatCheck') | 783 t = Task('CodeFormatCheck') |
784 if mx.eclipseformat(['-e', eclipse_exe]) != 0: | 784 if mx.eclipseformat(['-e', eclipse_exe]) != 0: |
785 t.abort('Formatter modified files - run "mx eclipseformat", check in changes and repush') | 785 t.abort('Formatter modified files - run "mx eclipseformat", check in changes and repush') |
786 tasks.append(t.stop()) | 786 tasks.append(t.stop()) |
787 | |
788 t = Task('Canonicalization Check') | |
789 mx.log(time.strftime('%d %b %Y %H:%M:%S - Ensuring mx/projects files are canonicalized...')) | |
790 if mx.canonicalizeprojects([]) != 0: | |
791 t.abort('Rerun "mx canonicalizeprojects" and check-in the modified mx/projects files.') | |
792 tasks.append(t.stop()) | |
787 | 793 |
788 t = Task('BuildJava') | 794 t = Task('BuildJava') |
789 build(['--no-native', '--jdt-warning-as-error']) | 795 build(['--no-native', '--jdt-warning-as-error']) |
796 tasks.append(t.stop()) | |
797 | |
798 t = Task('Checkstyle') | |
799 if mx.checkstyle([]) != 0: | |
800 t.abort('Checkstyle warnings were found') | |
790 tasks.append(t.stop()) | 801 tasks.append(t.stop()) |
791 | 802 |
792 if exists('jacoco.exec'): | 803 if exists('jacoco.exec'): |
793 os.unlink('jacoco.exec') | 804 os.unlink('jacoco.exec') |
794 | 805 |
795 if args.jacocout is not None: | 806 if args.jacocout is not None: |
796 _jacoco = 'append' | 807 _jacoco = 'append' |
797 else: | 808 else: |
798 _jacoco = 'off' | 809 _jacoco = 'off' |
799 | |
800 | 810 |
801 t = Task('BuildHotSpotGraal: fastdebug,product') | 811 t = Task('BuildHotSpotGraal: fastdebug,product') |
802 buildvms(['--vms', 'graal', '--builds', 'fastdebug,product']) | 812 buildvms(['--vms', 'graal,server', '--builds', 'fastdebug,product']) |
803 tasks.append(t.stop()) | 813 tasks.append(t.stop()) |
804 | 814 |
805 _vmbuild = 'fastdebug' | 815 _vmbuild = 'fastdebug' |
806 t = Task('BootstrapWithSystemAssertions:fastdebug') | 816 t = Task('BootstrapWithSystemAssertions:fastdebug') |
807 vm(['-esa', '-version']) | 817 vm(['-esa', '-version']) |
808 tasks.append(t.stop()) | 818 tasks.append(t.stop()) |
809 | 819 |
810 _vmbuild = 'product' | 820 _vmbuild = 'product' |
811 t = Task('UnitTests:product') | 821 originalVm = _vm |
822 _vm = 'server' # hosted mode | |
823 t = Task('UnitTests:hosted-product') | |
812 unittest([]) | 824 unittest([]) |
813 tasks.append(t.stop()) | 825 tasks.append(t.stop()) |
826 _vm = originalVm | |
814 | 827 |
815 for vmbuild in ['fastdebug', 'product']: | 828 for vmbuild in ['fastdebug', 'product']: |
816 for test in sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild): | 829 for test in sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild): |
817 t = Task(str(test) + ':' + vmbuild) | 830 t = Task(str(test) + ':' + vmbuild) |
818 if not test.test('graal'): | 831 if not test.test('graal'): |
821 | 834 |
822 if args.jacocout is not None: | 835 if args.jacocout is not None: |
823 jacocoreport([args.jacocout]) | 836 jacocoreport([args.jacocout]) |
824 | 837 |
825 _jacoco = 'off' | 838 _jacoco = 'off' |
826 | |
827 t = Task('Checkstyle') | |
828 if mx.checkstyle([]) != 0: | |
829 t.abort('Checkstyle warnings were found') | |
830 tasks.append(t.stop()) | |
831 | |
832 t = Task('Canonicalization Check') | |
833 mx.log(time.strftime('%d %b %Y %H:%M:%S - Ensuring mx/projects files are canonicalized...')) | |
834 if mx.canonicalizeprojects([]) != 0: | |
835 t.abort('Rerun "mx canonicalizeprojects" and check-in the modified mx/projects files.') | |
836 tasks.append(t.stop()) | |
837 | 839 |
838 t = Task('CleanAndBuildGraalVisualizer') | 840 t = Task('CleanAndBuildGraalVisualizer') |
839 mx.run(['ant', '-f', join(_graal_home, 'visualizer', 'build.xml'), '-q', 'clean', 'build']) | 841 mx.run(['ant', '-f', join(_graal_home, 'visualizer', 'build.xml'), '-q', 'clean', 'build']) |
840 tasks.append(t.stop()) | 842 tasks.append(t.stop()) |
841 | 843 |