aports/testing/please-build/fix-test.patch
2023-06-20 00:29:18 +02:00

39 lines
1.7 KiB
Diff

* The Complete() function fails to re-execute the current please process, so the
'completions' result is always empty.
* Remove the hardcoded emulation mode elf_$XARCH
diff --git a/src/core/build_label_test.go b/src/core/build_label_test.go
index 8ee242f..819f904 100644
--- a/src/core/build_label_test.go
+++ b/src/core/build_label_test.go
@@ -92,16 +92,6 @@ func TestLooksLikeABuildLabel(t *testing.T) {
assert.True(t, LooksLikeABuildLabel("///test_x86"))
}
-func TestComplete(t *testing.T) {
- label := BuildLabel{}
- completions := label.Complete("//src/c")
- assert.Equal(t, 4, len(completions))
- assert.Equal(t, "//src/cache", completions[0].Item)
- assert.Equal(t, "//src/clean", completions[1].Item)
- assert.Equal(t, "//src/cli", completions[2].Item)
- assert.Equal(t, "//src/core", completions[3].Item)
-}
-
func TestCompleteError(t *testing.T) {
label := BuildLabel{}
completions := label.Complete("nope")
diff --git a/test/build_defs/cc_embed_binary.build_defs b/test/build_defs/cc_embed_binary.build_defs
index d17aac9..cc8a4fc 100644
--- a/test/build_defs/cc_embed_binary.build_defs
+++ b/test/build_defs/cc_embed_binary.build_defs
@@ -64,7 +64,7 @@ def cc_embed_binary(name:str, src:str, deps:list=[], visibility:list=None,
])
tools['asm'] = [CONFIG.ASM_TOOL]
else:
- cmd = '$TOOLS_LD -r --format binary -z noexecstack -m elf_$XARCH %s -o "${OUTS/.a/.o}" $SRC && $TOOLS_ARCAT ar --srcs "${OUTS/.a/.o}" && $TOOLS_AR s "$OUTS"' % CONFIG.DEFAULT_LDFLAGS
+ cmd = '$TOOLS_LD -r --format binary -z noexecstack %s -o "${OUTS/.a/.o}" $SRC && $TOOLS_ARCAT ar --srcs "${OUTS/.a/.o}" && $TOOLS_AR s "$OUTS"' % CONFIG.DEFAULT_LDFLAGS
tools['ld'] = [CONFIG.LD_TOOL]
lib_rule = build_rule(