Fix BSD tests.

This commit is contained in:
Nuno Cruces
2023-12-12 02:03:02 +00:00
parent 05077b8845
commit 86cc08e4d6
2 changed files with 9 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ jobs:
go-version: stable
- name: Build
run: GOOS=freebsd go test -c ./...
run: GOOS=freebsd go test -c . ./vfs/... ./tests/...
- name: Test
uses: cross-platform-actions/action@v0.21.1
@@ -26,4 +26,7 @@ jobs:
operating_system: freebsd
version: '13.2'
sync_files: runner-to-vm
run: find . -name '*.test' -maxdepth 1 -exec {} -test.v \;
run: |
foreach test ( *.test )
./$test -test.v || exit $?
end

View File

@@ -60,7 +60,7 @@ func TestMultiProcess(t *testing.T) {
"&_pragma=journal_mode(truncate)" +
"&_pragma=synchronous(off)"
cmd := exec.Command("go", "test", "-v", "-run", "TestChildProcess")
cmd := exec.Command(os.Args[0], append(os.Args[1:], "-test.v", "-test.run=TestChildProcess")...)
out, err := cmd.StdoutPipe()
if err != nil {
t.Fatal(err)
@@ -71,8 +71,10 @@ func TestMultiProcess(t *testing.T) {
var buf [3]byte
// Wait for child to start.
if _, err := io.ReadFull(out, buf[:]); err != nil || string(buf[:]) != "===" {
if _, err := io.ReadFull(out, buf[:]); err != nil {
t.Fatal(err)
} else if str := string(buf[:]); str != "===" {
t.Fatal(str)
}
testParallel(t, name, 1000)