我想开始为我的Mathematica程序编写一些单元测试,并使用一些Makefiles控制命令行中的所有内容。从Mac OS X上的命令行以批处理模式处理Mathematica
看起来像Mathematica can be run from the command line,但我看不到有关在Mac OS X上做这件事的任何基本说明 - 有没有人做过此事?
更新:
创建一个测试文件是这样的:
Print["hello"]; x := 1; y = x+1; z = y+1; Print["y="[email protected]]; Print["z="[email protected]]; Quit[];
而且随着
/Applications/Mathematica.app/Contents/MacOS/MathKernel -noprompt < test.m
运行它是最接近我能得到某种批量处理。虽然输出看起来很丑陋;换行符被添加到脚本的每一行!
"hello" "y=2" "z=3"
这是我能找到的还能输出信息到控制台输出的脚本的最接近的东西吗?我只使用Mathematica 6,但我希望这不会有所作为。
你看着混搭:HTTP://ai.eecs。 umich.edu/people/dreeves/mash/? – Pillsy 2009-10-22 14:40:43