Add simple kotlin,swift, and python integration tests
This commit is contained in:
parent
3bec5d2cab
commit
ee6ee8139a
2
.github/workflows/cont_integration.yml
vendored
2
.github/workflows/cont_integration.yml
vendored
@ -41,7 +41,7 @@ jobs:
|
||||
if: ${{ matrix.rust.clippy }}
|
||||
run: cargo clippy --all-targets -- -D warnings
|
||||
- name: Test
|
||||
run: cargo test
|
||||
run: CLASSPATH=./tests/jna/jna-5.8.0.jar cargo test
|
||||
|
||||
fmt:
|
||||
name: Rust fmt
|
||||
|
@ -3,6 +3,7 @@ name = "bdk-ffi"
|
||||
version = "0.10.0"
|
||||
authors = ["Steve Myers <steve@notmandatory.org>", "Sudarsan Balaji <sudarsan.balaji@artfuldev.com>"]
|
||||
edition = "2018"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[workspace]
|
||||
members = [".","bdk-ffi-bindgen"]
|
||||
|
21
tests/README.md
Normal file
21
tests/README.md
Normal file
@ -0,0 +1,21 @@
|
||||
# Integration tests for bdk-ffi
|
||||
|
||||
This contains simple tests to make sure bdk-ffi can be used as a dependency for each of the
|
||||
supported bindings languages.
|
||||
|
||||
To skip integration tests and only run unit tests use `cargo test --lib`.
|
||||
|
||||
To run all tests including integration tests use `CLASSPATH=./tests/jna/jna-5.8.0.jar cargo test`.
|
||||
|
||||
Before running integration tests you must install the following development tools:
|
||||
|
||||
1. [Java](https://openjdk.org/) and [Kotlin](https://kotlinlang.org/),
|
||||
[sdkman](https://sdkman.io/) can help:
|
||||
```shell
|
||||
sdk install java 11.0.16.1-zulu
|
||||
sdk install kotlin 1.7.20`
|
||||
```
|
||||
|
||||
2. [Swift](https://www.swift.org/)
|
||||
|
||||
3. [Python](https://www.python.org/)
|
8
tests/bindings/test.kts
Normal file
8
tests/bindings/test.kts
Normal file
@ -0,0 +1,8 @@
|
||||
/*
|
||||
* This is a basic test kotlin program that does nothing but confirm that the kotlin bindings compile
|
||||
* and that a program that depends on them will run.
|
||||
*/
|
||||
|
||||
import org.bitcoindevkit.*
|
||||
|
||||
val network = Network.TESTNET
|
15
tests/bindings/test.py
Normal file
15
tests/bindings/test.py
Normal file
@ -0,0 +1,15 @@
|
||||
import unittest
|
||||
from bdk import *
|
||||
|
||||
class TestBdk(unittest.TestCase):
|
||||
|
||||
def test_some_enum(self):
|
||||
network = Network.TESTNET
|
||||
|
||||
def test_some_dict(self):
|
||||
a = AddressInfo(index=42, address="testaddress")
|
||||
self.assertEqual(42, a.index)
|
||||
self.assertEqual("testaddress", a.address)
|
||||
|
||||
if __name__=='__main__':
|
||||
unittest.main()
|
9
tests/bindings/test.swift
Normal file
9
tests/bindings/test.swift
Normal file
@ -0,0 +1,9 @@
|
||||
/*
|
||||
* This is a basic test swift program that does nothing but confirm that the swift bindings compile
|
||||
* and that a program that depends on them will run.
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import bdk
|
||||
|
||||
let network = Network.testnet
|
BIN
tests/jna/jna-5.8.0.jar
Normal file
BIN
tests/jna/jna-5.8.0.jar
Normal file
Binary file not shown.
8
tests/test_generated_bindings.rs
Normal file
8
tests/test_generated_bindings.rs
Normal file
@ -0,0 +1,8 @@
|
||||
uniffi_macros::build_foreign_language_testcases!(
|
||||
["src/bdk.udl",],
|
||||
[
|
||||
"tests/bindings/test.kts",
|
||||
"tests/bindings/test.swift",
|
||||
"tests/bindings/test.py"
|
||||
]
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user