Skip to content

Commit d508e09

Browse files
authored
Merge pull request #2035 from Exiv2/ci_forward_main
Forward CI changes
2 parents 41ae517 + 23c5100 commit d508e09

File tree

8 files changed

+130
-94
lines changed

8 files changed

+130
-94
lines changed

.github/workflows/on_PR_linux_matrix.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ jobs:
4747
tree install
4848
4949
- name: Test
50-
env:
51-
EXIV2_EXT: .exe
5250
run: |
5351
cd build
5452
ctest --output-on-failure

.github/workflows/on_PR_linux_special_buils.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ jobs:
3737
cmake --build .
3838
3939
- name: Tests + Upload coverage
40-
env:
41-
EXIV2_EXT: .exe
4240
run: |
4341
cd build
4442
ctest --output-on-failure
@@ -85,8 +83,6 @@ jobs:
8583
cmake --build .
8684
8785
- name: Tests with valgrind
88-
env:
89-
EXIV2_EXT: .exe
9086
run: |
9187
cd build/bin
9288
valgrind ./unit_tests
@@ -123,8 +119,6 @@ jobs:
123119
cmake --build .
124120
125121
- name: Tests
126-
env:
127-
EXIV2_EXT: .exe
128122
run: |
129123
cd build
130124
ctest --output-on-failure
@@ -163,21 +157,3 @@ jobs:
163157
- name: Generate documentation
164158
run: |
165159
make doc
166-
167-
special_FedoraMinGW:
168-
name: 'Fedora MinGW'
169-
runs-on: ubuntu-latest
170-
container:
171-
image: "fedora:latest"
172-
173-
steps:
174-
- uses: actions/checkout@v2
175-
176-
- name: install dependencies
177-
run: |
178-
dnf -y upgrade
179-
dnf -y install mingw64-gcc-c++ mingw64-filesystem mingw64-expat mingw64-zlib cmake make
180-
181-
- name: Build
182-
run:
183-
python3 ci/test_build.py --without-tests --cmake-executable "mingw64-cmake" --cmake-options "-DEXIV2_TEAM_EXTRA_WARNINGS=OFF -DEXIV2_TEAM_WARNINGS_AS_ERRORS=OFF -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_ENABLE_WIN_UNICODE=ON " --compilers --shared-libs OFF

.github/workflows/on_PR_mac_matrix.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ jobs:
4040
cmake --build . --target install
4141
4242
- name: Test
43-
env:
44-
EXIV2_EXT: .exe
4543
run: |
4644
cd build
4745
ctest --output-on-failure

.github/workflows/on_PR_windows_matrix.yml

Lines changed: 120 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
build_type: [Release, Debug]
2020
shared_libraries: [ON, OFF]
2121
platform: [ x64, x86 ]
22-
22+
2323
steps:
2424
- uses: actions/checkout@v2
2525

@@ -28,7 +28,7 @@ jobs:
2828
with:
2929
arch: ${{matrix.platform}}
3030

31-
- name: Setup Ninja
31+
- name: Set up Ninja
3232
uses: ashutoshvarma/setup-ninja@master
3333
with:
3434
version: 1.10.0
@@ -38,7 +38,7 @@ jobs:
3838
with:
3939
python-version: 3.7
4040

