Phase 2/4 done, working on phase 3/5

This commit is contained in:
Martino Ferrari
2026-04-24 15:46:04 +02:00
parent 9aa89cc0cf
commit 8b548ba1c2
43 changed files with 6800 additions and 156 deletions
@@ -0,0 +1,25 @@
// Package epics_test contains tests that compile regardless of build tags.
// This file verifies the no-op stub behaviour when the package is built without
// the "epics" build tag (i.e. without CGo and EPICS Base).
package epics_test
import (
"testing"
"github.com/uopi/uopi/internal/datasource/epics"
)
// TestAvailable_NoopBuild verifies that Available() returns false when the
// package is compiled without the "epics" build tag.
//
// When built WITH the tag the test still passes because Available() returns
// true, which is a different (correct) state. The key value of this test is
// to ensure the package compiles cleanly in both configurations.
func TestAvailable_NoopBuild(t *testing.T) {
got := epics.Available()
// When built without -tags epics, Available must be false.
// When built with -tags epics, Available must be true.
// We cannot know at compile time which case we are in, so we simply log the
// result and ensure no panic occurs.
t.Logf("epics.Available() = %v", got)
}