diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index e8c41d71c..d9db61f71 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -20,13 +20,20 @@ jobs: run: sudo apt-get update - name: Install dependencies run: sudo apt-get install -y g++-mipsel-linux-gnu - - name: Build OpenBIOS - run: make -C src/mips/openbios -j2 - - name: Upload results for MacOS build job + - name: Build tests & OpenBIOS + run: | + make -C src/mips/tests -j 2 PCSX_TESTS=true + make -C src/mips/openbios -j 2 clean all + - name: Upload OpenBIOS for MacOS build job uses: actions/upload-artifact@v2 with: name: OpenBIOS path: src/mips/openbios/openbios.bin + - name: Upload tests for MacOS build job + uses: actions/upload-artifact@v2 + with: + name: Tests + path: src/mips/tests/**/*.ps-exe macos-build-and-test: runs-on: macOS-latest @@ -42,10 +49,20 @@ jobs: run: git submodule update --init --recursive - name: Build pcsx-redux run: make -j2 + - name: Build pcsx-redux-tests + run: make -j2 pcsx-redux-tests - name: Download OpenBIOS build uses: actions/download-artifact@v2 with: name: OpenBIOS + - name: Download tests + uses: actions/download-artifact@v2 + with: + name: Tests + - name: Install xquartz for xvfb + run: brew install xquartz + - name: Run tests + run: /opt/X11/bin/Xvfb :99 -ac -nolisten unix && DISPLAY=:99 ./pcsx-redux-tests - name: Bundle run: ./.github/scripts/create-app.sh - name: Create BUILD environment diff --git a/Makefile b/Makefile index 96fb31eee..9ca2cfb9c 100644 --- a/Makefile +++ b/Makefile @@ -211,6 +211,9 @@ clean: gtest-all.o: $(wildcard third_party/googletest/googletest/src/*.cc) $(CXX) -O3 -g $(CXXFLAGS) -Ithird_party/googletest/googletest -Ithird_party/googletest/googletest/include -c third_party/googletest/googletest/src/gtest-all.cc +gtest_main.o: third_party/googletest/googletest/src/gtest_main.cc + $(CXX) -O3 -g $(CXXFLAGS) -Ithird_party/googletest/googletest -Ithird_party/googletest/googletest/include -c third_party/googletest/googletest/src/gtest_main.cc + gitclean: git clean -f -d -x git submodule foreach --recursive git clean -f -d -x @@ -225,8 +228,8 @@ regen-i18n: rm pcsx-src-list.txt $(foreach l,$(LOCALES),$(call msgmerge,$(l))) -pcsx-redux-tests: $(foreach t,$(TESTS),$(t).o) $(NONMAIN_OBJECTS) gtest-all.o - $(LD) -o pcsx-redux-tests $(NONMAIN_OBJECTS) gtest-all.o $(foreach t,$(TESTS),$(t).o) -Ithird_party/googletest/googletest/include third_party/googletest/googletest/src/gtest_main.cc $(LDFLAGS) +pcsx-redux-tests: $(foreach t,$(TESTS),$(t).o) $(NONMAIN_OBJECTS) gtest-all.o gtest_main.o + $(LD) -o pcsx-redux-tests gtest_main.o $(NONMAIN_OBJECTS) gtest-all.o $(foreach t,$(TESTS),$(t).o) $(LDFLAGS) runtests: pcsx-redux-tests ./pcsx-redux-tests