Skip to content

Commit 5c38a0c

Browse files
author
Harald
committed
Adopt CMake test execution
For the fbs update test of the ObjectBox cmake module This change ensures that a newer fbs file has newer timestap What was not always the case, on a decent fast machine.
1 parent 8069e1d commit 5c38a0c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/integration/cmake/cmake_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"runtime"
1111
"strings"
1212
"testing"
13+
"time"
1314

1415
"github.com/objectbox/objectbox-generator/v4/test/assert"
1516
"github.com/objectbox/objectbox-generator/v4/test/cmake"
@@ -166,7 +167,12 @@ func TestCMakeProjects(t *testing.T) {
166167
// Test updating for just "cpp-flat" using content from "update-cpp-flat" folder.
167168
if project == "cpp-flat" {
168169
t.Logf("**** Update project cpp-flat (task.fbs and main.cpp) ****")
170+
// depending on file system and build tools its possible the previous
171+
// rebuild and copying happens too fast for the build system to detect changes,
172+
// -> delay after the last fbs generation before we 'create' the changed .fbs file
173+
time.Sleep(500 * time.Millisecond)
169174
cmake.CopyDir(wd, filepath.Join("update-cpp-flat", "."), filepath.Join(confDir))
175+
170176
if multiConfigBuild {
171177
configs := []string{"Release", "Debug"}
172178
for _, config := range configs {

0 commit comments

Comments
 (0)