Hello community, here is the log from the commit of package cvise for openSUSE:Factory checked in at 2020-09-30 19:53:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cvise (Old) and /work/SRC/openSUSE:Factory/.cvise.new.4249 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "cvise" Wed Sep 30 19:53:55 2020 rev:16 rq:838595 version:1.7.0+git.20200929.17345b8 Changes: -------- --- /work/SRC/openSUSE:Factory/cvise/cvise.changes 2020-07-30 13:34:07.934753005 +0200 +++ /work/SRC/openSUSE:Factory/.cvise.new.4249/cvise.changes 2020-09-30 19:54:10.416773028 +0200 @@ -1,0 +2,19 @@ +Tue Sep 29 15:39:22 UTC 2020 - mliska@suse.cz + +- Update to version 1.7.0+git.20200929.17345b8: + * Bump to v1.7.0. + +------------------------------------------------------------------- +Tue Sep 29 15:33:15 UTC 2020 - mliska@suse.cz + +- Update to version 1.6.0+git.20200929.a12db89: + * Fix psutil core count detection code. + * Add OBS image at the beginning. + * Add icon. + * Add OBS master following project. + * Update last update Creduce commit. + * build_and_test.sh: resolve bash via /usr/bin/env + * passes/ifs.py: fix infinite loop in IfPass + * Fix a small type. + +------------------------------------------------------------------- Old: ---- cvise-1.6.0+git.20200728.98d731e.tar.xz New: ---- cvise-1.7.0+git.20200929.17345b8.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cvise.spec ++++++ --- /var/tmp/diff_new_pack.9NwSKg/_old 2020-09-30 19:54:11.808774272 +0200 +++ /var/tmp/diff_new_pack.9NwSKg/_new 2020-09-30 19:54:11.812774276 +0200 @@ -17,7 +17,7 @@ Name: cvise -Version: 1.6.0+git.20200728.98d731e +Version: 1.7.0+git.20200929.17345b8 Release: 0 Summary: Super-parallel Python port of the C-Reduce License: BSD-3-Clause ++++++ _service ++++++ --- /var/tmp/diff_new_pack.9NwSKg/_old 2020-09-30 19:54:11.852774312 +0200 +++ /var/tmp/diff_new_pack.9NwSKg/_new 2020-09-30 19:54:11.852774312 +0200 @@ -4,7 +4,7 @@ <param name="scm">git</param> <param name="changesgenerate">enable</param> <param name="filename">cvise</param> - <param name="versionformat">1.6.0+git.%cd.%h</param> + <param name="versionformat">1.7.0+git.%cd.%h</param> </service> <service mode="disabled" name="recompress"> <param name="file">*.tar</param> ++++++ cvise-1.6.0+git.20200728.98d731e.tar.xz -> cvise-1.7.0+git.20200929.17345b8.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-1.6.0+git.20200728.98d731e/CMakeLists.txt new/cvise-1.7.0+git.20200929.17345b8/CMakeLists.txt --- old/cvise-1.6.0+git.20200728.98d731e/CMakeLists.txt 2020-07-28 10:27:08.000000000 +0200 +++ new/cvise-1.7.0+git.20200929.17345b8/CMakeLists.txt 2020-09-29 17:35:22.000000000 +0200 @@ -122,11 +122,11 @@ set(cvise_PACKAGE "cvise") set(cvise_PACKAGE_BUGREPORT "https://github.com/marxin/cvise/issues") set(cvise_PACKAGE_NAME "cvise") -set(cvise_PACKAGE_STRING "cvise 1.6.0") +set(cvise_PACKAGE_STRING "cvise 1.7.0") set(cvise_PACKAGE_TARNAME "cvise") set(cvise_PACKAGE_URL "https://github.com/marxin/cvise/") -set(cvise_PACKAGE_VERSION "1.6.0") -set(cvise_VERSION "1.6.0") +set(cvise_PACKAGE_VERSION "1.7.0") +set(cvise_VERSION "1.7.0") set(cvise_LLVM_VERSION "${LLVM_PACKAGE_VERSION}") configure_file("cmake_config.h.in" "${PROJECT_BINARY_DIR}/config.h") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-1.6.0+git.20200728.98d731e/CREDUCE_MERGE new/cvise-1.7.0+git.20200929.17345b8/CREDUCE_MERGE --- old/cvise-1.6.0+git.20200728.98d731e/CREDUCE_MERGE 2020-07-28 10:27:08.000000000 +0200 +++ new/cvise-1.7.0+git.20200929.17345b8/CREDUCE_MERGE 2020-09-29 17:35:22.000000000 +0200 @@ -1,2 +1,2 @@ Last cherry-picked git revision: -274e1fe5210b379fbfdca9a565715d2db1df2d04 +c32c5c327758a047ae10e55a2465ba54293dfff9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-1.6.0+git.20200728.98d731e/INSTALL.md new/cvise-1.7.0+git.20200929.17345b8/INSTALL.md --- old/cvise-1.6.0+git.20200728.98d731e/INSTALL.md 2020-07-28 10:27:08.000000000 +0200 +++ new/cvise-1.7.0+git.20200929.17345b8/INSTALL.md 2020-09-29 17:35:22.000000000 +0200 @@ -3,7 +3,7 @@ ## Using a Package Manager Before compiling C-Vise yourself, you might want to see if your OS -comes with a precompiled package for C-Vise. +comes with a pre-compiled package for C-Vise. ### openSUSE Tumbleweed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-1.6.0+git.20200728.98d731e/README.md new/cvise-1.7.0+git.20200929.17345b8/README.md --- old/cvise-1.6.0+git.20200728.98d731e/README.md 2020-07-28 10:27:08.000000000 +0200 +++ new/cvise-1.7.0+git.20200929.17345b8/README.md 2020-09-29 17:35:22.000000000 +0200 @@ -1,5 +1,6 @@ # C-Vise +[![OBS master](https://build.opensuse.org/assets/favicon-ac48595b97f38c2425d7ea77739a63d771fcda9f73cc8c474b66461c0836fc2a.ico)](https://build.opensuse.org/package/show/home:marxin:cvise-github/cvise) [![Travis Build Status](https://travis-ci.com/marxin/cvise.svg?branch=master)](https://travis-ci.com/marxin/cvise) [![Total alerts](https://img.shields.io/lgtm/alerts/g/marxin/cvise.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/marxin/cvise/alerts/) [![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/marxin/cvise.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/marxin/cvise/context:python) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-1.6.0+git.20200728.98d731e/build_and_test.sh new/cvise-1.7.0+git.20200929.17345b8/build_and_test.sh --- old/cvise-1.6.0+git.20200728.98d731e/build_and_test.sh 2020-07-28 10:27:08.000000000 +0200 +++ new/cvise-1.7.0+git.20200929.17345b8/build_and_test.sh 2020-09-29 17:35:22.000000000 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash BUILD_TYPE=$1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-1.6.0+git.20200728.98d731e/cvise/passes/ifs.py new/cvise-1.7.0+git.20200929.17345b8/cvise/passes/ifs.py --- old/cvise-1.6.0+git.20200728.98d731e/cvise/passes/ifs.py 2020-07-28 10:27:08.000000000 +0200 +++ new/cvise-1.7.0+git.20200929.17345b8/cvise/passes/ifs.py 2020-09-29 17:35:22.000000000 +0200 @@ -39,10 +39,12 @@ def advance(self, test_case, state): if state.value == 0: + state = state.copy() state.value = 1 else: - state.advance() - state.value = 0 + state = state.advance() + if state: + state.value = 0 return state def advance_on_success(self, test_case, state): @@ -63,12 +65,11 @@ if self.line_regex.search(line): if state.index <= i and i < state.end(): - tmp_file.write('#if {0}\n'.format(state.value)) + if self.__macro_continues(line): + in_multiline = True + line = '#if {0}\n'.format(state.value) i += 1 - if self.__macro_continues(line): - in_multiline = True - else: - tmp_file.write(line) + tmp_file.write(line) cmd = [self.external_programs["unifdef"], "-B", "-x", "2", "-k", "-o", test_case, tmp_file.name] stdout, stderr, returncode = process_event_notifier.run_process(cmd) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-1.6.0+git.20200728.98d731e/cvise/tests/test_ifs.py new/cvise-1.7.0+git.20200929.17345b8/cvise/tests/test_ifs.py --- old/cvise-1.6.0+git.20200728.98d731e/cvise/tests/test_ifs.py 2020-07-28 10:27:08.000000000 +0200 +++ new/cvise-1.7.0+git.20200929.17345b8/cvise/tests/test_ifs.py 2020-09-29 17:35:22.000000000 +0200 @@ -25,3 +25,51 @@ os.unlink(tmp_file.name) self.assertEqual(variant, "int a = 2;\n") + + def test_two_steps(self): + self.maxDiff = None + in_contents = ( + "#if FOO\nint foo = 1;\n#else\nint foo = 0;\n#endif\n" + + "#if BAR\nint bar = 1;\n#else\nint bar = 0;\n#endif\n" + ) + expected_outs = [ + # ix val chunk contents + # FOO=0 BAR=0 + (0, 0, 2, 'int foo = 0;\nint bar = 0;\n'), + # FOO=1 BAR=1 + (0, 1, 2, 'int foo = 1;\nint bar = 1;\n'), + + # FOO=0 + (0, 0, 1, ('int foo = 0;\n' + + '#if BAR\nint bar = 1;\n#else\nint bar = 0;\n#endif\n')), + # FOO=1 + (0, 1, 1, ('int foo = 1;\n' + + '#if BAR\nint bar = 1;\n#else\nint bar = 0;\n#endif\n')), + # BAR=0 + (1, 0, 1, ('#if FOO\nint foo = 1;\n#else\nint foo = 0;\n#endif\n' + + 'int bar = 0;\n')), + # BAR=1 + (1, 1, 1, ('#if FOO\nint foo = 1;\n#else\nint foo = 0;\n#endif\n' + + 'int bar = 1;\n')), + ] + + with tempfile.NamedTemporaryFile(mode="w", delete=False) as tf: + tf.write(in_contents) + + outs = [] + + # perform all iterations. They should iterate through FOO/!FOO x BAR/!BAR. + state = self.pass_.new(tf.name) + while state: + with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp_file: + tmp_file.write(in_contents) + + (_, state) = self.pass_.transform(tmp_file.name, state, self.process_event_notifier) + with open(tmp_file.name) as variant_file: + variant = variant_file.read() + outs.append(tuple([state.index, state.value, state.chunk, variant])) + os.unlink(tmp_file.name) + state = self.pass_.advance(tmp_file.name, state) + + os.unlink(tf.name) + self.assertEqual(expected_outs, outs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cvise-1.6.0+git.20200728.98d731e/cvise.py new/cvise-1.7.0+git.20200929.17345b8/cvise.py --- old/cvise-1.6.0+git.20200728.98d731e/cvise.py 2020-07-28 10:27:08.000000000 +0200 +++ new/cvise-1.7.0+git.20200929.17345b8/cvise.py 2020-09-29 17:35:22.000000000 +0200 @@ -134,10 +134,14 @@ # in order to speed up parallel execution core_count = psutil.cpu_count(logical=False) if not core_count: - psutil.cpu_count(logical=True) + core_count = psutil.cpu_count(logical=True) # respect affinity affinity = len(psutil.Process().cpu_affinity()) - core_count = min(core_count, affinity) + assert affinity >= 1 + if core_count: + core_count = min(core_count, affinity) + else: + core_count = affinity except NotImplementedError: core_count = 1