Skip to content

gtest-nano.h: shut down warnings on unused argc/argv with a comment #73

gtest-nano.h: shut down warnings on unused argc/argv with a comment

gtest-nano.h: shut down warnings on unused argc/argv with a comment #73

Workflow file for this run

name: Unit tests
on:
push:
branches:
- master
pull_request: {}
jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: restore
run: |
sudo apt-get install -y libgtest-dev
- name: build
run: .build/build
- name: unittest
run: .build/run-unittest
# Builds and runs tests on Ubuntu 7.10.
# It ships with:
#
# gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
# Copyright (C) 2006 Free Software Foundation, Inc.
#
# cmake version 2.4-patch 7
#
# This one is challenging:
#
# * It's impossible to run git clone inside this container (as old git will use ancient protocols not supported anymore
# by GitHub, and also standard `actions/checkout@v3` will depend on NodeJS/npm, which are not available in this container).
# To work around this, we start/stop container manually and use targeted execution of specific build/run commands only
# inside the container, keeping git and networking stuff out.
#
# * For gcc, vast majority of C++11 features are missing from this release (many were added around GCC 4.3 and 4.4).
# Some C99 features are also missing. C++98 support seems to be full-featued.
#
# * Modern GTest doesn't work in this environment, as GTest v1.12.x requires C++11 and modern GTest v1.13+ requires C++14.
# To work around this, we supply nano substitute of GTest (tests/gtest-nano.h), partially compatible with API.
#
# * CMake is way too old to be usable without major rewrite of all the CMakeLists.txt to use ancient/deprecated syntax.
# To work around this, we use plain GNU make(1) and supply custom Makefile.gcc4.
linux_ubuntu_7_10:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: docker pull
run: |
docker pull icomputer7/ancient-ubuntu-docker:gutsy
- name: docker create start
run: |
docker create --name u710 --label u710 --workdir /w -v "$GITHUB_WORKSPACE":"/w" --entrypoint "tail" icomputer7/ancient-ubuntu-docker:gutsy "-f" "/dev/null"
docker start u710
- name: restore
run: |
docker exec u710 sh -c 'pwd && ls -al && apt-get update && apt-get -y --no-install-recommends install make g++'
- name: build
run: |
docker exec u710 sh -c 'make -f Makefile.gcc4'
- name: unittest
run: |
docker exec u710 sh -c 'build/unittest'
- name: docker shutdown
run: |
docker stop u710
docker rm u710
windows:
runs-on: windows-latest
# NB: see https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md for what's available in this image
steps:
- uses: actions/checkout@v3
- name: restore
run: |
C:\vcpkg\bootstrap-vcpkg.bat
C:\vcpkg\vcpkg install gtest:x64-windows
- name: build
run: .build\build.ps1 -GTestPath C:\vcpkg\installed\x64-windows
- name: unittest
run: .build\run-unittest.ps1