Skip to content

Commit 05743e7

Browse files
committed
fix macos + windows test errors
1 parent c8c6021 commit 05743e7

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
with:
9696
toolchain: stable
9797
- run: cargo build --examples --verbose
98-
- run: make test
98+
- run: make test python=/usr/local/opt/python@3/libexec/bin/python
9999
- name: Upload artifacts
100100
uses: actions/upload-artifact@v2
101101
with:

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
2+
ifdef python
3+
PYTHON=$(python)
4+
else
5+
PYTHON=python3
6+
endif
7+
18
test:
29
cargo test
310
cargo test --features=exec
411
cargo test --features=static
512
cargo build --examples --features=
6-
python3 examples/test-examples.py
13+
$(PYTHON) examples/test-examples.py

examples/test-examples.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ def connect():
1111
db.execute("create table base_modules as select name from pragma_module_list")
1212

1313
db.enable_load_extension(True)
14-
db.load_extension("target/debug/examples/libhello")
14+
try:
15+
db.load_extension("target/debug/examples/libhello")
16+
except:
17+
# windows
18+
db.load_extension("target/debug/examples/hello")
1519

1620
db.execute("create temp table loaded_functions as select name from pragma_function_list where name not in (select name from base_functions) order by name")
1721
db.execute("create temp table loaded_modules as select name from pragma_module_list where name not in (select name from base_modules) order by name")
@@ -38,6 +42,6 @@ def test_funcs(self):
3842
self.assertEqual(hello("null: x\0x"), "hello, null: x\0x!")
3943
#hello("x" * (2_147_483_647 - len("hello, !") - 20) )
4044
#hello("x" * (200) )
41-
45+
4246
if __name__ == '__main__':
43-
unittest.main()
47+
unittest.main()

0 commit comments

Comments
 (0)