From 3f1267a420bba647289fa907fd285bbc5169de3b Mon Sep 17 00:00:00 2001 From: Vincent Rischmann Date: Mon, 28 Dec 2020 23:34:49 +0100 Subject: rename is_ci to in_memory --- build.zig | 4 ++-- sqlite.zig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.zig b/build.zig index d5cfad9..c639475 100644 --- a/build.zig +++ b/build.zig @@ -14,11 +14,11 @@ pub fn build(b: *Builder) void { linkAll(lib); lib.install(); - const is_ci = b.option(bool, "is_ci", "Identifies if it runs in a CI environment") orelse false; + const in_memory = b.option(bool, "in_memory", "Should the tests run with sqlite in memory") orelse false; var main_tests = b.addTest("sqlite.zig"); main_tests.setBuildMode(mode); - main_tests.addBuildOption(bool, "is_ci", is_ci); + main_tests.addBuildOption(bool, "in_memory", in_memory); linkAll(main_tests); const test_step = b.step("test", "Run library tests"); diff --git a/sqlite.zig b/sqlite.zig index abc8dce..b756fd8 100644 --- a/sqlite.zig +++ b/sqlite.zig @@ -790,7 +790,7 @@ test "sqlite: db pragma" { testing.expect(foreign_keys != null); testing.expectEqual(@as(usize, 0), foreign_keys.?); - if (build_options.is_ci) { + if (build_options.in_memory) { const journal_mode = try db.pragma( []const u8, "journal_mode", @@ -1186,7 +1186,7 @@ test "sqlite: statement iterator" { } fn dbMode() Db.Mode { - return if (build_options.is_ci) blk: { + return if (build_options.in_memory) blk: { break :blk .{ .Memory = {} }; } else blk: { const path = "/tmp/zig-sqlite.db"; -- cgit v1.2.3 From 66d8994626d0393c14443b45a03c401f9929e0dd Mon Sep 17 00:00:00 2001 From: Vincent Rischmann Date: Mon, 28 Dec 2020 23:35:27 +0100 Subject: ci: rename is_ci to in_memory also test both modes --- .builds/alpine-edge-amd64.yml | 7 ++++++- .builds/debian-stable-aarch64.yml | 8 ++++++-- .builds/debian-stable-amd64.yml | 7 ++++++- .builds/freebsd-latest-amd64.yml | 7 ++++++- .github/workflows/main.yml | 5 ++++- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.builds/alpine-edge-amd64.yml b/.builds/alpine-edge-amd64.yml index dc6f34f..6ff1f53 100644 --- a/.builds/alpine-edge-amd64.yml +++ b/.builds/alpine-edge-amd64.yml @@ -17,9 +17,14 @@ tasks: tar xJf ~/zig.tar.xz mv ~/zig-linux-* ~/zig-master echo "export PATH=$PATH:~/zig-master" >> ~/.buildenv + - test: | cd zig-sqlite - TERM=dumb zig build test -Dis_ci + TERM=dumb zig build test + + - test_in_memory: | + cd zig-sqlite + TERM=dumb zig build test -Din_memory triggers: - action: email diff --git a/.builds/debian-stable-aarch64.yml b/.builds/debian-stable-aarch64.yml index 8c4464e..f3508b7 100644 --- a/.builds/debian-stable-aarch64.yml +++ b/.builds/debian-stable-aarch64.yml @@ -17,9 +17,13 @@ tasks: mv ~/zig-linux-* ~/zig-master echo "export PATH=$PATH:~/zig-master" >> ~/.buildenv - - test_with_system_library: | + - test: | cd zig-sqlite - TERM=dumb zig build test -Dis_ci + TERM=dumb zig build test + + - test_in_memory: | + cd zig-sqlite + TERM=dumb zig build test -Din_memory triggers: - action: email diff --git a/.builds/debian-stable-amd64.yml b/.builds/debian-stable-amd64.yml index eea85e4..856e61c 100644 --- a/.builds/debian-stable-amd64.yml +++ b/.builds/debian-stable-amd64.yml @@ -16,9 +16,14 @@ tasks: tar xJf ~/zig.tar.xz mv ~/zig-linux-* ~/zig-master echo "export PATH=$PATH:~/zig-master" >> ~/.buildenv + - test: | cd zig-sqlite - TERM=dumb zig build test -Dis_ci + TERM=dumb zig build test + + - test_in_memory: | + cd zig-sqlite + TERM=dumb zig build test -Din_memory triggers: - action: email diff --git a/.builds/freebsd-latest-amd64.yml b/.builds/freebsd-latest-amd64.yml index 784ce6a..e6200bb 100644 --- a/.builds/freebsd-latest-amd64.yml +++ b/.builds/freebsd-latest-amd64.yml @@ -16,9 +16,14 @@ tasks: tar xJf ~/zig.tar.xz mv ~/zig-freebsd-* ~/zig-master echo "export PATH=$PATH:~/zig-master" >> ~/.buildenv + - test: | cd zig-sqlite - TERM=dumb zig build test -Dis_ci + TERM=dumb zig build test + + - test_in_memory: | + cd zig-sqlite + TERM=dumb zig build test -Din_memory triggers: - action: email diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a6d92f..ead0083 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,5 +26,8 @@ jobs: - name: Build run: zig build - - name: Run Tests + - name: Run Tests with filesystem + run: zig build test + + - name: Run Tests in memory run: zig build test -- cgit v1.2.3