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
+8 -6
View File
@@ -19,7 +19,7 @@ static void getSlots(WrenVM* vm)
if (length != 5) result = false;
if (memcmp(bytes, "by\0te", length) != 0) result = false;
if (wrenGetSlotDouble(vm, 3) != 12.34) result = false;
if (wrenGetSlotDouble(vm, 3) != 1.5) result = false;
if (strcmp(wrenGetSlotString(vm, 4), "str") != 0) result = false;
WrenHandle* handle = wrenGetSlotHandle(vm, 5);
@@ -28,13 +28,14 @@ static void getSlots(WrenVM* vm)
{
// Otherwise, return the value so we can tell if we captured it correctly.
wrenSetSlotHandle(vm, 0, handle);
wrenReleaseHandle(vm, handle);
}
else
{
// If anything failed, return false.
wrenSetSlotBool(vm, 0, false);
}
wrenReleaseHandle(vm, handle);
}
static void setSlots(WrenVM* vm)
@@ -43,7 +44,7 @@ static void setSlots(WrenVM* vm)
wrenSetSlotBool(vm, 1, true);
wrenSetSlotBytes(vm, 2, "by\0te", 5);
wrenSetSlotDouble(vm, 3, 12.34);
wrenSetSlotDouble(vm, 3, 1.5);
wrenSetSlotString(vm, 4, "str");
// TODO: wrenSetSlotNull().
@@ -57,21 +58,22 @@ static void setSlots(WrenVM* vm)
const char* bytes = wrenGetSlotBytes(vm, 2, &length);
if (length != 5) result = false;
if (memcmp(bytes, "by\0te", length) != 0) result = false;
if (wrenGetSlotDouble(vm, 3) != 12.34) result = false;
if (wrenGetSlotDouble(vm, 3) != 1.5) result = false;
if (strcmp(wrenGetSlotString(vm, 4), "str") != 0) result = false;
if (result)
{
// Move the value into the return position.
wrenSetSlotHandle(vm, 0, handle);
wrenReleaseHandle(vm, handle);
}
else
{
// If anything failed, return false.
wrenSetSlotBool(vm, 0, false);
}
wrenReleaseHandle(vm, handle);
}
static void slotTypes(WrenVM* vm)
+1 -1
View File
@@ -18,7 +18,7 @@ foreign class ForeignType {
System.print(Slots.noSet == Slots) // expect: true
var value = ["value"]
System.print(Slots.getSlots(true, "by\0te", 12.34, "str", value) == value)
System.print(Slots.getSlots(true, "by\0te", 1.5, "str", value) == value)
// expect: true
System.print(Slots.setSlots(value, 0, 0, 0) == value)