Skip to content

Commit

Permalink
fix macos + windows test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
asg017 committed Oct 6, 2023
1 parent c8c6021 commit 05743e7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
with:
toolchain: stable
- run: cargo build --examples --verbose
- run: make test
- run: make test python=/usr/local/opt/python@3/libexec/bin/python
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

ifdef python
PYTHON=$(python)
else
PYTHON=python3
endif

test:
cargo test
cargo test --features=exec
cargo test --features=static
cargo build --examples --features=
python3 examples/test-examples.py
$(PYTHON) examples/test-examples.py
10 changes: 7 additions & 3 deletions examples/test-examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ def connect():
db.execute("create table base_modules as select name from pragma_module_list")

db.enable_load_extension(True)
db.load_extension("target/debug/examples/libhello")
try:
db.load_extension("target/debug/examples/libhello")
except:
# windows
db.load_extension("target/debug/examples/hello")

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")
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")
Expand All @@ -38,6 +42,6 @@ def test_funcs(self):
self.assertEqual(hello("null: x\0x"), "hello, null: x\0x!")
#hello("x" * (2_147_483_647 - len("hello, !") - 20) )
#hello("x" * (200) )

if __name__ == '__main__':
unittest.main()
unittest.main()

0 comments on commit 05743e7

Please sign in to comment.