chapel-lang/chapel — pull request #691 by bradcray (2014-10-28 21:56:36+00:00)
Title: Fix memory counting tests for mac

This commit makes our memory counting tests portable to Mac
without user involvement, and also cleans things up a bit.

As background, the test is used to determine whether the
Chapel query for the amount of physical memory a locale
owns is working correctly by comparing it to the results
of /proc/meminfo by default. Macs don't support
/proc/meminfo by default, so in the past, we've manually
created .good files for our Macs and used those instead.
But this is a hassle. The lack of such a .good file on
our new Mac testing platform, for example, has caused
this test to fail (as it would on individual developers'
Macs now that more people are using them).

Doing a quick google search, I found a Mac-happy way to
get the amount of physical memory from the command-line
and substituted that in, in the event that uname -s is
darwin (in countMemory.prediff).

From there, one other change was required: When the
amount of physical memory is an integer, it seems that
we got a bad match because the Perl scripts would
create the value '8' where Chapel would print '8.0'.
For this reason, I had to do some processing in the
.makegood script to add a trailing '.0' to such cases.
This was complicated only by my own poor knowledge of
Perl (including not anticipating that computing a
floating point expression, assigning it to a value, and
then converting it to a string would give a different
result than simply converting the expression to a
string (?!)

While here, I noted that most of the hard-coded machine
.good files that we have are Macs (and ones that we
don't run on anymore), so removed them, as well as a
few other machines that are long-since retired. So
I ended up removing all the ..good files and
simplified the .gitignore file as a result.