Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ADDON_NAME := $(shell cat ./bombsquad-tools/blender_manifest.toml | grep -oP '(?<=^id = \").*(?=\")')
VERSION := $(shell cat ./bombsquad-tools/blender_manifest.toml | grep -oP '(?<=^version = \").*(?=\")')

.PHONY: dev tag publish CHANGELOG.md
.PHONY: dev test-all tag publish CHANGELOG.md

all: $(ADDON_NAME)-$(VERSION).zip

Expand All @@ -18,6 +18,15 @@ $(ADDON_NAME)-dev.zip: ./bombsquad-tools ./bombsquad-tools/**
dev:
find ./bombsquad-tools/ | entr -cs 'date --rfc-email; make $(ADDON_NAME)-dev.zip'

test-all: test/*.log.txt
git diff $^

test/%.log.txt: test/%.py $(ADDON_NAME)-dev.zip
# FIXME: set $BLENDER_USER_EXTENSIONS environment variable instead of installing the addon globally and polluting the user's file system
blender --command extension install-file -r user_default "$(realpath ./$(ADDON_NAME)-dev.zip)"
# The last 3 lines of output contain blender's build hash which adds un-necessary noise to the test snapshot
blender --background --factory-startup --addons bl_ext.user_default.$(ADDON_NAME) --debug-value 45623 --python "$(realpath $<)" | head -n -3 | tee $@

clean:
rm -rf *.zip

Expand Down
4 changes: 4 additions & 0 deletions bombsquad_tools.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"./.venv/lib64/python3.11/site-packages",
"./.venv/lib/python3.11/site-packages",
],
"python.analysis.diagnosticSeverityOverrides": {
// Disable warning "Call expression not allowed in type expression" on bpy.Props.XXX annotations
"reportInvalidTypeForm": "none",
},
},
"folders": [
{
Expand Down
4 changes: 4 additions & 0 deletions test/test-sanity.log.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
hello from blender
['Cube', 'Light', 'Camera']
['Light', 'Camera']
done
9 changes: 9 additions & 0 deletions test/test-sanity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import bpy

print("hello from blender")

print([obj.name for obj in bpy.context.scene.collection.all_objects])
bpy.ops.object.delete()
print([obj.name for obj in bpy.context.scene.collection.all_objects])

print("done")