Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package black-hole-solver for openSUSE:Factory checked in at 2021-05-23 00:06:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/black-hole-solver (Old) and /work/SRC/openSUSE:Factory/.black-hole-solver.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "black-hole-solver" Sun May 23 00:06:08 2021 rev:2 rq:894924 version:1.10.1 Changes: -------- --- /work/SRC/openSUSE:Factory/black-hole-solver/black-hole-solver.changes 2020-08-02 12:20:04.903343161 +0200 +++ /work/SRC/openSUSE:Factory/.black-hole-solver.new.2988/black-hole-solver.changes 2021-05-23 00:06:12.558599620 +0200 @@ -1,0 +2,9 @@ +Thu Apr 29 11:35:17 UTC 2021 - Ferdinand Thiessen <r...@fthiessen.de> + +- Update to version 1.10.1: + * Add "--show-max-num-played-cards" flag, inspired by + https://politaire.com/article/blackhole.html +- Add fix-pkgconfig-libdir.patch to fix path of library dir in + pkgconfig file. + +------------------------------------------------------------------- Old: ---- black-hole-solver-1.8.0.tar.xz New: ---- black-hole-solver-1.10.1.tar.xz fix-pkgconfig-libdir.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ black-hole-solver.spec ++++++ --- /var/tmp/diff_new_pack.DEWryH/_old 2021-05-23 00:06:13.090596790 +0200 +++ /var/tmp/diff_new_pack.DEWryH/_new 2021-05-23 00:06:13.090596790 +0200 @@ -1,7 +1,7 @@ # # spec file for package black-hole-solver # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,13 +20,15 @@ # Missing perl(Env::Path), should also skip some tests like build-process %global run_tests 0 Name: black-hole-solver -Version: 1.8.0 +Version: 1.10.1 Release: 0 Summary: The Black Hole Solver Executable License: MIT -Group: Amusements/Games +Group: Amusements/Games/Board/Card URL: https://www.shlomifish.org/open-source/projects/black-hole-solitaire-solver/ -Source: https://fc-solve.shlomifish.org/downloads/fc-solve/black-hole-solver-%{version}.tar.xz +Source: https://sourceforge.net/projects/fc-solve/files/fc-solve/%{name}-%{version}.tar.xz +# PATCH-FIX-OPENSUSE fix-pkgconfig-libdir.patch -- https://sourceforge.net/p/fc-solve/tickets/1/ +Patch0: fix-pkgconfig-libdir.patch BuildRequires: cmake BuildRequires: cmake(Rinutils) BuildRequires: gcc-c++ @@ -34,8 +36,9 @@ BuildRequires: xxhash-devel %if %{run_tests} # For testing -BuildRequires: perl(Env::Path) BuildRequires: perl(Getopt::Long) +BuildRequires: perl(Env::Path) +BuildRequires: perl(Test::Some) BuildRequires: perl(Test::More) %endif @@ -46,11 +49,11 @@ cards to move. %package -n libblack_hole_solver%{sover} -Summary: The Black Hole Solitaire Solver dynamic libraries +Summary: Solitaire Solver dynamic libraries Group: System/Libraries %description -n libblack_hole_solver%{sover} -Contains the Black Hole Solitaire library. +Contains the Black Hole Solitaire dynamic library. %package devel Summary: Black Hole Solver development headers @@ -61,10 +64,13 @@ Files needed for building applications against Black Hole Solver. %prep -%autosetup -p3 +%autosetup -p1 %build -%cmake -DFCS_AVOID_TCMALLOC=ON -DUSE_SYSTEM_XXHASH=ON -DBUILD_STATIC_LIBRARY=OFF +%cmake -DFCS_AVOID_TCMALLOC=ON \ + -DUSE_SYSTEM_XXHASH=ON \ + -DBUILD_STATIC_LIBRARY=OFF \ + -DENABLE_DISPLAYING_MAX_NUM_PLAYED_CARDS=ON %cmake_build %if %{run_tests} @@ -76,8 +82,6 @@ %install %cmake_install -# Fix the .pc file manually for now -sed -i'' 's#/lib$#/%{_lib}#g' %{buildroot}/%{_libdir}/pkgconfig/*.pc %post -p /sbin/ldconfig -n libblack_hole_solver1 %postun -p /sbin/ldconfig -n libblack_hole_solver1 ++++++ black-hole-solver-1.8.0.tar.xz -> black-hole-solver-1.10.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/.tidyallrc new/black-hole-solver-1.10.1/.tidyallrc --- old/black-hole-solver-1.8.0/.tidyallrc 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/.tidyallrc 2020-09-29 14:15:09.000000000 +0200 @@ -1,4 +1,4 @@ [PerlTidy] -argv = -ci=4 -bl -cti=0 +argv = -ci=4 -bl -cti=0 --character-encoding=none ignore = **/{cmpdigest,valgrind,verify}--*.t select = **/*.{pl,pm,t} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/CMakeLists.txt new/black-hole-solver-1.10.1/CMakeLists.txt --- old/black-hole-solver-1.8.0/CMakeLists.txt 2020-06-25 17:16:29.000000000 +0200 +++ new/black-hole-solver-1.10.1/CMakeLists.txt 2020-10-28 12:52:41.000000000 +0100 @@ -12,6 +12,7 @@ option (BUILD_STATIC_LIBRARY "Build and install the static library") option (LINK_TO_STATIC "Link the executables to the static library") option (DISABLE_APPLYING_RPATH "Disable applying rpath") +option (ENABLE_DISPLAYING_MAX_NUM_PLAYED_CARDS "Allow recording and displaying the maximal number of played/\"moved\" cards. Enabling it may make the non-related run time somewhat slower.") INCLUDE(FindPkgConfig) @@ -69,7 +70,7 @@ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) ENDIF () SET (LIB_BASE "black_hole_solver") -SET (BLACK_HOLE_SOLVER_MODULES "can_move.c" "lib.c" "meta_alloc.c" "rank_reach_prune.c") +SET (BLACK_HOLE_SOLVER_MODULES "can_move.c" "generated/lib.c" "meta_alloc.c" "rank_reach_prune.c") IF (${BHS_STATE_STORAGE} STREQUAL "BHS_STATE_STORAGE_INTERNAL_HASH") LIST(APPEND BLACK_HOLE_SOLVER_MODULES fcs_hash.c) @@ -104,9 +105,7 @@ # This gives better performance for the threaded programs. FIND_LIBRARY(LIBTCMALLOC_LIB tcmalloc) - IF(LIBTCMALLOC_LIB STREQUAL "LIBTCMALLOC_LIB-NOTFOUND") - # Do nothing. - ELSE() + IF(NOT ("${LIBTCMALLOC_LIB}" STREQUAL "LIBTCMALLOC_LIB-NOTFOUND")) SET(LIBTCMALLOC_LIB_LIST ${LIBTCMALLOC_LIB}) ENDIF() ENDIF () @@ -147,7 +146,10 @@ ADD_DEFINITIONS("-Wno-unknown-pragmas") # So it can find config.h +INCLUDE_DIRECTORIES(BEFORE "${CMAKE_CURRENT_SOURCE_DIR}") INCLUDE_DIRECTORIES(BEFORE "${CMAKE_CURRENT_BINARY_DIR}") +INCLUDE_DIRECTORIES(BEFORE "${CMAKE_CURRENT_BINARY_DIR}/generated") +INCLUDE_DIRECTORIES(BEFORE "${CMAKE_CURRENT_BINARY_DIR}/generated/include") INCLUDE_DIRECTORIES(BEFORE "${CMAKE_CURRENT_SOURCE_DIR}/include") SET (is_parent_gen "${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen-c-lookup-files.pl") @@ -167,6 +169,36 @@ IF (NOT ("${ret}" STREQUAL "0")) MESSAGE(FATAL_ERROR "${cmd} failed!") ENDIF () + +IF (ENABLE_DISPLAYING_MAX_NUM_PLAYED_CARDS) + SET(process_args "--process=none") +ELSE () + SET(process_args "--process=no_max_num_played") +ENDIF () + +FIND_PROGRAM(_PYTHON3 "python3") +SET (found_python3 ) +IF (NOT "${_PYTHON3}" STREQUAL "_PYTHON3-NOTFOUND") + SET (found_python3 "1") + SET (PYTHON3_EXECUTABLE "python3") +ENDIF () +SET(py3_prog "${CMAKE_CURRENT_SOURCE_DIR}/scripts/source_filter.py") +SET(cmd "${PYTHON3_EXECUTABLE}" "${py3_prog}" ${process_args}) +SET(sources) +SET(dests) +FOREACH (src "lib.c" "solver_common.h" "include/black-hole-solver/black_hole_solver.h") + LIST(APPEND sources "${CMAKE_CURRENT_SOURCE_DIR}/${src}") + LIST(APPEND dests "${CMAKE_CURRENT_BINARY_DIR}/generated/${src}") +ENDFOREACH() +ADD_CUSTOM_COMMAND( + OUTPUT ${dests} + COMMAND ${cmd} + DEPENDS "${py3_prog}" ${sources} +) +EXECUTE_PROCESS(COMMAND ${cmd} RESULT_VARIABLE ret) +IF (NOT ("${ret}" STREQUAL "0")) + MESSAGE(FATAL_ERROR "${cmd} failed!") +ENDIF () ADD_LIBRARY ( "${LIB_BASE}" SHARED @@ -174,7 +206,7 @@ ) SET_TARGET_PROPERTIES( - "${LIB_BASE}" PROPERTIES VERSION 1.0.0 SOVERSION 1 + "${LIB_BASE}" PROPERTIES VERSION 1.0.1 SOVERSION 1 ) SET (LIBS "${LIB_BASE}") @@ -250,8 +282,16 @@ "multi-bhs-solver" "multi_solver.c" ) +SET(exes "${BHS_EXE}" "multi-bhs-solver") +IF (ENABLE_DISPLAYING_MAX_NUM_PLAYED_CARDS) + ADD_EXECUTABLE( + "stats-multi-bhs-solver" + "multi_solver_stats.c" + ) + LIST(APPEND exes "stats-multi-bhs-solver") +ENDIF () -FOREACH (exe "${BHS_EXE}" "multi-bhs-solver") +FOREACH (exe ${exes}) TARGET_LINK_LIBRARIES( "${exe}" "${LINKLIB}" @@ -278,18 +318,18 @@ CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h - ) +) CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/${CPACK_PACKAGE_NAME}.spec.in ${CMAKE_CURRENT_SOURCE_DIR}/${CPACK_PACKAGE_NAME}.spec - ) +) CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/lib${CPACK_PACKAGE_NAME}.pc.in ${CMAKE_CURRENT_BINARY_DIR}/lib${CPACK_PACKAGE_NAME}.pc @ONLY - ) +) # Rebuild config.h if ver.txt has changed. ADD_CUSTOM_COMMAND( @@ -300,6 +340,12 @@ ) ENABLE_TESTING() + +SET (test_tags) +IF (NOT ENABLE_DISPLAYING_MAX_NUM_PLAYED_CARDS) + LIST(APPEND test_tags ":no_max_num_played") +ENDIF () +FILE (WRITE "${CMAKE_CURRENT_BINARY_DIR}/TEST_TAGS.txt" "${test_tags}") ADD_TEST( NAME perl_run_tests COMMAND "perl" "${CMAKE_CURRENT_SOURCE_DIR}/run-tests.pl" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/NEWS.asciidoc new/black-hole-solver-1.10.1/NEWS.asciidoc --- old/black-hole-solver-1.8.0/NEWS.asciidoc 2020-06-27 22:10:51.000000000 +0200 +++ new/black-hole-solver-1.10.1/NEWS.asciidoc 2020-10-28 12:47:48.000000000 +0100 @@ -4,6 +4,24 @@ :Date: 2020-06-28 :Revision: $Id$ +1.10.1 ( 28 October 2020 ): +--------------------------------- + +* Fix the shared library's SOVERSION (it is back compat with +earlier 1.x.y versions). + +1.10.0 ( 28 October 2020 ): +--------------------------------- + +* Add ENABLE_DISPLAYING_MAX_NUM_PLAYED_CARDS (off by default) which +gives the "--show-max-num-played-cards" flag. +** Inspired by https://politaire.com/article/blackhole.html by Jan Wolter. Thanks! + +* New build dependency: python3 (3.4.0 or above). + +* New "make check" dependency: https://metacpan.org/pod/Test::Some . +** Thanks to +#perl-qa+ on irc.perl.org. + 1.8.0 ( 28 Jun 2020 ): ---------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/black-hole-solver.spec new/black-hole-solver-1.10.1/black-hole-solver.spec --- old/black-hole-solver-1.8.0/black-hole-solver.spec 2020-06-27 22:11:53.000000000 +0200 +++ new/black-hole-solver-1.10.1/black-hole-solver.spec 2020-10-28 12:53:39.000000000 +0100 @@ -1,5 +1,5 @@ Name: black-hole-solver -Version: 1.8.0 +Version: 1.10.1 Release: 1 License: MIT Group: Amusement/Games @@ -21,6 +21,7 @@ BuildRequires: perl(Test::Differences) BuildRequires: perl(Test::More) BuildRequires: perl(Test::RunValgrind) +BuildRequires: perl(Test::Some) BuildRequires: perl(base) BuildRequires: perl(lib) BuildRequires: perl(strict) @@ -57,39 +58,25 @@ You should install it if you are a game developer who would like to use Freecell Solver from within your programs. -%package -n libblack_hole_solver1-static -Summary: The Freecell Solver static libraries -Group: Amusement/Games -Requires: libblack_hole_solver1 = %{version} - -%description -n libblack_hole_solver1-static -Freecell Solver is a library for automatically solving boards of Freecell and -similar variants of card Solitaire. This package contains the static libraries. - -It is not generally required. - %prep %setup %build %cmake -DLOCALE_INSTALL_DIR=%{_datadir}/locale -DLIB_INSTALL_DIR=%{_libdir} -%make_build +%cmake_build %check -cd build unset FCS_TEST_BUILD -%__make check +rm -f t/clang-format.t +%ctest %install rm -rf %buildroot -%make_install -C build +%cmake_install %files -n libblack_hole_solver1 %{_libdir}/libblack_hole_solver.so* -%files -n libblack_hole_solver1-static -%{_libdir}/libblack_hole_solver.a - %files %defattr(-,root,root) %{_bindir}/black-hole-solve diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/black-hole-solver.spec.in new/black-hole-solver-1.10.1/black-hole-solver.spec.in --- old/black-hole-solver-1.8.0/black-hole-solver.spec.in 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/black-hole-solver.spec.in 2020-10-28 12:12:04.000000000 +0100 @@ -21,6 +21,7 @@ BuildRequires: perl(Test::Differences) BuildRequires: perl(Test::More) BuildRequires: perl(Test::RunValgrind) +BuildRequires: perl(Test::Some) BuildRequires: perl(base) BuildRequires: perl(lib) BuildRequires: perl(strict) @@ -57,39 +58,25 @@ You should install it if you are a game developer who would like to use Freecell Solver from within your programs. -%package -n libblack_hole_solver1-static -Summary: The Freecell Solver static libraries -Group: Amusement/Games -Requires: libblack_hole_solver1 = %{version} - -%description -n libblack_hole_solver1-static -Freecell Solver is a library for automatically solving boards of Freecell and -similar variants of card Solitaire. This package contains the static libraries. - -It is not generally required. - %prep %setup %build %cmake -DLOCALE_INSTALL_DIR=%{_datadir}/locale -DLIB_INSTALL_DIR=%{_libdir} -%make_build +%cmake_build %check -cd build unset FCS_TEST_BUILD -%__make check +rm -f t/clang-format.t +%ctest %install rm -rf %buildroot -%make_install -C build +%cmake_install %files -n libblack_hole_solver1 %{_libdir}/libblack_hole_solver.so* -%files -n libblack_hole_solver1-static -%{_libdir}/libblack_hole_solver.a - %files %defattr(-,root,root) %{_bindir}/black-hole-solve diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/include/black-hole-solver/black_hole_solver.h new/black-hole-solver-1.10.1/include/black-hole-solver/black_hole_solver.h --- old/black-hole-solver-1.8.0/include/black-hole-solver/black_hole_solver.h 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/include/black-hole-solver/black_hole_solver.h 2020-10-27 14:32:44.000000000 +0100 @@ -86,6 +86,11 @@ DLLEXPORT extern unsigned long black_hole_solver_get_iterations_num( black_hole_solver_instance_t *instance); +// Added in version 1.10.0 +#define BLACK_HOLE_SOLVER__API__WITH_GET_MAX_NUM_PLAYED_CARDS 1 +DLLEXPORT extern unsigned long black_hole_solver_get_max_num_played_cards( + black_hole_solver_instance_t *instance); + DLLEXPORT extern int black_hole_solver_get_current_solution_board( black_hole_solver_instance_t *instance, char *output); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/lib.c new/black-hole-solver-1.10.1/lib.c --- old/black-hole-solver-1.8.0/lib.c 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/lib.c 2020-10-27 14:32:44.000000000 +0100 @@ -92,6 +92,7 @@ uint_fast32_t num_columns; uint_fast32_t bits_per_column; uint_fast32_t queue_len; + uint_fast32_t max_reached_depths_stack_len, current_depths_stack_len; int_fast32_t sol_foundations_card_rank, sol_foundations_card_suit; // This is the ranks of the cards in the columns. It remains constant // for the duration of the game. @@ -116,6 +117,7 @@ can_move__row *can_move; bhs_queue_item_t queue[QUEUE_MAX_SIZE]; #define MAX_NUM_STATES (NUM_SUITS * NUM_RANKS + 1) + uint8_t depths_stack[MAX_NUM_STATES + 1]; bhs_solution_state_t states_in_solution[MAX_NUM_STATES]; } bhs_solver_t; @@ -603,6 +605,7 @@ static inline void setup_config(bhs_solver_t *const solver) { + solver->max_reached_depths_stack_len = solver->current_depths_stack_len = 0; solver->queue_len = 0; solver->num_states_in_collection = 0; solver->effective_place_queens_on_kings = @@ -654,10 +657,20 @@ const_SLOT(effective_place_queens_on_kings, solver); const_SLOT(max_iters_limit, solver); var_AUTO(iterations_num, solver->iterations_num); + var_AUTO( + max_reached_depths_stack_len, solver->max_reached_depths_stack_len); + var_AUTO(current_depths_stack_len, solver->current_depths_stack_len); while (solver->queue_len > 0) { + const_AUTO(prev_len, solver->queue_len); --solver->queue_len; + while (current_depths_stack_len && + (solver->depths_stack[current_depths_stack_len - 1] == prev_len)) + { + --current_depths_stack_len; + } + solver->depths_stack[current_depths_stack_len++] = prev_len - 1; const_AUTO(queue_item_copy, solver->queue[solver->queue_len]); const_AUTO(foundations, queue_item_copy.s.packed.key.foundations); rin_bit_reader r; @@ -675,6 +688,7 @@ bool no_cards = true; const bool has_talon = talon_ptr < talon_len; + bool was_moved = false; if (has_talon) { @@ -684,6 +698,7 @@ { return BLACK_HOLE_SOLVER__OUT_OF_MEMORY; } + was_moved = true; } if (effective_place_queens_on_kings || (foundations != RANK_K)) { @@ -703,6 +718,7 @@ { return BLACK_HOLE_SOLVER__OUT_OF_MEMORY; } + was_moved = true; } } } @@ -719,24 +735,38 @@ } } } + if (was_moved) + { + solver->depths_stack[current_depths_stack_len++] = + solver->queue_len; + if (current_depths_stack_len > max_reached_depths_stack_len) + { + max_reached_depths_stack_len = current_depths_stack_len; + } + } if (no_cards) { solver->final_state = queue_item_copy.s.packed; - + solver->max_reached_depths_stack_len = max_reached_depths_stack_len; solver->iterations_num = iterations_num; + solver->current_depths_stack_len = current_depths_stack_len; return BLACK_HOLE_SOLVER__SUCCESS; } else if (iterations_num == max_iters_limit) { + solver->max_reached_depths_stack_len = max_reached_depths_stack_len; solver->iterations_num = iterations_num; + solver->current_depths_stack_len = current_depths_stack_len; return BLACK_HOLE_SOLVER__OUT_OF_ITERS; } } + solver->max_reached_depths_stack_len = max_reached_depths_stack_len; solver->iterations_num = iterations_num; + solver->current_depths_stack_len = current_depths_stack_len; return BLACK_HOLE_SOLVER__NOT_SOLVABLE; } @@ -751,6 +781,7 @@ #endif solver->iterations_num = 0; solver->queue_len = 0; + solver->max_reached_depths_stack_len = solver->current_depths_stack_len = 0; solver->num_states_in_collection = 0; return BLACK_HOLE_SOLVER__SUCCESS; @@ -879,6 +910,15 @@ return ((bhs_solver_t *)instance_proto)->iterations_num; } +DLLEXPORT extern unsigned long __attribute__((pure)) +black_hole_solver_get_max_num_played_cards( + black_hole_solver_instance_t *instance_proto) +{ + const_AUTO( + ret, ((bhs_solver_t *)instance_proto)->max_reached_depths_stack_len); + return (ret ? (ret - 1) : 0); +} + DLLEXPORT extern int black_hole_solver_get_current_solution_board( black_hole_solver_instance_t *instance_proto, char *const output) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/multi_solver.c new/black-hole-solver-1.10.1/multi_solver.c --- old/black-hole-solver-1.8.0/multi_solver.c 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/multi_solver.c 2020-10-27 14:32:44.000000000 +0100 @@ -1,7 +1,7 @@ // Copyright (C) 2018 Shlomi Fish <shlo...@cpan.org> // // Distributed under terms of the Expat license. -#include "solver_common.h" +#include <solver_common.h> int main(int argc, char *argv[]) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/multi_solver_stats.c new/black-hole-solver-1.10.1/multi_solver_stats.c --- old/black-hole-solver-1.8.0/multi_solver_stats.c 1970-01-01 01:00:00.000000000 +0100 +++ new/black-hole-solver-1.10.1/multi_solver_stats.c 2020-10-27 14:32:44.000000000 +0100 @@ -0,0 +1,104 @@ +// Copyright (C) 2018 Shlomi Fish <shlo...@cpan.org> +// +// Distributed under terms of the Expat license. +#include <solver_common.h> + +static inline int output_stats_filename( + const char *const filename, bhs_settings *const settings_ptr) +{ +#define settings (*settings_ptr) + int ret = 0; + + FILE *fh = stdin; + if (filename) + { + fh = fopen(filename, "rt"); + if (!fh) + { + fprintf(stderr, "Cannot open '%s' for reading!\n", filename); + return -1; + } + } + char board[MAX_LEN_BOARD_STRING]; + fread(board, sizeof(board[0]), MAX_LEN_BOARD_STRING, fh); + + if (filename) + { + fclose(fh); + } + + board[MAX_LEN_BOARD_STRING - 1] = '\0'; + + int error_line_num; + const enum GAME_TYPE game_type = settings.game_type; + const unsigned num_columns = + ((game_type == GAME__BH) ? BHS__BLACK_HOLE__NUM_COLUMNS + : (game_type == GAME__GOLF) ? BHS__GOLF__NUM_COLUMNS + : BHS__ALL_IN_A_ROW__NUM_COLUMNS); +#define solver (settings_ptr->the_solver) + if (black_hole_solver_read_board(solver, board, &error_line_num, + num_columns, + ((game_type == GAME__BH) ? BHS__BLACK_HOLE__MAX_NUM_CARDS_IN_COL + : (game_type == GAME__GOLF) + ? BHS__GOLF__MAX_NUM_CARDS_IN_COL + : BHS__ALL_IN_A_ROW__MAX_NUM_CARDS_IN_COL), + ((game_type == GAME__BH) ? BHS__BLACK_HOLE__BITS_PER_COL + : BHS__GOLF__BITS_PER_COL))) + { + fprintf(stderr, "Error reading the board at line No. %d!\n", + error_line_num); + exit(-1); + } + if (unlikely(black_hole_solver_setup(solver))) + { + fputs("Could not initialise solver (out-of-memory)\n", stderr); + exit(-1); + } + + const int solver_ret_code = solver_run( + solver, settings.max_iters_limit, settings.iters_display_step); + FILE *const out_fh = settings_ptr->out_fh; + + if (!solver_ret_code) + { + } + else if (solver_ret_code == BLACK_HOLE_SOLVER__OUT_OF_MEMORY) + { + fputs("Out of memory!\n", stderr); + exit(-1); + } + else if (solver_ret_code == BLACK_HOLE_SOLVER__OUT_OF_ITERS) + { + fputs("Intractable!\n", out_fh); + ret = -2; + } + else + { + fputs("Unsolved!\n", out_fh); + fprintf(out_fh, "At most %lu cards could be played.\n", + black_hole_solver_get_max_num_played_cards(solver)); + ret = -1; + } + + black_hole_solver_recycle(solver); + return ret; +#undef settings +} + +int main(int argc, char *argv[]) +{ + int arg_idx; + bhs_settings settings = parse_cmd_line(argc, argv, &arg_idx); + + for (; arg_idx < argc; ++arg_idx) + { + char *const filename = argv[arg_idx]; + fprintf(settings.out_fh, "[= Starting file %s =]\n", filename); + output_stats_filename(filename, &settings); + fprintf(settings.out_fh, "[= END of file %s =]\n", filename); + } + fflush(settings.out_fh); + solve_free(&settings); + + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/run-tests.pl new/black-hole-solver-1.10.1/run-tests.pl --- old/black-hole-solver-1.8.0/run-tests.pl 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/run-tests.pl 2020-10-27 14:32:44.000000000 +0100 @@ -64,6 +64,7 @@ local $ENV{FCS_PATH} = $fcs_bin_path; local $ENV{FCS_BIN_PATH} = $fcs_bin_path; local $ENV{FCS_SRC_PATH} = $src_dir; + local $ENV{TEST_SOME} = $fcs_bin_path->child("TEST_TAGS.txt")->slurp_raw(); local $ENV{FREECELL_SOLVER_QUIET} = 1; Env::Path->PATH->Prepend( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/scripts/source_filter.py new/black-hole-solver-1.10.1/scripts/source_filter.py --- old/black-hole-solver-1.8.0/scripts/source_filter.py 1970-01-01 01:00:00.000000000 +0100 +++ new/black-hole-solver-1.10.1/scripts/source_filter.py 2020-10-27 14:32:44.000000000 +0100 @@ -0,0 +1,108 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# vim:fenc=utf-8 +# +# Copyright ?? 2020 Shlomi Fish < https://www.shlomifish.org/ > +# +# Licensed under the terms of the MIT license. + +import re +import sys +from pathlib import Path + +if sys.argv[1] == '--process=no_max_num_played': + should_process = True +elif sys.argv[1] == '--process=none': + should_process = False +else: + raise Exception("wrong invocation") + + +def _newlinify(text, m): + start = text.rindex("\n", 0, m.start(0)+1) + end = text.index("\n", m.end(0)-1, -1) + prefix = text[0:start] + "".join([ + x for x in text[start:end] if x == '\n' + ]) + return (prefix, text[end:]) + + +def _remove(text, pat): + m = re.search(pat, text, flags=(re.M | re.S)) + assert m + return _newlinify(text, m) + + +def process_black_hole_solver_h(text): + """docstring for process_black_hole_solver_h""" + pre, suf = _remove( + text, + "^// Added.*?DLLEXPORT extern unsigned " + + "long black_hole_solver_get_max_num_played_cards\\(.*?(?:\\n){2,2}" + ) + return pre + suf + + +def _clear_all_individual_lines(text, pat): + """docstring for _clear_all_individual_lines""" + return re.sub( + '^[^\\n]*?(?:'+pat+')[^\\n]*?$', '', text, flags=(re.M | re.S) + ) + + +def process_lib_c(text): + """docstring for process_lib_c""" + pre, text = _remove( + text, "^ *var_AUTO\\(\\s*max_reached_depths_stack_len.*?\\);$") + pre2, text = _remove( + text, "^ *while \\(current_depths_stack_len.*?^ *\\}$") + pre3, text = _remove( + text, "^( *)if \\(was_moved\\).*?^\\1\\}$") + pre4, text = _remove( + text, "^DLLEXPORT extern[^\n]+\n" + + "black_hole_solver_get_max_num_played_cards.*?^\\}") + text = pre + pre2 + pre3 + pre4 + text + return _clear_all_individual_lines( + text, "(?:depths_stack|max_num_played|prev_len|was_moved)" + ) + + +def process_solver_common_h(text): + """docstring for process_black_hole_solver_h""" + pre, text = _remove( + text, "^ *else if \\(unlikely\\(" + + "\n[^\\n]*\"--show-max-num-played-cards\".*?^ *\\}$") + pre2, text = _remove( + text, "^ *if \\(unlikely\\(settings\\." + + "show_max_num_played_cards.*?^ *\\}$") + text = pre + pre2 + text + return _clear_all_individual_lines(text, "max_num_played") + + +def wrapper(basename, cb): + src_fn = Path(sys.argv[0]).parent.parent / basename + dest_fn = Path(".") / "generated" / basename + + p = dest_fn.parent + if not p.exists(): + p.mkdir(parents=True) + with open(dest_fn, "wt") as ofh: + with open(src_fn, "rt") as ifh: + text = ifh.read() + ofh.write(cb(text) if should_process else text) + + +wrapper( + "include/black-hole-solver/black_hole_solver.h", + process_black_hole_solver_h +) + +wrapper( + "solver_common.h", + process_solver_common_h +) + +wrapper( + "lib.c", + process_lib_c +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/single_board_main.c new/black-hole-solver-1.10.1/single_board_main.c --- old/black-hole-solver-1.8.0/single_board_main.c 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/single_board_main.c 2020-10-27 14:32:44.000000000 +0100 @@ -2,7 +2,7 @@ // Copyright (C) 2018 Shlomi Fish <shlo...@cpan.org> // // Distributed under terms of the Expat license. -#include "solver_common.h" +#include <solver_common.h> int main(int argc, char *argv[]) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/solver_common.h new/black-hole-solver-1.10.1/solver_common.h --- old/black-hole-solver-1.8.0/solver_common.h 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/solver_common.h 2020-10-27 14:32:44.000000000 +0100 @@ -73,6 +73,7 @@ bool place_queens_on_kings; bool quiet_output; bool wrap_ranks; + bool show_max_num_played_cards; } bhs_settings; #pragma clang diagnostic pop @@ -89,6 +90,7 @@ settings.quiet_output = false; settings.wrap_ranks = true; settings.max_iters_limit = ULONG_MAX; + settings.show_max_num_played_cards = false; int arg_idx = 1; while (argc > arg_idx) @@ -197,6 +199,12 @@ } settings.iters_display_step = (unsigned long)atol(argv[arg_idx++]); } + else if (unlikely( + !strcmp(argv[arg_idx], "--show-max-num-played-cards"))) + { + ++arg_idx; + settings.show_max_num_played_cards = true; + } else { break; @@ -255,17 +263,15 @@ int error_line_num; const enum GAME_TYPE game_type = settings.game_type; const unsigned num_columns = - ((game_type == GAME__BH) - ? BHS__BLACK_HOLE__NUM_COLUMNS - : (game_type == GAME__GOLF) ? BHS__GOLF__NUM_COLUMNS - : BHS__ALL_IN_A_ROW__NUM_COLUMNS); + ((game_type == GAME__BH) ? BHS__BLACK_HOLE__NUM_COLUMNS + : (game_type == GAME__GOLF) ? BHS__GOLF__NUM_COLUMNS + : BHS__ALL_IN_A_ROW__NUM_COLUMNS); if (black_hole_solver_read_board(solver, board, &error_line_num, num_columns, - ((game_type == GAME__BH) - ? BHS__BLACK_HOLE__MAX_NUM_CARDS_IN_COL - : (game_type == GAME__GOLF) - ? BHS__GOLF__MAX_NUM_CARDS_IN_COL - : BHS__ALL_IN_A_ROW__MAX_NUM_CARDS_IN_COL), + ((game_type == GAME__BH) ? BHS__BLACK_HOLE__MAX_NUM_CARDS_IN_COL + : (game_type == GAME__GOLF) + ? BHS__GOLF__MAX_NUM_CARDS_IN_COL + : BHS__ALL_IN_A_ROW__MAX_NUM_CARDS_IN_COL), ((game_type == GAME__BH) ? BHS__BLACK_HOLE__BITS_PER_COL : BHS__GOLF__BITS_PER_COL))) { @@ -349,6 +355,11 @@ "This scan generated %lu states.\n", black_hole_solver_get_iterations_num(solver), black_hole_solver_get_num_states_in_collection(solver)); + if (unlikely(settings.show_max_num_played_cards)) + { + fprintf(out_fh, "At most %lu cards could be played.\n", + black_hole_solver_get_max_num_played_cards(solver)); + } black_hole_solver_recycle(solver); return ret; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/t/all-in-a-row-output.t new/black-hole-solver-1.10.1/t/all-in-a-row-output.t --- old/black-hole-solver-1.8.0/t/all-in-a-row-output.t 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/t/all-in-a-row-output.t 2020-10-25 07:22:05.000000000 +0100 @@ -12,6 +12,13 @@ my $data_dir = $bin_dir->child('data'); my $texts_dir = $data_dir->child('texts'); +my $exit_code; + +sub mysys +{ + return $exit_code = system(@_); +} + use Dir::Manifest (); use Dir::Manifest::Slurp qw/ as_lf /; my $mani = Dir::Manifest->new( @@ -25,13 +32,13 @@ { trap { - system( './black-hole-solve', '--game', 'all_in_a_row', + mysys( './black-hole-solve', '--game', 'all_in_a_row', $data_dir->child('24.all_in_a_row.board.txt'), ); }; # TEST - ok( !( $trap->exit ), "Running the program successfully for board #24." ); + ok( !($exit_code), "Running the program successfully for board #24." ); # TEST eq_or_diff( @@ -44,13 +51,13 @@ { trap { - system( './black-hole-solve', '--game', 'all_in_a_row', + mysys( './black-hole-solve', '--game', 'all_in_a_row', '--display-boards', $data_dir->child('24.all_in_a_row.board.txt'), ); }; # TEST - ok( !( $trap->exit ), "Exit code for --display-boards for board #24." ); + ok( !($exit_code), "Exit code for --display-boards for board #24." ); my $expected_prefix = as_lf(<<'EOF'); Solved! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/t/black-hole-output.t new/black-hole-solver-1.10.1/t/black-hole-output.t --- old/black-hole-solver-1.8.0/t/black-hole-output.t 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/t/black-hole-output.t 2020-10-27 16:23:10.000000000 +0100 @@ -3,8 +3,9 @@ use strict; use warnings; -use Test::More tests => 22; +use Test::More tests => 24; use Test::Differences qw/ eq_or_diff /; +use Test::Some; use Test::Trap qw( trap $trap :flow:stderr(systemsafe):stdout(systemsafe):warn @@ -16,14 +17,21 @@ my $data_dir = $bin_dir->child('data'); my $texts_dir = $data_dir->child('texts'); +my $exit_code; + +sub mysys +{ + return $exit_code = system(@_); +} + trap { - system( './black-hole-solve', '--game', 'black_hole', + mysys( './black-hole-solve', '--game', 'black_hole', $data_dir->child("26464608654870335080.bh.board.txt") ); }; # TEST -ok( !( $trap->exit ), "Running the program successfully." ); +ok( !($exit_code), "Running the program successfully." ); use Dir::Manifest (); use Dir::Manifest::Slurp qw/ as_lf /; @@ -43,7 +51,7 @@ trap { - system( './black-hole-solve', '--game', 'black_hole', + mysys( './black-hole-solve', '--game', 'black_hole', $data_dir->child("1.bh.board.txt") ); }; @@ -62,12 +70,12 @@ trap { - system( './black-hole-solve', '--game', 'black_hole', "--max-iters", + mysys( './black-hole-solve', '--game', 'black_hole', "--max-iters", "10000", $data_dir->child("26464608654870335080.bh.board.txt") ); }; # TEST -ok( !( $trap->exit ), "Running --max-iters program successfully." ); +ok( scalar( !$exit_code ), "Running --max-iters program successfully." ); # TEST eq_or_diff( @@ -78,7 +86,7 @@ trap { - system( './black-hole-solve', '--game', 'black_hole', + mysys( './black-hole-solve', '--game', 'black_hole', $data_dir->child("1.bh.board.txt") ); }; @@ -98,14 +106,13 @@ "Right output for --max-iters." ); -my $ret_code; trap { - $ret_code = system( './black-hole-solve', '--version' ); + mysys( './black-hole-solve', '--version' ); }; # TEST -is( $ret_code, 0, "Exited successfully." ); +is( $exit_code, 0, "Exited successfully." ); # TEST like( @@ -116,13 +123,13 @@ trap { - system( './black-hole-solve', '--game', 'black_hole', + mysys( './black-hole-solve', '--game', 'black_hole', '--iters-display-step', '1000', $data_dir->child("26464608654870335080.bh.board.txt") ); }; # TEST -ok( !( $trap->exit ), "iters-display-step: running the program successfully." ); +ok( !($exit_code), "iters-display-step: running the program successfully." ); # TEST eq_or_diff( @@ -137,13 +144,13 @@ trap { - system( $exe, '--game', 'black_hole', '--iters-display-step', '1100', + mysys( $exe, '--game', 'black_hole', '--iters-display-step', '1100', $data_dir->child("26464608654870335080.bh.board.txt"), ); }; # TEST*$c - ok( !( $trap->exit ), + ok( !($exit_code), "iters-display-step second step: running the program successfully." ); # TEST*$c @@ -161,14 +168,13 @@ { trap { - system( './black-hole-solve', '--game', 'black_hole', - '--display-boards', + mysys( './black-hole-solve', '--game', 'black_hole', '--display-boards', $data_dir->child('26464608654870335080.bh.board.txt'), ); }; # TEST - ok( !( $trap->exit ), + ok( !($exit_code), "Exit code for --display-boards for board #26464608654870335080." ); my $expected_prefix = @@ -198,15 +204,14 @@ { trap { - system( './black-hole-solve', '--game', 'golf', + mysys( './black-hole-solve', '--game', 'golf', '--display-boards', '--wrap-ranks', $data_dir->child('906.golf.board.txt'), ); }; # TEST - ok( !( $trap->exit ), - "Exit code for --display-boards for golf board #906." ); + ok( !($exit_code), "Exit code for --display-boards for golf board #906." ); my @cards = qq/6D KC KS AH AC KD 4S 8D 8H JD TC AD QH 4C JS 2C/ =~ /(\S\S)/g; @@ -231,13 +236,13 @@ { trap { - system( './black-hole-solve', '--game', 'golf', '--rank-reach-prune', + mysys( './black-hole-solve', '--game', 'golf', '--rank-reach-prune', $data_dir->child('2.golf.board.txt'), ); }; # TEST - ok( !( $trap->exit ), "Exit code for for golf board #2." ); + ok( !($exit_code), "Exit code for for golf board #2." ); my $stdout = as_lf( $trap->stdout() ); $stdout =~ s/--------------------\n\K(?:[^\n]+\n){2}\z//ms; @@ -254,7 +259,7 @@ my $out_fn = "golf1to20out.txt"; trap { - system( + mysys( './multi-bhs-solver', '--output', $out_fn, @@ -262,13 +267,12 @@ 'golf', '--display-boards', '--wrap-ranks', - ( map { $mani->get_obj("golf$_.board")->fh } 1 .. 20 ) + ( map { $mani->fh("golf$_.board") } 1 .. 20 ) ); }; # TEST - ok( !( $trap->exit ), - "Exit code for --display-boards for golf board #906." ); + ok( !($exit_code), "Exit code for --display-boards for golf board #906." ); my $stdout = as_lf( path($out_fn)->slurp_raw ); $stdout =~ @@ -281,3 +285,142 @@ "recycling works", ); } + +my $MAX_NUM_PLAYED_CARDS_RE = + qr/\AAt most ([0-9]+) cards could be played\.\n?\z/ms; + +sub _test_max_num_played_cards +{ + my ($args) = @_; + my ( $name, $want, $input_text ) = + @{$args}{qw/ name expected_num input_text/}; + local $Test::Builder::Level = $Test::Builder::Level + 1; + return subtest $name => sub { + plan tests => 2; + my @matches = ( + grep { /$MAX_NUM_PLAYED_CARDS_RE/ } + map { as_lf($_) } split( /^/ms, $input_text ), + ); + + is( scalar(@matches), 1, "One line." ); + + eq_or_diff( + [ + map { + /$MAX_NUM_PLAYED_CARDS_RE/ + ? ($1) + : ( die "not matched!" ) + } @matches + ], + [$want], + "num cards moved.", + ); + }; +} +my $no_moves_deal = $mani->fh("black_hole_27.board"); + +# TEST +unlike( + $no_moves_deal->slurp_raw(), + qr#[2K][CDHS]$#ms, "No legal moves in deal black_hole_27", +); + +# TEST +subtest 'max_num_played' => sub { + plan tests => 10; + trap + { + mysys( './black-hole-solve', '--game', 'black_hole', + '--show-max-num-played-cards', $data_dir->child("1.bh.board.txt") ); + }; + + ok( $exit_code, "Non-zero exit status on unsolved." ); + + $expected_output = <<'EOF'; +Unsolved! + + +-------------------- +Total number of states checked is 8. +This scan generated 8 states. +At most 3 cards could be played. +EOF + + eq_or_diff( + as_lf( $trap->stdout() ), + as_lf($expected_output), + "Right output." + ); + + trap + { + mysys( './black-hole-solve', '--game', 'black_hole', "--max-iters", + "10000", $data_dir->child("26464608654870335080.bh.board.txt") ); + }; + + ok( scalar( !$exit_code ), "Running --max-iters program successfully." ); + + eq_or_diff( + as_lf( $trap->stdout() ), + $mani->text( "26464608654870335080.bh.sol.txt", { lf => 1 } ), + "Right output." + ); + + trap + { + mysys( './black-hole-solve', '--game', 'black_hole', + "--show-max-num-played-cards", + $data_dir->child("26464608654870335080.bh.board.txt") ); + }; + + ok( scalar( !$exit_code ), + "Running --show-max-num-played-cards program successfully." ); + + _test_max_num_played_cards( + { + name => "success moves", + expected_num => 51, + input_text => scalar( $trap->stdout() ), + }, + ); + + trap + { + mysys( './black-hole-solve', '--game', 'all_in_a_row', + "--show-max-num-played-cards", + $data_dir->child('24.all_in_a_row.board.txt'), + ); + }; + + ok( + scalar( !$exit_code ), + "Running all_in_a_row --show-max-num-played-cards program successfully." + ); + + _test_max_num_played_cards( + { + name => "all_in_a_row success moves", + expected_num => 52, + input_text => scalar( $trap->stdout() ), + }, + ); + + trap + { + mysys( './black-hole-solve', '--game', 'black_hole', + "--show-max-num-played-cards", $no_moves_deal, ); + }; + + ok( scalar($exit_code), +"Running no-moves-possible --show-max-num-played-cards program exited with an error." + ); + + _test_max_num_played_cards( + { + name => "black_hole deal #27 - 0 moves", + expected_num => 0, + input_text => scalar( $trap->stdout() ), + }, + ); + }, + '!no_max_num_played'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/t/build-process.t new/black-hole-solver-1.10.1/t/build-process.t --- old/black-hole-solver-1.8.0/t/build-process.t 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/t/build-process.t 2020-10-28 12:17:43.000000000 +0100 @@ -85,13 +85,11 @@ my $orig_cwd = cwd; - chdir($base); - mkdir("build"); chdir("build"); # TEST - test_cmd( [ "cmake", ".." ], "CMaking in the unpacked dir" ); + test_cmd( [ "cmake", "../${base}" ], "CMaking in the unpacked dir" ); # TEST test_cmd( [ "make", "package_source" ] ); @@ -99,7 +97,7 @@ # local $ENV{WML_TEST_QUIET} = 1; # TEST - test_cmd( [ $^X, "../run-tests.pl" ] ); + test_cmd( [ $^X, "../${base}/run-tests.pl" ] ); # For cleanup of the temp_dir. chdir($before_temp_cwd); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/t/data/texts/list.txt new/black-hole-solver-1.10.1/t/data/texts/list.txt --- old/black-hole-solver-1.8.0/t/data/texts/list.txt 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/t/data/texts/list.txt 2020-10-27 14:32:44.000000000 +0100 @@ -7,6 +7,7 @@ 26464608654870335080.bh-sol-with-display-boards.txt 26464608654870335080.bh.sol.txt 906.golf.solution.txt +black_hole_27.board golf-1to20.sol.txt golf1.board golf10.board diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/t/data/texts/texts/black_hole_27.board new/black-hole-solver-1.10.1/t/data/texts/texts/black_hole_27.board --- old/black-hole-solver-1.8.0/t/data/texts/texts/black_hole_27.board 1970-01-01 01:00:00.000000000 +0100 +++ new/black-hole-solver-1.10.1/t/data/texts/texts/black_hole_27.board 2020-10-27 14:32:44.000000000 +0100 @@ -0,0 +1,18 @@ +Foundations: AS +6H 3S 5H +2D 2H 5D +AC 8D JS +2S TD 6D +2C KS JH +3H 8H QD +AD JC 4H +6C 9D TS +KC QH JD +8S KD TC +4C 4S 9S +5C QC 5S +8C KH TH +7S 3D 6S +9H 7D 3C +7H QS 7C +AH 4D 9C diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/t/lib/BHsolver/InlineWrap.pm new/black-hole-solver-1.10.1/t/lib/BHsolver/InlineWrap.pm --- old/black-hole-solver-1.8.0/t/lib/BHsolver/InlineWrap.pm 2020-06-25 18:10:07.000000000 +0200 +++ new/black-hole-solver-1.10.1/t/lib/BHsolver/InlineWrap.pm 2020-09-30 08:45:38.000000000 +0200 @@ -34,7 +34,7 @@ C => $src, name => $pkg, NAME => $pkg, - INC => + INC => "-I$ENV{FCS_BIN_PATH}/include -I$ENV{FCS_SRC_PATH}/rinutils/rinutils/include -I$ENV{FCS_SRC_PATH}/include -I$ENV{FCS_BIN_PATH} -I$ENV{FCS_SRC_PATH} $RINUTILS_INCLUDE_DIR", CCFLAGS => $ccflags, CLEAN_AFTER_BUILD => 0, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/t/lib/Games/Solitaire/BlackHole/RankReachPrune/XS.pm new/black-hole-solver-1.10.1/t/lib/Games/Solitaire/BlackHole/RankReachPrune/XS.pm --- old/black-hole-solver-1.8.0/t/lib/Games/Solitaire/BlackHole/RankReachPrune/XS.pm 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/t/lib/Games/Solitaire/BlackHole/RankReachPrune/XS.pm 2020-09-30 08:45:38.000000000 +0200 @@ -28,7 +28,7 @@ EOF CLEAN_AFTER_BUILD => 0, - INC => + INC => "-I$ENV{FCS_BIN_PATH} -I$ENV{FCS_SRC_PATH} -I$ENV{FCS_SRC_PATH}/include", LIBS => "-L" . $ENV{FCS_BIN_PATH} . " -lbhs_rank_reach_prune", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/t/rank-reachability-prune.t new/black-hole-solver-1.10.1/t/rank-reachability-prune.t --- old/black-hole-solver-1.8.0/t/rank-reachability-prune.t 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/t/rank-reachability-prune.t 2020-08-29 14:08:03.000000000 +0200 @@ -2,19 +2,20 @@ use strict; use warnings; +use autodie; use Test::More tests => 120; use lib './t/lib'; -use Games::Solitaire::BlackHole::RankReachPrune::PP; -use Games::Solitaire::BlackHole::RankReachPrune::XS; +use Games::Solitaire::BlackHole::RankReachPrune::PP (); +use Games::Solitaire::BlackHole::RankReachPrune::XS (); my $SUCCESS = $Games::Solitaire::BlackHole::RankReachPrune::PP::SUCCESS; my $NOT_REACHABLE = $Games::Solitaire::BlackHole::RankReachPrune::PP::NOT_REACHABLE; -# TEST:$b=2; +# TEST:$num_backends=2; my @backend_specs = ( { id => "perl", @@ -74,84 +75,85 @@ } }; - # TEST:$c=0; + # TEST:FILTER(MULT($num_backends)) foreach my $backend_var (@backend_specs) { $backend = $backend_var; - # TEST:$c++; + # TEST $test->( - 8, [ 2, 3, 2, 1, 1, 2, 2, 1, 0, 0, 1, 2, 2 ], + 8, [ 2, 3, 2, 1, 1, 2, 2, 1, 0, 0, 1, 2, 2 ], 'SUCCESS', "Failure in C backend No. 1", ); - # TEST:$c++; + # TEST $test->( - -1, [ (1) x 13 ], + -1, [ (1) x 13 ], 'SUCCESS', "Always true on foundation of -1." ); - # TEST:$c++; + # TEST $test->( 0, [ (1) x 13 ], 'SUCCESS', "All is all-ranks-reachable." ); - # TEST:$c++; + # TEST $test->( - 0, [ ( (1) x 10 ), ( (0) x 3 ) ], + 0, [ ( (1) x 10 ), ( (0) x 3 ) ], 'SUCCESS', "First 10 ranks", ); - # TEST:$c++; + # TEST $test->( - 0, [ ( (1) x 10 ), 0, 1, 0 ], + 0, [ ( (1) x 10 ), 0, 1, 0 ], 'NOT_REACHABLE', "Unreachable island.", ); - # TEST:$c++; + # TEST $test->( - 4, [ 0, 0, 0, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, ], + 4, [ 0, 0, 0, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, ], 'SUCCESS', "two reachable segment", ); - # TEST:$c++; + # TEST $test->( - 2, [ 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, ], + 2, [ 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, ], 'SUCCESS', "two reachable segment", ); - # TEST:$c++; + # TEST $test->( - 2, [ 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, ], + 2, [ 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, ], 'NOT_REACHABLE', "One island.", ); - # TEST:$c=$c+$unr; + # TEST:FILTER(MULT($unr)) + # TEST $test_unreachable_for_all->( [ 0, 0, 0, 2, 1, 0, 0, 1, 0, 1, 0, 0, 0, ], "Two islands.", ); - # TEST:$c=$c+$unr; + # TEST $test_unreachable_for_all->( [ 3, 0, 0, 2, 1, 0, 0, 1, 0, 1, 0, 0, 0, ], "Three islands", ); - # TEST:$c=$c+$unr; + # TEST $test_unreachable_for_all->( [ 3, 0, 0, 2, 1, 0, 0, 1, 0, 1, 0, 0, 0, ], "Three islands", ); - # TEST:$c=$c+$unr; + # TEST $test_unreachable_for_all->( [ 0, 1, 1, 1, 0, 0, 0, 0, 2, 2, 0, 0, 0, ], "Two separated islands.", ); - } + # TEST:ENDFILTER() - # TEST:$per_backend_tests=$c; + } - # TEST*$per_backend_tests*$b + # TEST:ENDFILTER() } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/t/style-trailing-space.t new/black-hole-solver-1.10.1/t/style-trailing-space.t --- old/black-hole-solver-1.8.0/t/style-trailing-space.t 2019-12-27 16:06:01.000000000 +0100 +++ new/black-hole-solver-1.10.1/t/style-trailing-space.t 2020-10-28 12:20:00.000000000 +0100 @@ -10,10 +10,10 @@ { my $finder = Test::TrailingSpace->new( { - root => $path, - filename_regex => qr/./, + root => $path, + filename_regex => qr/./, abs_path_prune_re => -qr#CMakeFiles|(?:CTestTestfile\.cmake\z)|_Inline|lib(?:black_hole_solver|bhs_rank_reach_prune)(?:\.a|\.so)|(?:.*\.tar\.[a-zA-Z0-9_]+)|(?:multi-bhs-solver\z)|(?:black-hole-solve\z)|(?:black-hole-solve-resume-api\z)|(?:\.(?:dll|exe|patch|xcf)\z)#, +qr#CMakeFiles|(?:CTestTestfile\.cmake\z)|_Inline|lib(?:black_hole_solver|bhs_rank_reach_prune)(?:\.a|\.so)|(?:.*\.tar\.[a-zA-Z0-9_]+)|(?:multi-bhs-solver\z)|(?:black-hole-solve\z)|(?:black-hole-solve-resume-api\z)|(?:\.(?:dll|exe|patch|xcf)\z)|(?:valgrind\.log\z)#, } ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/black-hole-solver-1.8.0/ver.txt new/black-hole-solver-1.10.1/ver.txt --- old/black-hole-solver-1.8.0/ver.txt 2020-06-27 22:00:03.000000000 +0200 +++ new/black-hole-solver-1.10.1/ver.txt 2020-10-28 12:53:18.000000000 +0100 @@ -1 +1 @@ -1.8.0 +1.10.1 ++++++ fix-pkgconfig-libdir.patch ++++++ diff -Nur black-hole-solver-1.10.1/libblack-hole-solver.pc.in black-new/libblack-hole-solver.pc.in --- black-hole-solver-1.10.1/libblack-hole-solver.pc.in 2019-12-27 16:06:01.000000000 +0100 +++ black-new/libblack-hole-solver.pc.in 2021-04-29 13:52:47.298340002 +0200 @@ -1,6 +1,6 @@ prefix="@CMAKE_INSTALL_PREFIX@" exec_prefix=${prefix} -libdir=${exec_prefix}/lib +libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ includedir=${prefix}/include Name: Black Hole Solitaire Solver