. "$BST_LIB" # BST-TIMEOUT: 1800 # gsl — the GNU Scientific Library, closed on UPSTREAM'S OWN per-module test # drivers. OpenEmbedded wires no ptest for gsl, so the meta-brintos bbappend # builds automake's check_PROGRAMS (`make check TESTS=`, which links them and # runs nothing) and installs the resulting binaries flat under # ${libexecdir}/gsl-tests, one file per driver, named for its module. # # WHY THAT IS THE WHOLE GATE. Each driver is self-contained: its expected values # are compiled in, it reads no shipped payload, it needs no network peer and no # TTY, and it prints its own verdict. Between them they make tens of millions of # floating-point assertions — specfunc 54.8M, linalg 35.4M, bspline 19.1M — # which makes this the most thorough check of the wasm32-hwjs toolchain's # floating-point behaviour on the image. # # THIS IS ONE SUITE IN TWO FILES, AND THE SPLIT IS A MEASUREMENT, NOT A TASTE. # Run whole it took 959 s on target (native x86-64: 92 s, so ~10x). The packager # README sets a suite's declared bound at ~3x its measured time, and # BST_SUITE_TIMEOUT_MAX caps any marker at 2400 — so a single file could be # given only 2.5x headroom, at the hard ceiling, with nowhere to go if a loaded # host slows it. Split by measured cost the two halves are ~460 s and ~410 s, # each declaring 1800. `--suite 76-gsl` selects BOTH (the selector is a # substring match), so the ticket gate and the nightly need no change. # 76-gsl-heavy.test carries the five most expensive drivers and nothing else; # this file carries the payload assertions and the other 51. # # WHAT A CORRECT RUN LOOKS LIKE WAS FIXED NATIVELY BEFORE ANY wasm32 RESULT WAS # READ: an x86-64 build of the identical 2.7.1 tree runs all 57 drivers to # `Completed [N/N]` with exit 0. So the verdict in gsl-run.sh is exit 0 AND a # summary whose two counts are equal — not merely exit 0, and not a substring of # the output. # # $BST_GSL_ROOT prefixes every path so this file can be validated against a # native /usr-shaped install before it ships. Empty on target, which is the only # value the image ever sees. . "$BST_DATA/gsl-run.sh" R=${BST_GSL_ROOT:-} # ------------------------------------------------------------------ payload --- # The library the drivers were linked against, asserted directly. They are # STATIC binaries and would run identically with none of this installed, so a # suite that only ran the drivers could report a green port that shipped no # library at all. check gsl/lib-present test -f "$R/usr/lib/libgsl.a" check gsl/lib-nonempty test -s "$R/usr/lib/libgsl.a" check_out gsl/lib-archive "!" head -c 8 "$R/usr/lib/libgsl.a" check gsl/cblas-present test -f "$R/usr/lib/libgslcblas.a" check_out gsl/cblas-archive "!" head -c 8 "$R/usr/lib/libgslcblas.a" check gsl/header-math test -f "$R/usr/include/gsl/gsl_math.h" check gsl/header-vector test -f "$R/usr/include/gsl/gsl_vector.h" check gsl/header-matrix test -f "$R/usr/include/gsl/gsl_matrix.h" check gsl/header-rng test -f "$R/usr/include/gsl/gsl_rng.h" check gsl/header-sf test -f "$R/usr/include/gsl/gsl_sf.h" check gsl/header-cblas test -f "$R/usr/include/gsl/gsl_cblas.h" # The version is read from the header the image ships, so a recipe bump that # forgets this file is visible here rather than in a stale comment. check_out gsl/version-string "#define GSL_VERSION \"2.7.1\"" cat "$R/usr/include/gsl/gsl_version.h" check_out gsl/version-major "#define GSL_MAJOR_VERSION 2" cat "$R/usr/include/gsl/gsl_version.h" check_out gsl/version-minor "#define GSL_MINOR_VERSION 7" cat "$R/usr/include/gsl/gsl_version.h" # pkg-config: the one place on target that states the port's version and its # link line, and what a future recipe's PKG_CHECK_MODULES reads. check gsl/pc-present test -f "$R/usr/lib/pkgconfig/gsl.pc" check_out gsl/pc-name "Name: GSL" cat "$R/usr/lib/pkgconfig/gsl.pc" check_out gsl/pc-version "Version: 2.7.1" cat "$R/usr/lib/pkgconfig/gsl.pc" check_out gsl/pc-libs "-lgsl" cat "$R/usr/lib/pkgconfig/gsl.pc" # Static-only is distro policy (brintos.conf's --disable-shared) and gsl's # autotools build defaults to a shared library, so a stray libgsl.so here would # mean that override was lost on this recipe. check gsl/no-shared sh -c 'set -- '"$R"'/usr/lib/libgsl.so*; [ ! -e "$1" ]' check gsl/no-cblas-shared sh -c 'set -- '"$R"'/usr/lib/libgslcblas.so*; [ ! -e "$1" ]' check gsl/no-libtool sh -c 'set -- '"$R"'/usr/lib/libgsl.la; [ ! -e "$1" ]' # gsl-config is the only part of the port a user drives directly, and it is # asserted for BEHAVIOUR rather than presence. check gsl/config-present test -f "$R/usr/bin/gsl-config" check_out gsl/config-version "2.7.1" sh -c "$R/usr/bin/gsl-config --version" # The excluded driver is PINNED, not forgotten. `integration` is absent because # the coroutinize pass refuses `main` in integration/test # (fpcast-param-coerce, brintos/hwjs-cc#56) and the bbappend excludes it by name # so the refusal cannot fail the image. This case is green while the platform is # broken and goes RED the day integration/test starts linking — which is the # notification this port wants, because at that point the driver should be added # back to both lists rather than staying silently absent. check gsl/refused-integration-absent sh -c '[ ! -e '"$GSLT"'/integration ]' # ------------------------------------------------------------------ drivers --- # Upstream's check_PROGRAMS in SUBDIRS order, less `integration` (above) and # less the five in 76-gsl-heavy.test. The three non-`test` entries are last: # complex-c11 is the C11 _Complex spelling of the complex API, and # matrix-static/vector-static re-run the same assertions against the STATIC # INLINE accessors rather than the compiled ones — a different code path on any # compiler, and worth checking on a young one. gsl_run_all "sys err bst const complex cheb block vector matrix permutation combination multiset sort ieee-utils cblas eigen specfunc dht qrng randist fft poly fit multifit multilarge multilarge_nlinear filter rstat statistics siman sum interpolation histogram ode-initval roots multiroots min multimin monte ntuple diff deriv cdf wavelet bspline spblas spmatrix splinalg complex-c11 matrix-static vector-static"