Skip to content
ashalkhakovPublic

About

A clone of Apple's standard Mac OS Calculator app

Resources

Stars

15 stars

Watchers

0 watching

Forks

Repository files navigation

UDCalc

This is a clone of the MacOSX built-in Calculator.app ported to GNUstep.

Basic Scientific Programmer

Download

Releases carry the Mac app (a zip), a Linux AppImage and a Windows installer (UDCalc-<version>-win64.msi, and a portable zip). The Mac app updates itself (Calculator > Check for Updates…); the AppImage is updated by Gear Lever or AppImageUpdate. .github/workflows/build.yml builds and tests both on every push (the builds are the run's artifacts), and a v* tag attaches them to its release; the signing, notarization and SPARKLE_PRIVATE_KEY secrets live in the repository's production environment.

Building and testing

The familiar way, with what .github/pins.env names (the GNUstep stack gnustep-patches publishes; Sparkle's XCFramework in .deps/ on the Mac, which gnustep-release-actions' scripts/deps.sh apple fetches):

make && make check && make install           # GNUstep: the unit tests, and the self-test's
                                             # Arithmetic and Updates scenarios, headless
make -f Makefile.apple && make -f Makefile.apple check   # macOS

GNUstep's tests need xctest (part of that stack). If you add new classes to the app that you want to test, add them to the CalculatorTests makefile too.

Self-test (use cases, end to end)

Calculator --self-test [filter] runs the app and drives it from inside, one use case at a time: buttons are clicked, shortcuts are sent as key events and menu items are chosen from the main menu, so actions take the user's path through the responder chain. Each Given/When/Then step prints PASS or FAIL and the app exits with the number of failures. The scenarios live in Calculator/UDSelfTest.m.

Headless, with a throwaway home so your own settings are not touched:

cd Calculator && make && cd ..
Tests/run-self-test.sh              # every scenario
Tests/run-self-test.sh menu         # features/scenarios whose name contains "menu"
FIRST_RESPONDER=1 Tests/run-self-test.sh   # leave menu items on the First Responder

Inside a running Gershwin session, Calculator.app/Calculator --self-test runs against the real desktop.

Trying it on Gershwin (dev) in Docker

Tests/gershwin-dev/ builds Gershwin's unstable desktop from source in a container you look at over VNC, with UDCalc built from this checkout and started in it:

Tests/gershwin-dev/run.sh build      # once, ~30-40 min
Tests/gershwin-dev/run.sh desktop    # open vnc://localhost:5900 (password: gershwin)
Tests/gershwin-dev/run.sh selftest   # the self-test against that build

See Tests/gershwin-dev/README.md.

About

A clone of Apple's standard Mac OS Calculator app

Resources

Stars

15 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages