Skip to content

SketchMorph2 Tests

Maximilian Franz edited this page Jun 30, 2021 · 12 revisions

This category contains two classes that are responsible for testing different aspects of the system

M2BackendTests

This is where the main functionality (the tools, undo, etc.) gets tested. To test a tool, we simulate user input and compare the resulting image to an image that has been saved as a static class method of the test class. This means that we don't have to worry about comparing for instance a geometric form by its geometric properties but can just compare these two images pixel by pixel.

Wiki Entry

This code stores formToSave in the method #methodName in the M2DrawingComponentTests class:

| stream methodStub |
stream := WriteStream on: String new.
formToSave storeOn: stream.

methodStub := 'methodName
	"This is an auto-generated method"
	^ '.
M2DrawingComponentTests classSide
compile: methodStub, stream contents
classified: 'testing - forms'.

MorphicMonetTests

This contains tests for the frontend. Tests in this class check if all the UI elements exist and do what they're supposed to. For more information about the framework used, see here.

Clone this wiki locally