feat: add multi-arch CI matrix with nan-tagging toggle and 32-bit test suite

Add Travis CI configuration to build and test Wren on both Linux and macOS, for both 32-bit and 64-bit architectures, with and without WREN_NAN_TAGGING defined. Introduce `ci_32` and `ci_64` make targets that build debug/release and C/C++ variants, then run the test suite against each binary using a suffix parameter. Update `util/test.py` with argparse to accept `--suffix` and `suite` arguments, increase test timeout from 2 to 5 seconds, and fix handle leak in `test/api/slots.c` by moving `wrenReleaseHandle` after the conditional block. Replace `fpclassify`/`signbit` checks for infinity/nan in `wrenNumToString` to avoid GCC overflow warnings on 32-bit, double-cast `double` to `uint32_t` in `num_bitwiseNot` to prevent undefined behavior, and relax floating-point comparisons in `test/core/number/sin.wren` and `cos.wren` to use absolute tolerance. Comment out hex literals larger than `0x1000000` in `example/syntax.wren` since they exceed 32-bit range, and bump libuv from v1.8.0 to v1.10.0 for 32-bit build fixes.
This commit is contained in:
Will Speak
2016-10-09 08:18:27 +00:00
parent ca3cbf9a88
commit 2d578e0051
13 changed files with 81 additions and 26 deletions
+3 -1
View File
@@ -618,7 +618,9 @@ DEF_PRIMITIVE(num_bangeq)
DEF_PRIMITIVE(num_bitwiseNot)
{
// Bitwise operators always work on 32-bit unsigned ints.
RETURN_NUM(~(uint32_t)AS_NUM(args[0]));
uint64_t wideVal = AS_NUM(args[0]);
uint32_t val = wideVal & 0xFFFFFFFF;
RETURN_NUM(~(uint32_t)val);
}
DEF_PRIMITIVE(num_dotDot)
+10 -3
View File
@@ -742,9 +742,16 @@ Value wrenNumToString(WrenVM* vm, double value)
// Corner case: If the value is NaN, different versions of libc produce
// different outputs (some will format it signed and some won't). To get
// reliable output, handle that ourselves.
if (value != value) return CONST_STRING(vm, "nan");
if (value == INFINITY) return CONST_STRING(vm, "infinity");
if (value == -INFINITY) return CONST_STRING(vm, "-infinity");
switch (fpclassify(value))
{
case FP_INFINITE:
if (signbit(value))
return CONST_STRING(vm, "-infinity");
else
return CONST_STRING(vm, "infinity");
case FP_NAN:
return CONST_STRING(vm, "nan");
}
// This is large enough to hold any double converted to a string using
// "%.14g". Example: