chore: autotest windows & linux on PR + remove 2 warnings under Linux
This commit is contained in:
committed by
GitHub
parent
49eecc0a6f
commit
3eecbcbdcc
76
.github/workflows/tests.yml
vendored
76
.github/workflows/tests.yml
vendored
@@ -3,8 +3,8 @@ name: C/C++ CI
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
linux64-gui:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -14,8 +14,80 @@ jobs:
|
||||
- name: configure
|
||||
run: ./configure
|
||||
- name: make
|
||||
run: make
|
||||
run: nproc && make -j$(nproc)
|
||||
- name: check executability
|
||||
run: ./dvdisaster --version
|
||||
- name: check executable
|
||||
run: file dvdisaster && file dvdisaster | grep -q 'ELF 64'
|
||||
- name: regression tests
|
||||
run: mkdir /var/tmp/regtest && ./regtest/runtests.sh
|
||||
|
||||
linux64-cli:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: install prerequisites
|
||||
run: sudo apt update && sudo apt install -y libglib2.0-dev
|
||||
- name: configure
|
||||
run: env CLI_ONLY=1 ./configure
|
||||
- name: make
|
||||
run: nproc && make -j$(nproc)
|
||||
- name: check executability
|
||||
run: ./dvdisaster --version
|
||||
- name: check executable
|
||||
run: file dvdisaster && file dvdisaster | grep -q 'ELF 64'
|
||||
- name: regression tests
|
||||
run: mkdir /var/tmp/regtest && ./regtest/runtests.sh
|
||||
|
||||
win64:
|
||||
runs-on: windows-2016
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
steps:
|
||||
- uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: MINGW64
|
||||
update: false
|
||||
install: git diffutils make pkg-config mingw-w64-x86_64-gtk2 mingw-w64-x86_64-glib2 mingw-w64-x86_64-gcc
|
||||
- run: git config --global core.autocrlf input
|
||||
shell: bash
|
||||
- uses: actions/checkout@v2
|
||||
- name: configure
|
||||
run: ./configure
|
||||
- name: make
|
||||
run: nproc && make -j$(nproc)
|
||||
- name: check executability
|
||||
run: ./dvdisaster.exe --version
|
||||
- name: check executable
|
||||
run: file dvdisaster.exe && file dvdisaster.exe | grep -q 'x86-64, for MS Windows'
|
||||
- name: regression tests
|
||||
run: mkdir /var/tmp/regtest && ./regtest/runtests.sh
|
||||
|
||||
win32:
|
||||
runs-on: windows-2016
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
steps:
|
||||
- uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: MINGW32
|
||||
update: false
|
||||
install: git diffutils make pkg-config mingw-w64-i686-gtk2 mingw-w64-i686-glib2 mingw-w64-i686-gcc
|
||||
- run: git config --global core.autocrlf input
|
||||
shell: bash
|
||||
- uses: actions/checkout@v2
|
||||
- name: configure
|
||||
run: ./configure
|
||||
- name: make
|
||||
run: nproc && make -j$(nproc)
|
||||
- name: check executability
|
||||
run: ./dvdisaster.exe --version
|
||||
- name: check executable
|
||||
run: file dvdisaster.exe && file dvdisaster.exe | grep -q '386, for MS Windows'
|
||||
- name: regression tests
|
||||
run: mkdir /var/tmp/regtest && ./regtest/runtests.sh
|
||||
|
||||
14
large-io.c
14
large-io.c
@@ -40,8 +40,8 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define stat _stati64
|
||||
#define lseek _lseeki64
|
||||
#define large_stat _stati64
|
||||
#define large_lseek _lseeki64
|
||||
|
||||
/* The original windows ftruncate has off_size (32bit) */
|
||||
|
||||
@@ -62,6 +62,8 @@ int large_ftruncate(int fd, gint64 size)
|
||||
|
||||
#else
|
||||
#define large_ftruncate ftruncate
|
||||
#define large_stat stat
|
||||
#define large_lseek lseek
|
||||
#endif /* SYS_MINGW */
|
||||
|
||||
/*
|
||||
@@ -90,7 +92,7 @@ int LargeStat(char *path, guint64 *length_return)
|
||||
|
||||
if(!cp_path) return FALSE;
|
||||
|
||||
if(stat(cp_path, &mystat) == -1)
|
||||
if(large_stat(cp_path, &mystat) == -1)
|
||||
{ g_free(cp_path);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -113,7 +115,7 @@ int DirStat(char *path)
|
||||
|
||||
if(!cp_path) return FALSE;
|
||||
|
||||
if(stat(cp_path, &mystat) == -1)
|
||||
if(large_stat(cp_path, &mystat) == -1)
|
||||
{ g_free(cp_path);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -148,7 +150,7 @@ LargeFile* LargeOpen(char *name, int flags, mode_t mode)
|
||||
|
||||
/* Do not try to open directories etc. */
|
||||
|
||||
if( (stat(cp_path, &mystat) == 0)
|
||||
if( (large_stat(cp_path, &mystat) == 0)
|
||||
&& !S_ISREG(mystat.st_mode))
|
||||
{ g_free(cp_path), g_free(lf); return NULL;
|
||||
}
|
||||
@@ -175,7 +177,7 @@ LargeFile* LargeOpen(char *name, int flags, mode_t mode)
|
||||
int LargeSeek(LargeFile *lf, off_t pos)
|
||||
{
|
||||
lf->offset = pos;
|
||||
if(lseek(lf->fileHandle, pos, SEEK_SET) != pos)
|
||||
if(large_lseek(lf->fileHandle, pos, SEEK_SET) != pos)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
* along with dvdisaster. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SYS_MINGW /* completely untested under Windows, and we don't need it for releases anyway */
|
||||
#ifdef WITH_MEMDEBUG_YES
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user