diff --git a/Makefile b/Makefile index ad1925c..2a9f6c1 100644 --- a/Makefile +++ b/Makefile @@ -134,13 +134,44 @@ Brewfile.lock.json: Brewfile # Non-build targets and rules -test: test-dmg test-shell +test: test-openfoam test-bash test-zsh + +test-openfoam: + [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) + rm -rf build/test/test-openfoam + mkdir -p build/test/test-openfoam + build/$(APP_NAME).app/Contents/MacOS/openfoam -c foamInstallationTest + cd build/test/test-openfoam \ + && "$(CURDIR)/build/$(APP_NAME).app/Contents/MacOS/openfoam" < "$(CURDIR)/test.sh" + build/$(APP_NAME).app/Contents/MacOS/volume eject && [ ! -d $(VOLUME) ] + +test-bash: + [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) + rm -rf build/test/test-bash + mkdir -p build/test/test-bash + bash -c \ + set -ex; \ + source build/$(APP_NAME).app/Contents/MacOS/bashrc; \ + foamInstallationTest; \ + cd build/test/test-bash; \ + source "$(CURDIR)/test.sh" + build/$(APP_NAME).app/Contents/MacOS/volume eject && [ ! -d $(VOLUME) ] + +test-zsh: + [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) + rm -rf build/test/test-zsh + mkdir -p build/test/test-zsh + zsh -c \ + set -ex; \ + source build/$(APP_NAME).app/Contents/MacOS/bashrc; \ + foamInstallationTest; \ + cd build/test/test-zsh; \ + source "$(CURDIR)/test.sh" + build/$(APP_NAME).app/Contents/MacOS/volume eject && [ ! -d $(VOLUME) ] test-dmg: [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) - hdiutil attach build/$(APP_NAME).app/Contents/Resources/$(APP_NAME).dmg \ - || hdiutil attach build/$(APP_NAME).dmg \ - || hdiutil attach build/$(APP_NAME)-build.dmg + hdiutil attach build/$(APP_NAME).dmg rm -rf build/test/test-dmg mkdir -p build/test/test-dmg cd build/test/test-dmg \ @@ -149,15 +180,6 @@ test-dmg: && $(SHELL) -ex "$(CURDIR)/test.sh" hdiutil detach $(VOLUME) -test-shell: - [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) - rm -rf build/test/test-shell - mkdir -p build/test/test-shell - build/$(APP_NAME).app/Contents/MacOS/openfoam -c foamInstallationTest - cd build/test/test-shell \ - && "$(CURDIR)/build/$(APP_NAME).app/Contents/MacOS/openfoam" < "$(CURDIR)/test.sh" - hdiutil detach $(VOLUME) - clean-build: [ ! -d $(VOLUME) ] || hdiutil detach $(VOLUME) rm -f build/$(APP_NAME).dmg build/$(APP_NAME)-shrunk.dmg build/$(APP_NAME)-build.dmg build/$(DIST_NAME).zip @@ -173,7 +195,7 @@ uninstall: # Set special targets -.PHONY: app dmg build fetch-source install-dependencies zip install test test-dmg test-shell clean-build clean uninstall +.PHONY: app dmg build fetch-source install-dependencies zip install test test-openfoam test-bash test-zsh test-dmg clean-build clean uninstall .PRECIOUS: build/$(APP_NAME)-build.dmg .INTERMEDIATE: build/$(APP_NAME)-shrunk.dmg .SECONDARY: $(SOURCE_TARBALL) Brewfile.lock.json build/$(APP_NAME)-build.dmg build/$(APP_NAME).dmg diff --git a/test.sh b/test.sh index 1fe0d4a..201c9b8 100755 --- a/test.sh +++ b/test.sh @@ -21,19 +21,19 @@ rm -rf flange2 cp -r "$FOAM_TUTORIALS/basic/laplacianFoam/flange" flange2 cd flange2 foamDictionary -entry numberOfSubdomains -set 2 system/decomposeParDict -$BASH -e ./Allrun-parallel +./Allrun-parallel reconstructPar cd .. rm -rf backwardFacingStep2D cp -r "$FOAM_TUTORIALS/incompressible/simpleFoam/backwardFacingStep2D" backwardFacingStep2D cd backwardFacingStep2D -$BASH -e ./Allrun +./Allrun ! grep 'FOAM Warning' log.simpleFoam cd .. rm -rf blob cp -r "$FOAM_TUTORIALS/mesh/foamyHexMesh/blob" blob cd blob -$BASH -e ./Allrun +./Allrun cd ..