Use shared gtest instead of submodule diff --git a/CMakeLists.txt b/CMakeLists.txt index 617e4b2..2857875 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") include(GNUInstallDirs) project(leelaz) -add_subdirectory(gtest EXCLUDE_FROM_ALL) # We don't want to install gtest, exclude it from `all` # Required Packages set(Boost_MIN_VERSION "1.58.0") @@ -27,6 +26,7 @@ find_package(Boost 1.58.0 REQUIRED program_options filesystem) find_package(Threads REQUIRED) find_package(ZLIB REQUIRED) find_package(OpenCL REQUIRED) +find_package(GTest REQUIRED) # We need OpenBLAS for now, because we make some specific # calls. Ideally we'd use OpenBLAS is possible and fall back to # not doing those calls if it's not present. @@ -93,6 +93,7 @@ include_directories(${IncludePath}) include_directories(${Boost_INCLUDE_DIRS}) include_directories(${OpenCL_INCLUDE_DIRS}) include_directories(${ZLIB_INCLUDE_DIRS}) +include_directories(${GTEST_INCLUDE_DIRS}) if((UNIX AND NOT APPLE) OR WIN32) include_directories(${BLAS_INCLUDE_DIRS}) @@ -141,7 +142,8 @@ target_link_libraries(tests ${Boost_LIBRARIES}) target_link_libraries(tests ${BLAS_LIBRARIES}) target_link_libraries(tests ${OpenCL_LIBRARIES}) target_link_libraries(tests ${ZLIB_LIBRARIES}) -target_link_libraries(tests gtest_main ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(tests ${GTEST_BOTH_LIBRARIES}) +target_link_libraries(tests ${CMAKE_THREAD_LIBS_INIT}) include(GetGitRevisionDescription) git_describe(VERSION --tags) ='752a5b8fe5c949627b7f68a2780549ba13276403'/>
path: root/tests/nar.scm
AgeCommit message (Expand)Author
2021-11-16daemon: Do not deduplicate files smaller than 8 KiB....Files smaller than 8 KiB typically represent ~70% of the entries in /gnu/store/.links but only contribute to ~4% of the space savings afforded by deduplication. Not considering these files for deduplication speeds up file insertion in the store and, more importantly, leaves 'removeUnusedLinks' with fewer entries to traverse, thereby speeding it up proportionally. Partly fixes <https://issues.guix.gnu.org/24937>. * config-daemon.ac: Remove symlink hard link check and CAN_LINK_SYMLINK definition. * guix/store/deduplication.scm (%deduplication-minimum-size): New variable. (deduplicate)[loop]: Do not recurse when FILE's size is below %DEDUPLICATION-MINIMUM-SIZE. (dump-port): New procedure. (dump-file/deduplicate)[hash]: Turn into... [dump-and-compute-hash]: ... this thunk. Call 'deduplicate' only when SIZE is greater than %DEDUPLICATION-MINIMUM-SIZE; otherwise call 'dump-port'. * nix/libstore/gc.cc (LocalStore::removeUnusedLinks): Drop files where st.st_size < deduplicationMinSize. * nix/libstore/local-store.hh (deduplicationMinSize): New declaration. * nix/libstore/optimise-store.cc (deduplicationMinSize): New variable. (LocalStore::optimisePath_): Return when PATH is a symlink or smaller than 'deduplicationMinSize'. * tests/derivations.scm ("identical files are deduplicated"): Produce files bigger than %DEDUPLICATION-MINIMUM-SIZE. * tests/nar.scm ("restore-file-set with directories (signed, valid)"): Likewise. * tests/store-deduplication.scm ("deduplicate, below %deduplication-minimum-size"): New test. ("deduplicate", "deduplicate, ENOSPC"): Produce files bigger than %DEDUPLICATION-MINIMUM-SIZE. * tests/store.scm ("substitute, deduplication"): Likewise. Ludovic Courtès
2020-12-15nar: Deduplicate files right as they are restored....This avoids having to traverse and re-read the files that we have just restored, thereby reducing I/O. * guix/serialization.scm (dump-file): New procedure. (restore-file): Add #:dump-file parameter and honor it. * guix/store/deduplication.scm (tee, dump-file/deduplicate): New procedures. * guix/nar.scm (restore-one-item): Pass #:dump-file to 'restore-file'. (finalize-store-file): Pass #:deduplicate? #f to 'register-items'. * tests/nar.scm <top level>: Call 'setenv' to set "NIX_STORE". Ludovic Courtès
2020-12-15serialization: 'restore-file' sets canonical timestamp and permissions....* guix/serialization.scm (restore-file): Set the permissions and mtime of FILE. * guix/nar.scm (finalize-store-file): Pass #:reset-timestamps? #f to 'register-items'. * tests/nar.scm (rm-rf): Add 'chmod' calls to ensure files are writable. ("write-file + restore-file with symlinks"): Ensure every file in OUTPUT passes 'canonical-file?'. * tests/guix-archive.sh: Run "chmod -R +w" before "rm -rf". Ludovic Courtès
2020-12-15serialization: 'fold-archive' notifies about directory processing completion....* guix/serialization.scm (fold-archive): Call PROC with a 'directory-complete tag when done with a directory. (restore-file): Handle it. * guix/scripts/archive.scm (list-contents): Likewise. * guix/scripts/challenge.scm (archive-contents): Likewise. * tests/nar.scm ("write-file-tree + fold-archive"): Adjust accordingly. Ludovic Courtès