unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob d86126c6576d3556f1da6ffd8ea061a4bd3f42ea 3224 bytes (raw)
name: gnu/packages/patches/lief-unbundle-test-dependencies.patch 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
 
From 0e0f105e984eeac51147b5fd87cf95668e8fa235 Mon Sep 17 00:00:00 2001
From: Hilton Chain <hako@ultrarare.space>
Date: Fri, 4 Aug 2023 10:57:32 +0800
Subject: [PATCH] Use system Catch2 and Melkor.

---
 tests/CMakeLists.txt     | 47 ++++------------------------------------
 tests/test_iterators.cpp |  2 +-
 2 files changed, 5 insertions(+), 44 deletions(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 1d34b711..cf79ab74 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -8,23 +8,6 @@ set(LIEF_EXAMPLES_DIRECTORY  "${PROJECT_SOURCE_DIR}/examples")
 set(LIEF_EXAMPLES_BINARY_DIR "${PROJECT_BINARY_DIR}/examples")
 
 
-# Catch
-# =====
-set(CATCH_VERSION 2.13.8)
-set(CATCH_SHA256 SHA256=532f163e4f2db66dae33f1d0a279e8d9befec8bc6cca60d7b82155f7d06bd89c)
-set(CATCH_URL "${THIRD_PARTY_DIRECTORY}/Catch2-${CATCH_VERSION}.zip" CACHE STRING "URL to the Catch repo")
-
-ExternalProject_Add(catch
-    PREFIX         ${CATCH_PREFIX}
-    URL            ${CATCH_URL}
-    URL_HASH       ${CATCH_SHA256}
-    CONFIGURE_COMMAND ""
-    BUILD_COMMAND ""
-    INSTALL_COMMAND ""
-)
-ExternalProject_Get_Property(catch source_dir)
-set(CATCH_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "Path to include folder for Catch")
-
 # Code covergage
 # ==============
 if(LIEF_COVERAGE)
@@ -58,31 +41,6 @@ if(LIEF_COVERAGE)
 endif()
 
 
-# Fuzzing
-# =======
-if(UNIX AND NOT APPLE)
-  set(MELKOR_VERSION ac2495b) # From the fork: https://github.com/romainthomas/elf_fuzzer
-  set(MELKOR_SHA256 SHA256=8cccc4ca5e05e305215cc74761413746b660b76f5869a563f52cec1f23d79f2e)
-  set(MELKOR_URL "${THIRD_PARTY_DIRECTORY}/Melkor_ELF_Fuzzer-${MELKOR_VERSION}.zip" CACHE STRING "URL to the Melkor package")
-
-  set(MELKOR_PREFIX      "${CMAKE_CURRENT_BINARY_DIR}/Melkor")
-  set(MELKOR_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/Melkor")
-  ExternalProject_Add(MELKOR
-   PREFIX            ${MELKOR_PREFIX}
-   URL               ${MELKOR_URL}
-   URL_HASH          ${MELKOR_SHA256}
-   INSTALL_DIR       ${MELKOR_INSTALL_DIR}
-   UPDATE_COMMAND    ""
-   CONFIGURE_COMMAND ""
-   INSTALL_COMMAND   ""
-   BUILD_COMMAND     make clean && make
-   BUILD_IN_SOURCE   ON)
-
-  ExternalProject_get_property(MELKOR SOURCE_DIR)
-  set(MELKOR_BINARY "${SOURCE_DIR}/melkor")
-  message(STATUS "${MELKOR_BINARY}")
-endif()
-
 # Tests
 # =====
 add_executable(test_iterators "${CMAKE_CURRENT_SOURCE_DIR}/test_iterators.cpp")
@@ -100,10 +58,13 @@ if (LIEF_COVERAGE)
   target_link_libraries(test_iterators gcov)
 endif()
 
-add_dependencies(test_iterators catch LIB_LIEF)
+find_package(Catch2 REQUIRED)
+add_dependencies(test_iterators Catch2::Catch2 LIB_LIEF)
 
 target_link_libraries(test_iterators LIB_LIEF)
 
+find_program(MELKOR_FOUND melkor REQUIRED)
+
 add_test(test_iterators
          ${CMAKE_CURRENT_BINARY_DIR}/test_iterators)
 
diff --git a/tests/test_iterators.cpp b/tests/test_iterators.cpp
index 2d837371..df3d2ed5 100644
--- a/tests/test_iterators.cpp
+++ b/tests/test_iterators.cpp
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 #define CATCH_CONFIG_MAIN
-#include <catch.hpp>
+#include <catch2/catch.hpp>
 
 #include <LIEF/iterators.hpp>
 

base-commit: 2d9855fc7f9d4ce6325245f8b75c98eb7663db60
-- 
2.41.0


debug log:

solving d86126c657 ...
found d86126c657 in https://yhetil.org/guix-patches/fdf38ec0bb77e09b930ae88e1b6ea74680c3c387.1691240736.git.hako@ultrarare.space/

applying [1/1] https://yhetil.org/guix-patches/fdf38ec0bb77e09b930ae88e1b6ea74680c3c387.1691240736.git.hako@ultrarare.space/
diff --git a/gnu/packages/patches/lief-unbundle-test-dependencies.patch b/gnu/packages/patches/lief-unbundle-test-dependencies.patch
new file mode 100644
index 0000000000..d86126c657

1:23: trailing whitespace.
 
1:24: trailing whitespace.
 
1:47: trailing whitespace.
 
1:48: trailing whitespace.
 
1:80: trailing whitespace.
 
Checking patch gnu/packages/patches/lief-unbundle-test-dependencies.patch...
Applied patch gnu/packages/patches/lief-unbundle-test-dependencies.patch cleanly.
warning: squelched 7 whitespace errors
warning: 12 lines add whitespace errors.

index at:
100644 d86126c6576d3556f1da6ffd8ea061a4bd3f42ea	gnu/packages/patches/lief-unbundle-test-dependencies.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).