summaryrefslogtreecommitdiff
path: root/dev-cpp/catch/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-04-28 20:02:04 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-04-28 20:02:04 +0100
commita4e2a46beb5e4858ef27bdedbb0ff6d2ced430ad (patch)
tree852c90a4bf354c30ea66504f70bfab5401fba18d /dev-cpp/catch/files
parent5e8702bcbbed438e6c6cce023e7ef0cc9baa3e02 (diff)
gentoo resync : 28.04.2018
Diffstat (limited to 'dev-cpp/catch/files')
-rw-r--r--dev-cpp/catch/files/catch-2.2.0-fix-pkg-config.patch22
-rw-r--r--dev-cpp/catch/files/catch-2.2.2-python-automagic.patch25
-rw-r--r--dev-cpp/catch/files/catch-2.2.2-test-python3.patch44
3 files changed, 69 insertions, 22 deletions
diff --git a/dev-cpp/catch/files/catch-2.2.0-fix-pkg-config.patch b/dev-cpp/catch/files/catch-2.2.0-fix-pkg-config.patch
deleted file mode 100644
index 1c1463921b2b..000000000000
--- a/dev-cpp/catch/files/catch-2.2.0-fix-pkg-config.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From c778848b09df073b9f84f22622ea7a632642c4a5 Mon Sep 17 00:00:00 2001
-From: David Seifert <soap@gentoo.org>
-Date: Tue, 30 Jan 2018 11:13:53 +0100
-Subject: [PATCH] Fix pkg-config
-
-* All uses of Catch involve #include'ing it without
- a prefixed folder, such as `#include "catch.hpp"`.
- This requires fixing the pkg-config file.
----
- catch.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/catch.pc.in b/catch.pc.in
-index abd0b66b1..4f48bc7fb 100644
---- a/catch.pc.in
-+++ b/catch.pc.in
-@@ -3,4 +3,4 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
- Name: Catch
- Description: Testing library for C++
- Version: @Catch2_VERSION@
--Cflags: -I${includedir}
-+Cflags: -I${includedir}/catch
diff --git a/dev-cpp/catch/files/catch-2.2.2-python-automagic.patch b/dev-cpp/catch/files/catch-2.2.2-python-automagic.patch
new file mode 100644
index 000000000000..ecc99905d7f0
--- /dev/null
+++ b/dev-cpp/catch/files/catch-2.2.2-python-automagic.patch
@@ -0,0 +1,25 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -308,6 +308,9 @@
+
+ include(CTest)
+
++# Approval tests require python 2.7 or 3
++find_package(PythonInterp)
++
+ if (BUILD_TESTING AND NOT_SUBPROJECT)
+ add_executable(SelfTest ${TEST_SOURCES} ${IMPL_SOURCES} ${REPORTER_SOURCES} ${SURROGATE_SOURCES} ${HEADERS})
+ target_include_directories(SelfTest PRIVATE ${HEADER_DIR})
+@@ -384,7 +387,11 @@
+ set_tests_properties(NoTest PROPERTIES PASS_REGULAR_EXPRESSION "No test cases matched")
+
+ # AppVeyor has a Python 2.7 in path, but doesn't have .py files as autorunnable
+- add_test(NAME ApprovalTests COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/scripts/approvalTests.py $<TARGET_FILE:SelfTest>)
++ if(NOT ${PYTHONINTERP_FOUND})
++ message(FATAL_ERROR "Python not found, but required for running tests!")
++ endif()
++
++ add_test(NAME ApprovalTests COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/approvalTests.py $<TARGET_FILE:SelfTest>)
+ set_tests_properties(ApprovalTests PROPERTIES FAIL_REGULAR_EXPRESSION "Results differed")
+
+ if (CATCH_USE_VALGRIND)
diff --git a/dev-cpp/catch/files/catch-2.2.2-test-python3.patch b/dev-cpp/catch/files/catch-2.2.2-test-python3.patch
new file mode 100644
index 000000000000..0712f1577077
--- /dev/null
+++ b/dev-cpp/catch/files/catch-2.2.2-test-python3.patch
@@ -0,0 +1,44 @@
+From dc6b83bec9bdcc149db08711cc9dfd555a8620fa Mon Sep 17 00:00:00 2001
+From: Tom Hughes <tom@compton.nu>
+Date: Fri, 6 Apr 2018 13:59:08 +0100
+Subject: [PATCH] Support Python3 in approval tests
+
+---
+ scripts/approvalTests.py | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py
+index a2ab5d5a2..16cc7b7d2 100755
+--- a/scripts/approvalTests.py
++++ b/scripts/approvalTests.py
+@@ -72,10 +72,17 @@
+
+ overallResult = 0
+
++def openFile(file, mode):
++ try:
++ return open(file, mode, encoding='utf-8', errors='surrogateescape')
++ except TypeError:
++ import io
++ return io.open(file, mode, encoding='utf-8', errors='surrogateescape')
++
+ def diffFiles(fileA, fileB):
+- with open(fileA, 'r') as file:
++ with openFile(fileA, 'r') as file:
+ aLines = [line.rstrip() for line in file.readlines()]
+- with open(fileB, 'r') as file:
++ with openFile(fileB, 'r') as file:
+ bLines = [line.rstrip() for line in file.readlines()]
+
+ shortenedFilenameA = fileA.rsplit(os.sep, 1)[-1]
+@@ -139,8 +146,8 @@ def approve(baseName, args):
+ subprocess.call(args, stdout=f, stderr=f)
+ f.close()
+
+- rawFile = open(rawResultsPath, 'r')
+- filteredFile = open(filteredResultsPath, 'w')
++ rawFile = openFile(rawResultsPath, 'r')
++ filteredFile = openFile(filteredResultsPath, 'w')
+ for line in rawFile:
+ filteredFile.write(filterLine(line).rstrip() + "\n")
+ filteredFile.close()