30 lines
982 B
Go
30 lines
982 B
Go
// Copyright (c) 2026 Storm Dragon
|
|
// Authors: Storm Dragon, Angus Kola
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package atspi
|
|
|
|
import (
|
|
"os/exec"
|
|
"path/filepath"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestTextBoundaryAvoidsProviderEllipsisAbort(t *testing.T) {
|
|
flags, err := exec.Command("pkg-config", "--cflags", "--libs", "atspi-2").CombinedOutput()
|
|
if err != nil {
|
|
t.Fatalf("native text dependencies: %v: %s", err, flags)
|
|
}
|
|
binary := filepath.Join(t.TempDir(), "text-boundary")
|
|
args := []string{"-Wall", "-Wextra", "-Werror", "-Wno-unused-parameter", "-I.",
|
|
"adapter_text_boundary.c", "testdata/text_boundary.c", "-o", binary}
|
|
args = append(args, strings.Fields(string(flags))...)
|
|
if output, err := exec.Command("cc", args...).CombinedOutput(); err != nil {
|
|
t.Fatalf("compile native boundary regression: %v: %s", err, output)
|
|
}
|
|
if output, err := exec.Command(binary).CombinedOutput(); err != nil {
|
|
t.Fatalf("native boundary regression: %v: %s", err, output)
|
|
}
|
|
}
|