From a3272ad69fe082a9674e97d383feff267abff24a Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Thu, 2 Jan 2025 13:50:32 -0500 Subject: [PATCH] Run internal tests in Cygwin --- .github/workflows/testing.yml | 37 +++++++++++++++++++++++++++++++++++ Makefile | 8 +++++++- test/run-tests.sh | 13 ++++++++++-- 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index dfcee3fb7..ebcdea69a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -320,3 +320,40 @@ jobs: shell: bash run: | test/run-tests.sh + + cygwin: + strategy: + matrix: + bits: [32, 64] + include: + - bits: 32 + arch: x86 + - bits: 64 + arch: x86_64 + fail-fast: false + runs-on: windows-2019 + timeout-minutes: 30 + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Setup Cygwin + uses: cygwin/cygwin-install-action@v4 + with: + platform: ${{ matrix.arch }} + packages: >- + bison + gcc-g++ + libpng-devel + make + pkg-config + - name: Build & install using Make + shell: C:\cygwin\bin\bash.exe '{0}' + run: | # Cygwin does not support `make develop` sanitizers ASan or UBSan + PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32" + make debug -kj Q= + make install -j Q= + - name: Run tests + shell: C:\cygwin\bin\bash.exe '{0}' + run: | + PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32" + test/run-tests.sh --only-internal diff --git a/Makefile b/Makefile index cfdc020db..2e182bdd3 100644 --- a/Makefile +++ b/Makefile @@ -213,7 +213,13 @@ develop: # This target is used during development in order to more easily debug with gdb. debug: - $Qenv ${MAKE} \ + $Qenv ${MAKE} WARNFLAGS="${WARNFLAGS} -Werror -Wextra \ + -Walloc-zero -Wcast-align -Wcast-qual -Wduplicated-branches -Wduplicated-cond \ + -Wfloat-equal -Wlogical-op -Wnull-dereference -Wold-style-cast -Wshift-overflow=2 \ + -Wstringop-overflow=4 -Wundef -Wuninitialized -Wunused -Wshadow \ + -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=1 \ + -Wno-format-nonliteral -Wno-strict-overflow -Wno-unused-but-set-variable \ + -Wno-type-limits -Wno-tautological-constant-out-of-range-compare -Wvla" \ CXXFLAGS="-ggdb3 -O0 -fno-omit-frame-pointer -fno-optimize-sibling-calls" # This target is used during development in order to more easily profile with callgrind. diff --git a/test/run-tests.sh b/test/run-tests.sh index d4a226893..e82094287 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -6,13 +6,15 @@ cd "$(dirname "$0")" usage() { echo "Runs regression tests on RGBDS." echo "Options:" - echo " -h, --help show this help message" - echo " --only-free skip tests that build nonfree codebases" + echo " -h, --help show this help message" + echo " --only-free skip tests that build nonfree codebases" + echo " --only-internal skip tests that build external codebases" } # Parse options in pure Bash because macOS `getopt` is stuck # in what util-linux `getopt` calls `GETOPT_COMPATIBLE` mode nonfree=true +external=true FETCH_TEST_DEPS="fetch-test-deps.sh" while [[ $# -gt 0 ]]; do case "$1" in @@ -24,6 +26,9 @@ while [[ $# -gt 0 ]]; do nonfree=false FETCH_TEST_DEPS="fetch-test-deps.sh --only-free" ;; + --only-internal) + external=false + ;; --) break ;; @@ -49,6 +54,10 @@ for dir in asm link fix gfx; do popd done +if ! "$external"; then + exit +fi + # Test some significant external projects that use RGBDS # When adding new ones, don't forget to add them to the .gitignore! # When updating subprojects, change the commit being checked out, and set the `shallow-since`