Skip to content

Commit

Permalink
[tests] Add make target to build (not run) all the test suites. (#21575)
Browse files Browse the repository at this point in the history
This is useful to verify that sweeping code changes actually compile everywhere.
  • Loading branch information
rolfbjarne authored Nov 6, 2024
1 parent 43768cf commit 95a0ad2
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 22 deletions.
17 changes: 17 additions & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,20 @@ package-test-libraries.zip:
$(Q_GEN) cd $(TOP) && zip -9r --symlinks $(abspath $@).tmp ./tests/test-libraries
$(Q_GEN) cd $(TOP) && find tests -regex 'tests/test-libraries/custom-type-assembly/.libs/.*dll' -exec zip -9r --symlinks $(abspath $@).tmp {} +
$(Q) mv "$@".tmp "$@"

build-all:
$(MAKE) build -C bgen
$(MAKE) build -C cecil-tests
$(MAKE) build -C dotnet/UnitTests
$(MAKE) build -C rgen
$(MAKE) build -C xtro-sharpie
$(MAKE) build-all -C "linker/ios/dont link/dotnet"
$(MAKE) build-all -C "linker/ios/link all/dotnet"
$(MAKE) build-all -C "linker/ios/link sdk/dotnet"
$(MAKE) build-all -C "linker/ios/trimmode copy/dotnet"
$(MAKE) build-all -C "linker/ios/trimmode link/dotnet"
$(MAKE) build-all -C fsharp/dotnet
$(MAKE) build-all -C interdependent-binding-projects/dotnet
$(MAKE) build-all -C introspection/dotnet
$(MAKE) build-all -C monotouch-test/dotnet
$(MAKE) build-all -C xcframework-test/dotnet
3 changes: 3 additions & 0 deletions tests/bgen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ include $(TOP)/Make.config

run-tests run-unit-tests:
$(Q) $(DOTNET) test $(TEST_FILTER) bgen-tests.csproj

build:
$(Q) $(DOTNET) build bgen-tests.csproj
6 changes: 0 additions & 6 deletions tests/framework-test/dotnet/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
TOP=../../..
include $(TOP)/Make.config

build-all:
for platform in $(DOTNET_PLATFORMS); do \
echo "Building in $$platform"; \
$(MAKE) -C "$$platform" build; \
done
8 changes: 1 addition & 7 deletions tests/fsharp/dotnet/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
TOP=../../..
include $(TOP)/Make.config

build-all:
for platform in $(DOTNET_PLATFORMS); do \
echo "Building in $$platform"; \
$(MAKE) -C "$$platform" build; \
done
include $(TOP)/tests/common/shared-dotnet-test.mk
2 changes: 2 additions & 0 deletions tests/interdependent-binding-projects/dotnet/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
TOP=../../..
include $(TOP)/tests/common/shared-dotnet-test.mk
2 changes: 1 addition & 1 deletion tests/linker/ios/trimmode copy/dotnet/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
TOP=../../../..
TOP=../../../../..
include $(TOP)/tests/common/shared-dotnet-test.mk
2 changes: 1 addition & 1 deletion tests/linker/ios/trimmode link/dotnet/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
TOP=../../../..
TOP=../../../../..
include $(TOP)/tests/common/shared-dotnet-test.mk
22 changes: 22 additions & 0 deletions tests/rgen/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
TOP=../..
include $(TOP)/Make.config

# Example TEST_FILTER:
# TEST_FILTER="--filter FullyQualifiedName~BuildMyCocoaApp"
# Docs: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test#filter-option-details

build-bindings-analyzer-tests:
$(Q) $(DOTNET) build Microsoft.Macios.Bindings.Analyzer.Tests/Microsoft.Macios.Bindings.Analyzer.Tests.csproj $(DOTNET_BUILD_VERBOSITY)

run-bindings-analyzer-tests:
$(Q) $(DOTNET) test Microsoft.Macios.Bindings.Analyzer.Tests/Microsoft.Macios.Bindings.Analyzer.Tests.csproj $(TEST_FILTER)

build-generator-tests:
$(Q) $(DOTNET) build Microsoft.Macios.Generator.Tests/Microsoft.Macios.Generator.Tests.csproj $(DOTNET_BUILD_VERBOSITY)

run-generator-tests:
$(Q) $(DOTNET) test Microsoft.Macios.Generator.Tests/Microsoft.Macios.Generator.Tests.csproj $(TEST_FILTER)

build-all: build-bindings-analyzer-tests build-generator-tests

run-tests run test: run-bindings-analyzer-tests run-generator-tests
8 changes: 1 addition & 7 deletions tests/xcframework-test/dotnet/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
TOP=../../..
include $(TOP)/Make.config

build-all:
for platform in $(DOTNET_PLATFORMS); do \
echo "Building in $$platform"; \
$(MAKE) -C "$$platform" build; \
done
include $(TOP)/tests/common/shared-dotnet-test.mk

5 comments on commit 95a0ad2

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.