Add librustzcash tests to the full test suite.
This commit is contained in:
parent
c7f1ec471e
commit
7767f8e9e0
|
@ -126,13 +126,33 @@ def util_test():
|
||||||
env={'PYTHONPATH': repofile('src/test'), 'srcdir': repofile('src')}
|
env={'PYTHONPATH': repofile('src/test'), 'srcdir': repofile('src')}
|
||||||
) == 0
|
) == 0
|
||||||
|
|
||||||
|
def rust_test():
|
||||||
|
target_dir = os.path.join(REPOROOT, 'target', 'x86_64-unknown-linux-gnu')
|
||||||
|
if not os.path.isdir(target_dir):
|
||||||
|
arch_dirs = glob(os.path.join(REPOROOT, 'target', 'x86_64-apple-darwin*'))
|
||||||
|
if arch_dirs:
|
||||||
|
# Just try the first one; there will only be on in CI
|
||||||
|
target_dir = arch_dirs[0]
|
||||||
|
|
||||||
|
if os.path.isdir(target_dir):
|
||||||
|
# cargo build --tests will produce a binary named something
|
||||||
|
# like rustzcash-b38184f84aaf9146 (see also https://github.com/rust-lang/cargo/issues/1924)
|
||||||
|
# so let's find it and run it.
|
||||||
|
test_files = glob(os.path.join(target_dir, 'release', 'rustzcash*'))
|
||||||
|
for candidate in test_files:
|
||||||
|
if candidate[-2::] != ".d":
|
||||||
|
# Only one test target to run
|
||||||
|
return subprocess.call([candidate]) == 0
|
||||||
|
|
||||||
|
# Didn't manage to run anything
|
||||||
|
return False
|
||||||
#
|
#
|
||||||
# Tests
|
# Tests
|
||||||
#
|
#
|
||||||
|
|
||||||
STAGES = [
|
STAGES = [
|
||||||
'check-depends',
|
'check-depends',
|
||||||
|
'rust-test',
|
||||||
'btest',
|
'btest',
|
||||||
'gtest',
|
'gtest',
|
||||||
'sec-hard',
|
'sec-hard',
|
||||||
|
@ -145,6 +165,7 @@ STAGES = [
|
||||||
|
|
||||||
STAGE_COMMANDS = {
|
STAGE_COMMANDS = {
|
||||||
'check-depends': ['qa/zcash/test-depends-sources-mirror.py'],
|
'check-depends': ['qa/zcash/test-depends-sources-mirror.py'],
|
||||||
|
'rust-test': rust_test,
|
||||||
'btest': [repofile('src/test/test_bitcoin'), '-p'],
|
'btest': [repofile('src/test/test_bitcoin'), '-p'],
|
||||||
'gtest': [repofile('src/zcash-gtest')],
|
'gtest': [repofile('src/zcash-gtest')],
|
||||||
'sec-hard': check_security_hardening,
|
'sec-hard': check_security_hardening,
|
||||||
|
|
|
@ -79,7 +79,7 @@ $(CARGO_CONFIGURED): $(top_srcdir)/.cargo/config.offline
|
||||||
endif
|
endif
|
||||||
|
|
||||||
cargo-build: $(CARGO_CONFIGURED)
|
cargo-build: $(CARGO_CONFIGURED)
|
||||||
$(RUST_ENV_VARS) $(CARGO) build $(RUST_BUILD_OPTS) --manifest-path $(top_srcdir)/Cargo.toml
|
$(RUST_ENV_VARS) $(CARGO) build --lib --tests $(RUST_BUILD_OPTS) --manifest-path $(top_srcdir)/Cargo.toml
|
||||||
|
|
||||||
if TARGET_WINDOWS
|
if TARGET_WINDOWS
|
||||||
LIBRUSTZCASH_WIN=$(top_builddir)/target/$(RUST_TARGET)/release/rustzcash.lib
|
LIBRUSTZCASH_WIN=$(top_builddir)/target/$(RUST_TARGET)/release/rustzcash.lib
|
||||||
|
|
Loading…
Reference in New Issue