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:
+1
-1
@@ -11,7 +11,7 @@ import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
LIB_UV_VERSION = "v1.8.0"
|
||||
LIB_UV_VERSION = "v1.10.0"
|
||||
LIB_UV_DIR = "deps/libuv"
|
||||
|
||||
def python2_binary():
|
||||
|
||||
+19
-6
@@ -2,6 +2,7 @@
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from collections import defaultdict
|
||||
from os import listdir
|
||||
from os.path import abspath, basename, dirname, isdir, isfile, join, realpath, relpath, splitext
|
||||
@@ -10,10 +11,22 @@ from subprocess import Popen, PIPE
|
||||
import sys
|
||||
from threading import Timer
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument('--suffix', default='d')
|
||||
parser.add_argument('suite', nargs='?')
|
||||
|
||||
args = parser.parse_args(sys.argv[1:])
|
||||
|
||||
config=args.suffix.lstrip('d')
|
||||
is_debug=args.suffix.startswith('d')
|
||||
config_dir=("debug" if is_debug else "release") + config
|
||||
# Runs the tests.
|
||||
WREN_DIR = dirname(dirname(realpath(__file__)))
|
||||
WREN_APP = join(WREN_DIR, 'bin', 'wrend')
|
||||
TEST_APP = join(WREN_DIR, 'build', 'debug', 'test', 'wrend')
|
||||
WREN_APP = join(WREN_DIR, 'bin', 'wren' + args.suffix)
|
||||
TEST_APP = join(WREN_DIR, 'build', config_dir, 'test', 'wren' + args.suffix)
|
||||
|
||||
print("WREN_APP=" + WREN_APP)
|
||||
print("TEST_APP=" + TEST_APP)
|
||||
|
||||
EXPECT_PATTERN = re.compile(r'// expect: ?(.*)')
|
||||
EXPECT_ERROR_PATTERN = re.compile(r'// expect error(?! line)')
|
||||
@@ -114,7 +127,7 @@ class Test:
|
||||
test_arg = self.path
|
||||
proc = Popen([app, test_arg], stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
||||
|
||||
# If a test takes longer than two seconds, kill it.
|
||||
# If a test takes longer than five seconds, kill it.
|
||||
#
|
||||
# This is mainly useful for running the tests while stress testing the GC,
|
||||
# which can make a few pathological tests much slower.
|
||||
@@ -123,7 +136,7 @@ class Test:
|
||||
timed_out[0] = True
|
||||
p.kill()
|
||||
|
||||
timer = Timer(2, kill_process, [proc])
|
||||
timer = Timer(5, kill_process, [proc])
|
||||
|
||||
try:
|
||||
timer.start()
|
||||
@@ -313,9 +326,9 @@ def run_script(app, path, type):
|
||||
return
|
||||
|
||||
# Check if we are just running a subset of the tests.
|
||||
if len(sys.argv) == 2:
|
||||
if args.suite:
|
||||
this_test = relpath(path, join(WREN_DIR, 'test'))
|
||||
if not this_test.startswith(sys.argv[1]):
|
||||
if not this_test.startswith(args.suite):
|
||||
return
|
||||
|
||||
# Update the status line.
|
||||
|
||||
@@ -42,6 +42,7 @@ ifeq ($(VERBOSE),1)
|
||||
V :=
|
||||
endif
|
||||
|
||||
C_OPTIONS := $(WREN_CFLAGS)
|
||||
C_WARNINGS := -Wall -Wextra -Werror -Wno-unused-parameter
|
||||
# Wren uses callbacks heavily, so -Wunused-parameter is too painful to enable.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user