# # spec file for package [spectemplate] # # Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # See also http://en.opensuse.org/openSUSE:Specfile_guidelines Name: nodejs-test262 Version: 5.1 Release: 0 Summary: ECMAScript 5.1 conformance test suite # file LICENSE in tar ball root: License: BSD-3-Clause Group: Development/Languages/Other Url: http://test262.ecmascript.org/ BuildArch: noarch BuildRequires: python python-xml nodejs libv8-3 pv xz BuildRequires: fdupes # No Requires:, as these are only needed if you want to run the test. # The expected use for the package is to just look at the log. Recommends: python python-xml nodejs libv8-3 xz # # http://hg.ecmascript.org/tests/test262/archive/tip.tar.bz2 # # warning: you need to inspect the top level directory name of the tar # ball and update the name in %%setup below. %define tld_name test262-d067d2f0ca30 Source0: tip.tar.bz2 # A manually reviewed test log for reference... # 0 froh@byron:/tmp/home:froh:branches:devel:languages:nodejs/nodejs-test262 $ \ # cp /var/tmp/build-root/openSUSE_Factory-x86_64/home/abuild/rpmbuild/BUILD/nodejs-test262-5.1/test262.log . # xz -9 test262.log Source1: test262.log.xz Patch0: sort-test-cases-for-normalized-output.patch Patch1: testcase-output-eol.patch %nodejs_find_provides_and_requires %description test262 is a test suite intended to check agreement between JavaScript implementations and ECMA-262, the ECMAScript Language Specification (currently 5.1 Edition). The test suite contains thousands of individual tests, each of which tests some specific requirements of the ECMAScript Language Specification %prep %setup -qn %tld_name %patch -P 0 -p1 %patch -P 1 -p1 # the external contributions have been merged into the official test suite. rm -rf external # the website can run the test suite from a browser rm -rf website # this is also not needed: rm .hgignore %build if true # set to false temproarily to just test packaging then # unpack the previous log xzcat %{S:1} > test262.log.previous SIZE=$(wc -l test262.log.previous | cut -d" " -f1) # for now: simply hardcode nodejs d8 as runtime tools/packaging/test262.py --command=d8 | pv --timer --eta --rate --average-rate --bytes --line-mode --size $SIZE --interval 10 --wait --force | # normalize temp names sed -e "s,/tmp/test262-......\.js:,/tmp/test262-TEST.js:," > test262.log # compare to known log: diff -u test262.log.previous test262.log | tee test262.log.diff # equivalent to xz -e9 test262.log.previous: rm test262.log.previous cp %{S:1} test262.log.previous.xz xz -e9 test262.log else cp %{S:1} test262.log.xz cp %{S:1} test262.log.previous.xz touch test262.log.diff fi %check if test -s test262.log.diff then echo "There are test differences:" cat test262.log.diff false else echo "The test yields the known results." rm test262.log.diff fi %install mkdir -p %buildroot%_datadir/%name cp -a . %buildroot%_datadir/%name %fdupes %buildroot%_datadir/%name %files #%%doc %defattr(-,root,root) %attr(0755,root,root) %_datadir/nodejs-test262/tools/packaging/parseTestRecord.py %_datadir/nodejs-test262 %changelog