diff --git a/Makefile b/Makefile index 1629d14f74d..b6ee1915eb1 100644 --- a/Makefile +++ b/Makefile @@ -127,6 +127,9 @@ test-all-http1: test-build test-all-valgrind: test-build $(PYTHON) tools/test.py --mode=debug,release --valgrind +test-ci: + $(PYTHON) tools/test.py -ptap --logfile test.tap --mode=release --arch=$(DESTCPU) simple message internet + test-release: test-build $(PYTHON) tools/test.py --mode=release @@ -306,11 +309,11 @@ $(PKG): release-only rm -rf $(PKGDIR) rm -rf out/deps out/Release $(PYTHON) ./configure --download=all --with-intl=small-icu \ - --without-snapshot --dest-cpu=ia32 --tag=$(TAG) + --dest-cpu=ia32 --tag=$(TAG) $(MAKE) install V=$(V) DESTDIR=$(PKGDIR)/32 rm -rf out/deps out/Release $(PYTHON) ./configure --download=all --with-intl=small-icu \ - --without-snapshot --dest-cpu=x64 --tag=$(TAG) + --dest-cpu=x64 --tag=$(TAG) $(MAKE) install V=$(V) DESTDIR=$(PKGDIR) SIGN="$(APP_SIGN)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh lipo $(PKGDIR)/32/usr/local/bin/node \ @@ -343,7 +346,7 @@ $(BINARYTAR): release-only rm -rf $(BINARYNAME) rm -rf out/deps out/Release $(PYTHON) ./configure --prefix=/ --download=all --with-intl=small-icu \ - --without-snapshot --dest-cpu=$(DESTCPU) --tag=$(TAG) $(CONFIG_FLAGS) + --dest-cpu=$(DESTCPU) --tag=$(TAG) $(CONFIG_FLAGS) $(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1 cp README.md $(BINARYNAME) cp LICENSE $(BINARYNAME) @@ -356,7 +359,7 @@ binary: $(BINARYTAR) $(PKGSRC): release-only rm -rf dist out - $(PYTHON) configure --prefix=/ --without-snapshot --download=all \ + $(PYTHON) configure --prefix=/ --download=all \ --with-intl=small-icu --dest-cpu=$(DESTCPU) --tag=$(TAG) \ $(CONFIG_FLAGS) $(MAKE) install DESTDIR=dist diff --git a/android-configure b/android-configure index 7acb7f37661..b3145e58386 100755 --- a/android-configure +++ b/android-configure @@ -14,6 +14,5 @@ export CXX=arm-linux-androideabi-g++ export LINK=arm-linux-androideabi-g++ ./configure \ - --without-snapshot \ --dest-cpu=arm \ --dest-os=android diff --git a/configure b/configure index 66cb312ddb8..636bc78f05b 100755 --- a/configure +++ b/configure @@ -292,11 +292,16 @@ parser.add_option('--without-perfctr', dest='without_perfctr', help='build without performance counters') +parser.add_option('--with-snapshot', + action='store_true', + dest='with_snapshot', + help=optparse.SUPPRESS_HELP) + +# Dummy option for backwards compatibility. parser.add_option('--without-snapshot', action='store_true', - dest='without_snapshot', - help='build without snapshotting V8 libraries. You might want to set' - ' this for cross-compiling. [Default: False]') + dest='unused_without_snapshot', + help=optparse.SUPPRESS_HELP) parser.add_option('--without-ssl', action='store_true', @@ -323,6 +328,12 @@ parser.add_option('--xcode', # set up auto-download list auto_downloads = nodedownload.parse(options.download_list) + +def warn(msg): + prefix = '\033[1m\033[91mWARNING\033[0m' if os.isatty(1) else 'WARNING' + print('%s: %s' % (prefix, msg)) + + def b(value): """Returns the string 'true' if value is truthy, 'false' otherwise.""" if value: @@ -515,7 +526,7 @@ def configure_node(o): o['variables']['host_arch'] = host_arch o['variables']['target_arch'] = target_arch - if target_arch != host_arch and not options.without_snapshot: + if target_arch != host_arch and options.with_snapshot: o['variables']['want_separate_host_toolset'] = 1 else: o['variables']['want_separate_host_toolset'] = 0 @@ -651,7 +662,7 @@ def configure_v8(o): o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs. o['variables']['v8_optimized_debug'] = 0 # Compile with -O0 in debug builds. o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables. - o['variables']['v8_use_snapshot'] = b(not options.without_snapshot) + o['variables']['v8_use_snapshot'] = b(options.with_snapshot) # assume shared_v8 if one of these is set? if options.shared_v8_libpath: diff --git a/node.gyp b/node.gyp index 46dbf396c69..86cc7d1e6bc 100644 --- a/node.gyp +++ b/node.gyp @@ -1,6 +1,6 @@ { 'variables': { - 'v8_use_snapshot%': 'true', + 'v8_use_snapshot%': 'false', 'node_use_dtrace%': 'false', 'node_use_etw%': 'false', 'node_use_perfctr%': 'false', diff --git a/tools/test.py b/tools/test.py index 579d444f6c5..e14ade37128 100755 --- a/tools/test.py +++ b/tools/test.py @@ -29,6 +29,7 @@ import imp +import logging import optparse import os import platform @@ -45,6 +46,8 @@ from datetime import datetime from Queue import Queue, Empty +logger = logging.getLogger('testrunner') + VERBOSE = False @@ -225,7 +228,7 @@ def HasRun(self, output): class TapProgressIndicator(SimpleProgressIndicator): def Starting(self): - print '1..%i' % len(self.cases) + logger.info('1..%i' % len(self.cases)) self._done = 0 def AboutToRun(self, case): @@ -238,16 +241,16 @@ def HasRun(self, output): status_line = 'not ok %i - %s' % (self._done, command) if FLAKY in output.test.outcomes and self.flaky_tests_mode == "dontcare": status_line = status_line + " # TODO : Fix flaky test" - print status_line + logger.info(status_line) for l in output.output.stderr.splitlines(): - print '#' + l + logger.info('#' + l) for l in output.output.stdout.splitlines(): - print '#' + l + logger.info('#' + l) else: status_line = 'ok %i - %s' % (self._done, command) if FLAKY in output.test.outcomes: status_line = status_line + " # TODO : Fix flaky test" - print status_line + logger.info(status_line) duration = output.test.duration @@ -255,9 +258,9 @@ def HasRun(self, output): total_seconds = (duration.microseconds + (duration.seconds + duration.days * 24 * 3600) * 10**6) / 10**6 - print ' ---' - print ' duration_ms: %d.%d' % (total_seconds, duration.microseconds / 1000) - print ' ...' + logger.info(' ---') + logger.info(' duration_ms: %d.%d' % (total_seconds, duration.microseconds / 1000)) + logger.info(' ...') def Done(self): pass @@ -1192,6 +1195,8 @@ def BuildOptions(): default='release') result.add_option("-v", "--verbose", help="Verbose output", default=False, action="store_true") + result.add_option('--logfile', dest='logfile', + help='write test output to file. NOTE: this only applies the tap progress indicator') result.add_option("-S", dest="scons_flags", help="Flag to pass through to scons", default=[], action="append") result.add_option("-p", "--progress", @@ -1368,6 +1373,13 @@ def Main(): parser.print_help() return 1 + ch = logging.StreamHandler(sys.stdout) + logger.addHandler(ch) + logger.setLevel(logging.INFO) + if options.logfile: + fh = logging.FileHandler(options.logfile) + logger.addHandler(fh) + workspace = abspath(join(dirname(sys.argv[0]), '..')) suites = GetSuites(join(workspace, 'test')) repositories = [TestRepository(join(workspace, 'test', name)) for name in suites] diff --git a/vcbuild.bat b/vcbuild.bat index 96ffeed02f7..c15df326bb0 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -17,11 +17,11 @@ set msiplatform=x86 set target=Build set target_arch=ia32 set debug_arg= -set nosnapshot_arg= +set snapshot_arg= set noprojgen= set nobuild= set nosign= -set nosnapshot= +set snapshot= set test= set test_args= set msi= @@ -50,7 +50,7 @@ if /i "%1"=="x64" set target_arch=x64&goto arg-ok if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok if /i "%1"=="nobuild" set nobuild=1&goto arg-ok if /i "%1"=="nosign" set nosign=1&goto arg-ok -if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok +if /i "%1"=="snapshot" set snapshot=1&goto arg-ok if /i "%1"=="noetw" set noetw=1&goto arg-ok if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok if /i "%1"=="licensertf" set licensertf=1&goto arg-ok @@ -61,7 +61,8 @@ if /i "%1"=="test-simple" set test=test-simple&goto arg-ok if /i "%1"=="test-message" set test=test-message&goto arg-ok if /i "%1"=="test-gc" set test=test-gc&set buildnodeweak=1&goto arg-ok if /i "%1"=="test-all" set test=test-all&set buildnodeweak=1&goto arg-ok -if /i "%1"=="test" set test=test&goto arg-ok +if /i "%1"=="test-ci" set test=test-ci&goto arg-ok +if /i "%1"=="test" set test=test&set jslint=1&goto arg-ok @rem Include small-icu support with MSI installer if /i "%1"=="msi" set msi=1&set licensertf=1&set download_arg="--download=all"&set i18n_arg=small-icu&goto arg-ok if /i "%1"=="upload" set upload=1&goto arg-ok @@ -81,10 +82,9 @@ goto next-arg :args-done if defined upload goto upload -if defined jslint goto jslint if defined build_release ( - set nosnapshot=1 + set snapshot= set config=Release set msi=1 set licensertf=1 @@ -94,7 +94,7 @@ if defined build_release ( if "%config%"=="Debug" set debug_arg=--debug if "%target_arch%"=="x64" set msiplatform=x64 -if defined nosnapshot set nosnapshot_arg=--without-snapshot +if defined snapshot set snapshot_arg=--with-snapshot if defined noetw set noetw_arg=--without-etw& set noetw_msi_arg=/p:NoETW=1 if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg=/p:NoPerfCtr=1 @@ -151,7 +151,7 @@ goto exit if defined noprojgen goto msbuild @rem Generate the VS project. -python configure %download_arg% %i18n_arg% %debug_arg% %nosnapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG% +python configure %download_arg% %i18n_arg% %debug_arg% %snapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG% if errorlevel 1 goto create-msvs-files-failed if not exist node.sln goto create-msvs-files-failed echo Project files generated. @@ -202,7 +202,11 @@ if "%test%"=="" goto exit if "%config%"=="Debug" set test_args=--mode=debug if "%config%"=="Release" set test_args=--mode=release +set test_args=%test_args% --arch=%target_arch% + + if "%test%"=="test" set test_args=%test_args% simple message +if "%test%"=="test-ci" set test_args=%test_args% -p tap --logfile test.tap simple message internet if "%test%"=="test-internet" set test_args=%test_args% internet if "%test%"=="test-pummel" set test_args=%test_args% pummel if "%test%"=="test-simple" set test_args=%test_args% simple @@ -224,7 +228,7 @@ goto exit :run-tests echo running 'python tools/test.py %test_args%' python tools/test.py %test_args% -if "%test%"=="test" goto jslint +if defined jslint goto jslint goto exit :create-msvs-files-failed