Files
nvm/test/installation_node/install from source with thread parameter
Peter Dave Hello eb0c8b95c8 [Tests] Verify explicit make jobs without redundant source builds
Exercise both argument orders and multiple job counts against the existing fake source fixture,
checking the actual build and install make arguments.
Use an isolated offline cache and a conflicting inherited job count to catch regressions that a successful real compilation alone cannot detect.

Keep a real source build with explicit jobs in each installation suite,
but remove the redundant serial compilation and make installation failures and version mismatches fail the test immediately.
2026-11-26 03:13:13 +08:00

22 lines
815 B
Bash
Executable File

#!/bin/sh
die () { echo "$@" >&2; exit 1; }
\. ../../nvm.sh
NVM_TEST_VERSION=v0.10.7
# Keep one real source build with an explicit job count. The fast test
# "nvm install passes explicit make jobs" checks both argument orders and
# the actual make arguments, including the single-job case.
nvm deactivate || die 'deactivate failed'
if nvm_is_version_installed "${NVM_TEST_VERSION}"; then
nvm uninstall "${NVM_TEST_VERSION}" || die 'uninstall failed'
fi
nvm install -j 2 -s "${NVM_TEST_VERSION}" || die "'nvm install -j 2 -s ${NVM_TEST_VERSION}' failed"
nvm_is_version_installed "${NVM_TEST_VERSION}" || die 'version not installed'
ACTUAL="$(nvm run --silent "${NVM_TEST_VERSION}" --version)" || die 'installed node failed'
[ "${ACTUAL}" = "${NVM_TEST_VERSION}" ] || die "unexpected node version: ${ACTUAL}"