|
CommandLine
Manipulating Pharo from the command-line.
Command-line Scripts with a Headless PharoFor some tasks like benchmarking and automated testing, an integration with other tools comes in handy. For such use cases, Pharo can be used headless, i.e., without its graphical user interface. This brief tutorial will demonstrate how to use the Debian Language Shootout benchmarks with a fresh Pharo image. Step 1: Setup Pharo and a Fresh Image
download page like this: "Squeak 4.2.1beta1U.app/Contents/MacOS/Squeak VM Opt" \
pharo1.0-10418-BETAdev09.08.3.imageStep 2: Load OSProcessFor output on the shell, we need an extra package from the SqueakSource repository. It can be loaded by simply executing the following code in a workspace window: ScriptLoader loadLatestPackage: 'OSProcess' from: 'http://www.squeaksource.com/OSProcess' To execute this code snippet, select it and press cmd+d or use the "do it" item in the context menu. Step 3: Load Common Benchmark CodeNow we can load the common parts of all shootout benchmarks into our image.
] and save it to a file called common.st.
Now you can close all windows in your image and save and quit it. Step 4: Run a Benchmark
]
Tests fannkuch.
SmalltalkImage current snapshot: false andQuit: true.
"Squeak 4.2.1beta1U.app/Contents/MacOS/Squeak VM Opt" \
-headless pharo1.0-10418-BETAdev09.08.3.image \
$PWD/fannkuch.st 6
|
Could someone package this as an installer (MSI, DMG, DEB), or better yet, include this as part of the normal Pharo installation process? The CLI program could be called "pharo".