41-
- name: Restore conan cache
41+
- name: Restore Conan cache
4242
uses: actions/cache@v2
4343
with:
4444
path: ${{github.workspace}}/conanCache
@@ -68,23 +68,131 @@ jobs:
6868
conan install .. --build missing
6969
dir ..
7070
tree /f ../conanCache
71-
71+
7272
- name: Build
7373
run: |
74-
cd build
75-
cmake -GNinja -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DBUILD_SHARED_LIBS=${{matrix.shared_libraries}} -DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_PNG=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DEXIV2_ENABLE_WIN_UNICODE=OFF -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DEXIV2_ENABLE_BMFF=ON -DCMAKE_INSTALL_PREFIX=install ..
76-
ninja
74+
cmake -GNinja `
75+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} `
76+
-DBUILD_SHARED_LIBS=${{matrix.shared_libraries}} `
77+
-DEXIV2_ENABLE_NLS=OFF `
78+
-DEXIV2_ENABLE_WIN_UNICODE=OFF `
79+
-DEXIV2_ENABLE_WEBREADY=ON `
80+
-DEXIV2_ENABLE_BMFF=ON `
81+
-DEXIV2_BUILD_UNIT_TESTS=ON `
82+
-DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON `
83+
-DCMAKE_INSTALL_PREFIX=install `
84+
-S . -B build && `
85+
cmake --build build
7786
7887
- name: Install
7988
run: |
8089
cd build
81-
ninja install
90+
cmake --install .
8291
tree /f install
8392
8493
- name: Test
8594
if: ${{matrix.platform == 'x64'}}
86-
env:
87-
EXIV2_EXT: .exe
8895
run: |
89-
cd build
90-
ctest --output-on-failure
96+
ctest --test-dir build --output-on-failure
97+
98+
msys2:
99+
runs-on: windows-latest
100+
strategy:
101+
fail-fast: false
102+
matrix:
103+
build_type: [Release, Debug]
104+
shared_libraries: [ON, OFF]
105+
sys: [MINGW64]
106+
name: MSYS2 ${{matrix.sys}} - BuildType:${{matrix.build_type}} - SHARED:${{matrix.shared_libraries}}
107+
defaults:
108+
run:
109+
shell: msys2 {0}
110+
steps:
111+
- uses: actions/checkout@v2
112+
113+
- name: Set up MSYS2
114+
uses: msys2/setup-msys2@v2
115+
with:
116+
msystem: ${{matrix.sys}}
117+
update: true
118+
install: >-
119+
base-devel
120+
pacboy: >-
121+
toolchain:p
122+
cmake:p
123+
ninja:p
124+
expat:p
125+
gettext:p
126+
gtest:p
127+
libiconv:p
128+
python-lxml:p
129+
zlib:p
130+
131+
- name: Build
132+
run: |
133+
cmake -GNinja \
134+
-DCMAKE_CXX_FLAGS=-Wno-deprecated \
135+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
136+
-DBUILD_SHARED_LIBS=${{matrix.shared_libraries}} \
137+
-DEXIV2_ENABLE_NLS=ON \
138+
-DEXIV2_ENABLE_WIN_UNICODE=ON \
139+
-DEXIV2_ENABLE_WEBREADY=ON \
140+
-DEXIV2_ENABLE_BMFF=ON \
141+
-DEXIV2_BUILD_UNIT_TESTS=ON \
142+
-S . -B build && \
143+
cmake --build build
144+
145+
- name: Test
146+
run: |
147+
ctest --test-dir build --output-on-failure
148+
149+
cygwin:
150+
runs-on: windows-latest
151+
strategy:
152+
fail-fast: false
153+
matrix:
154+
build_type: [Release]
155+
shared_libraries: [ON]
156+
platform: [x64]
157+
name: Cygwin ${{matrix.platform}} - BuildType:${{matrix.build_type}} - SHARED:${{matrix.shared_libraries}}
158+
env:
159+
SHELLOPTS: igncr
160+
defaults:
161+
run:
162+
shell: C:\tools\cygwin\bin\bash.exe -eo pipefail '{0}'
163+
steps:
164+
# Make sure we don't check out scripts using Windows CRLF line endings
165+
- run: git config --global core.autocrlf input
166+
shell: pwsh
167+
- uses: actions/checkout@v2
168+
169+
- name: Set up Cygwin
170+
uses: egor-tensin/setup-cygwin@v3
171+
with:
172+
platform: ${{matrix.platform}}
173+
packages: >-
174+
gcc-g++
175+
cmake
176+
ninja
177+
libexpat-devel
178+
libxml2-devel
179+
libxslt-devel
180+
python38-lxml
181+
zlib-devel
182+
- name: Build
183+
run: |
184+
cmake -GNinja \
185+
-DCMAKE_CXX_FLAGS=-Wno-deprecated \
186+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
187+
-DBUILD_SHARED_LIBS=${{matrix.shared_libraries}} \
188+
-DEXIV2_ENABLE_NLS=OFF \
189+
-DEXIV2_ENABLE_WIN_UNICODE=OFF \
190+
-DEXIV2_ENABLE_WEBREADY=ON \
191+
-DEXIV2_ENABLE_BMFF=ON \
192+
-DEXIV2_BUILD_UNIT_TESTS=OFF \
193+
-S . -B build && \
194+
cmake --build build
195+
196+
- name: Test
197+
run: |
198+
ctest --test-dir build --output-on-failure

.github/workflows/on_push_ExtraJobsForMain.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ jobs:
3838
make -j
3939
4040
- name: Tests + Upload coverage
41-
env:
42-
EXIV2_EXT: .exe
4341
run: |
4442
cd build
4543
ctest --output-on-failure

exiv2.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ standards-defined metadata.
13261326
With [--Modify cmd](#Modify_cmd), quotation marks are use to surround the
13271327
*cmd*. The Windows command line requires double quotes to be
13281328
used, however generally, quotes inside that string, can be either single
1329-
or double. Generally, UNIX based systems can use pairs of single or
1329+
or double. Generally, Unix-based systems can use pairs of single or
13301330
double quotes in any position. In both systems, inner string quotation
13311331
marks may need to use the `\` escape sequence.
13321332

@@ -1634,11 +1634,11 @@ For another example, see: https://www.exiv2.org/sample.html
16341634

16351635
# 12 CONFIGURATION FILE
16361636
**exiv2** can read an optional configuration file, which allows
1637-
additional lens definitions to be added to translated output. On UNIX
1638-
based systems, this file is called *.exiv2* and on Windows (including MinGW),
1639-
*exiv2.ini*. The file is searched for first in the current directory,
1640-
then in the home directory (on UNIX based systems, `~/` and on Windows,
1641-
`%USERPROFILE%\\`).
1637+
additional lens definitions to be added to translated output. On Unix-based
1638+
systems (including Cygwin), this file is called *.exiv2* and on Windows
1639+
(including MinGW), *exiv2.ini*. The file is searched for first in the
1640+
current directory, then in the home directory (`$HOME` on Unix-based
1641+
systems, and `%USERPROFILE%` on Windows).
16421642

16431643
You can determine the name of the file and where it is searched for,
16441644
with the command:

tests/lens_tests/test_config_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77

88
# copy the example config file into current working directory
9-
# and name it ".exiv2" on linux or "exiv2.ini" on Win
9+
# and name it "exiv2.ini" on Win or ".exiv2" on other platforms
1010
class TmpConfigFile(system_tests.FileDecoratorBase):
1111
def setUp_file_action(self, expanded_file_name):
1212
config_file_path = os.path.dirname(os.path.abspath(__file__))
13-
fname = ".exiv2" if sys.platform == "linux" or sys.platform == "darwin" else "exiv2.ini"
13+
fname = os.path.basename(system_tests.BT.verbose_version().get('config_path'))
1414
return shutil.copyfile(expanded_file_name, os.path.join(config_file_path, fname))
1515

1616

unitTests/test_futils.cpp

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,8 @@ TEST(strError, returnSuccessAfterClosingFile)
4242
std::string tmpFile("tmp.dat");
4343
std::ofstream auxFile(tmpFile.c_str());
4444
auxFile.close();
45-
bool useExactString{true};
46-
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW__) || defined(__MSYS__)
47-
const char * expectedString = "No error (errno = 0)";
48-
#elif defined(__APPLE__)
49-
const char * expectedString = "Undefined error: 0 (errno = 0)";
50-
#elif defined(__sun__)
51-
const char * expectedString = "Error 0 (errno = 0)";
52-
#elif defined(__FreeBSD__)
53-
const char * expectedString = "No error: 0 (errno = 0)";
54-
#elif defined(__NetBSD__)
55-
const char * expectedString = "Undefined error: 0 (errno = 0)";
56-
#else
57-
// On Alpine we get 'No error information (errno = 0)' instead of 'Success (errno = 0)'
58-
const char * expectedString = "(errno = 0)";
59-
useExactString = false;
60-
#endif
6145
std::remove(tmpFile.c_str());
62-
if (useExactString) {
63-
ASSERT_STREQ(expectedString, strError().c_str());
64-
} else {
65-
ASSERT_TRUE(strError().find(expectedString) != std::string::npos);
66-
}
46+
ASSERT_TRUE(strError().find("(errno = 0)") != std::string::npos);
6747
}
6848

6949
TEST(strError, returnNoSuchFileOrDirectoryWhenTryingToOpenNonExistingFile)
@@ -75,29 +55,7 @@ TEST(strError, returnNoSuchFileOrDirectoryWhenTryingToOpenNonExistingFile)
7555
TEST(strError, doNotRecognizeUnknownError)
7656
{
7757
errno = 9999;
78-
bool useExactString{true};
79-
#if defined(__MINGW__) || defined(__MSYS__) || defined(__CYGWIN__)
80-
const char * expectedString = "Unknown error 9999 (errno = 9999)";
81-
#elif defined(_WIN32)
82-
const char * expectedString = "Unknown error (errno = 9999)";
83-
#elif defined(__APPLE__)
84-
const char * expectedString = "Unknown error: 9999 (errno = 9999)";
85-
#elif defined(__sun__)
86-
const char * expectedString = "Unknown error (errno = 9999)";
87-
#elif defined(__FreeBSD__)
88-
const char * expectedString = "Unknown error: 9999 (errno = 9999)";
89-
#elif defined(__NetBSD__)
90-
const char * expectedString = "Unknown error: 9999 (errno = 9999)";
91-
#else
92-
// On Alpine we get 'No error information (errno = 9999)' instead of 'Unknown error 9999 (errno = 9999)'
93-
const char * expectedString = "(errno = 9999)";
94-
useExactString = false;
95-
#endif
96-
if (useExactString) {
97-
ASSERT_STREQ(expectedString, strError().c_str());
98-
} else {
99-
ASSERT_TRUE(strError().find(expectedString) != std::string::npos);
100-
}
58+
ASSERT_TRUE(strError().find("(errno = 9999)") != std::string::npos);
10159
}
10260

10361
TEST(getEnv, getsDefaultValueWhenExpectedEnvVariableDoesNotExist)

0 commit comments

Comments
 (0)