diff options
Diffstat (limited to '')
24 files changed, 220 insertions, 0 deletions
diff --git a/t/recipes/checks/languages/golang/built-using/binaries-golang/build-spec/fill-values b/t/recipes/checks/languages/golang/built-using/binaries-golang/build-spec/fill-values new file mode 100644 index 0000000..20669e9 --- /dev/null +++ b/t/recipes/checks/languages/golang/built-using/binaries-golang/build-spec/fill-values @@ -0,0 +1,5 @@ +Skeleton: upload-native +Testname: binaries-golang +Extra-Build-Depends: golang-go (>= 2:1.1.1-4) +Description: Misc errors related to golang binaries +Package-Architecture: any diff --git a/t/recipes/checks/languages/golang/built-using/binaries-golang/build-spec/orig/Makefile b/t/recipes/checks/languages/golang/built-using/binaries-golang/build-spec/orig/Makefile new file mode 100644 index 0000000..f04b342 --- /dev/null +++ b/t/recipes/checks/languages/golang/built-using/binaries-golang/build-spec/orig/Makefile @@ -0,0 +1,16 @@ +NOPIE_CFLAGS = $(filter-out -fPIE,$(CFLAGS)) +NOPIE_LDFLAGS = $(filter-out -fPIE -pie,$(LDFLAGS)) +COMPILE:= $(CC) $(NOPIE_CFLAGS) $(CPPFLAGS) $(NOPIE_LDFLAGS) + +all: + # static version + $(COMPILE) -static -o basic.static basic.c + +install: + install -d $(DESTDIR)/usr/lib/foo/ + install -m 755 basic.static $(DESTDIR)/usr/lib/foo/static + +clean distclean: + rm -f basic + +check test: diff --git a/t/recipes/checks/languages/golang/built-using/binaries-golang/build-spec/orig/basic.c b/t/recipes/checks/languages/golang/built-using/binaries-golang/build-spec/orig/basic.c new file mode 100644 index 0000000..7dea5a0 --- /dev/null +++ b/t/recipes/checks/languages/golang/built-using/binaries-golang/build-spec/orig/basic.c @@ -0,0 +1,12 @@ +#include <stdio.h> + +int +main(void) +{ + char t[10]; + printf("Hello world!\n"); + /* Bad choice for reading from stdin, but it forces a stack + protector, so meh. + */ + gets (t); +} diff --git a/t/recipes/checks/languages/golang/built-using/binaries-golang/eval/desc b/t/recipes/checks/languages/golang/built-using/binaries-golang/eval/desc new file mode 100644 index 0000000..af9fa03 --- /dev/null +++ b/t/recipes/checks/languages/golang/built-using/binaries-golang/eval/desc @@ -0,0 +1,2 @@ +Testname: binaries-golang +Check: languages/golang/built-using diff --git a/t/recipes/checks/languages/golang/built-using/binaries-golang/eval/hints b/t/recipes/checks/languages/golang/built-using/binaries-golang/eval/hints new file mode 100644 index 0000000..52f68b9 --- /dev/null +++ b/t/recipes/checks/languages/golang/built-using/binaries-golang/eval/hints @@ -0,0 +1 @@ +binaries-golang (source): missing-built-using-field-for-golang-package (in section for binaries-golang) [debian/control:10] diff --git a/t/recipes/checks/languages/golang/import-path/binaries-golang/build-spec/fill-values b/t/recipes/checks/languages/golang/import-path/binaries-golang/build-spec/fill-values new file mode 100644 index 0000000..20669e9 --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/binaries-golang/build-spec/fill-values @@ -0,0 +1,5 @@ +Skeleton: upload-native +Testname: binaries-golang +Extra-Build-Depends: golang-go (>= 2:1.1.1-4) +Description: Misc errors related to golang binaries +Package-Architecture: any diff --git a/t/recipes/checks/languages/golang/import-path/binaries-golang/build-spec/orig/Makefile b/t/recipes/checks/languages/golang/import-path/binaries-golang/build-spec/orig/Makefile new file mode 100644 index 0000000..f04b342 --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/binaries-golang/build-spec/orig/Makefile @@ -0,0 +1,16 @@ +NOPIE_CFLAGS = $(filter-out -fPIE,$(CFLAGS)) +NOPIE_LDFLAGS = $(filter-out -fPIE -pie,$(LDFLAGS)) +COMPILE:= $(CC) $(NOPIE_CFLAGS) $(CPPFLAGS) $(NOPIE_LDFLAGS) + +all: + # static version + $(COMPILE) -static -o basic.static basic.c + +install: + install -d $(DESTDIR)/usr/lib/foo/ + install -m 755 basic.static $(DESTDIR)/usr/lib/foo/static + +clean distclean: + rm -f basic + +check test: diff --git a/t/recipes/checks/languages/golang/import-path/binaries-golang/build-spec/orig/basic.c b/t/recipes/checks/languages/golang/import-path/binaries-golang/build-spec/orig/basic.c new file mode 100644 index 0000000..7dea5a0 --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/binaries-golang/build-spec/orig/basic.c @@ -0,0 +1,12 @@ +#include <stdio.h> + +int +main(void) +{ + char t[10]; + printf("Hello world!\n"); + /* Bad choice for reading from stdin, but it forces a stack + protector, so meh. + */ + gets (t); +} diff --git a/t/recipes/checks/languages/golang/import-path/binaries-golang/eval/desc b/t/recipes/checks/languages/golang/import-path/binaries-golang/eval/desc new file mode 100644 index 0000000..17b4d64 --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/binaries-golang/eval/desc @@ -0,0 +1,2 @@ +Testname: binaries-golang +Check: languages/golang/import-path diff --git a/t/recipes/checks/languages/golang/import-path/binaries-golang/eval/hints b/t/recipes/checks/languages/golang/import-path/binaries-golang/eval/hints new file mode 100644 index 0000000..7886d2b --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/binaries-golang/eval/hints @@ -0,0 +1 @@ +binaries-golang (source): missing-xs-go-import-path-for-golang-package diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/debian/control-file-golang-built-using.install b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/debian/control-file-golang-built-using.install new file mode 100644 index 0000000..c07a6cb --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/debian/control-file-golang-built-using.install @@ -0,0 +1 @@ +static /usr/lib/foo/ diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/debian/control.in b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/debian/control.in new file mode 100644 index 0000000..d060140 --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/debian/control.in @@ -0,0 +1,41 @@ +Source: [% $source %] +Section: net +Priority: optional +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Rules-Requires-Root: [% $rules_requires_root %] +Build-Depends: [% $build_depends %], + golang-go (>= 2:1.1.1-4) + +Package: [% $source %] +Architecture: [% $package_architecture %] +Depends: ${misc:Depends} +Built-Using: ${misc:Built-Using} +Description: [% $description %] + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. It may + be an empty package. + +Package: [% $source %]-dev +Architecture: all +Depends: ${misc:Depends} +Built-Using: ${misc:Built-Using} +Description: [% $description %] (dev) + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. It may + be an empty package. + . + This package contains the source. + +Package: [% $source %]-clean-dev +Architecture: all +Depends: ${misc:Depends} +Description: [% $description %] (clean dev) + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. It may + be an empty package. + . + This package contains the source, without a built-using tag. diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/fill-values b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/fill-values new file mode 100644 index 0000000..2c9dd7d --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/fill-values @@ -0,0 +1,4 @@ +Skeleton: upload-native +Testname: control-file-golang-built-using +Description: False-positive test for Built-Using field +Package-Architecture: any diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/orig/Makefile b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/orig/Makefile new file mode 100644 index 0000000..6047afb --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/orig/Makefile @@ -0,0 +1,12 @@ +NOPIE_CFLAGS = $(filter-out -fPIE,$(CFLAGS)) +NOPIE_LDFLAGS = $(filter-out -fPIE -pie,$(LDFLAGS)) +COMPILE:= $(CC) $(NOPIE_CFLAGS) $(CPPFLAGS) $(NOPIE_LDFLAGS) + +all: + # static version + $(COMPILE) -static -o static basic.c + +clean distclean: + rm -f basic + +check test: diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/orig/basic.c b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/orig/basic.c new file mode 100644 index 0000000..7dea5a0 --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/build-spec/orig/basic.c @@ -0,0 +1,12 @@ +#include <stdio.h> + +int +main(void) +{ + char t[10]; + printf("Hello world!\n"); + /* Bad choice for reading from stdin, but it forces a stack + protector, so meh. + */ + gets (t); +} diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/eval/desc b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/eval/desc new file mode 100644 index 0000000..e0f3c0f --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/eval/desc @@ -0,0 +1,2 @@ +Testname: control-file-golang-built-using +Check: languages/golang/import-path diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/eval/hints b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/eval/hints new file mode 100644 index 0000000..93f0a70 --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-built-using/eval/hints @@ -0,0 +1 @@ +control-file-golang-built-using (source): missing-xs-go-import-path-for-golang-package diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/debian/control-file-golang-xs-go-import-path.install b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/debian/control-file-golang-xs-go-import-path.install new file mode 100644 index 0000000..0ba75d6 --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/debian/control-file-golang-xs-go-import-path.install @@ -0,0 +1 @@ +static usr/lib/foo/ diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/debian/control.in b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/debian/control.in new file mode 100644 index 0000000..0fafdb5 --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/debian/control.in @@ -0,0 +1,41 @@ +Source: [% $source %] +Section: net +Priority: optional +Maintainer: [% $author %] +Standards-Version: [% $standards_version %] +Rules-Requires-Root: [% $rules_requires_root %] +Build-Depends: [% $build_depends %], + golang-go (>= 2:1.1.1-4) +XS-Go-Import-Path: github.com/Debian/lintian-test-package + +Package: [% $source %] +Architecture: [% $package_architecture %] +Depends: ${misc:Depends} +Built-Using: ${misc:Built-Using} +Description: [% $description %] + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. It may + be an empty package. + +Package: [% $source %]-dev +Architecture: all +Depends: ${misc:Depends} +Description: [% $description %] (dev) + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. It may + be an empty package. + . + This package contains the source. + +Package: [% $source %]-clean-dev +Architecture: all +Depends: ${misc:Depends} +Description: [% $description %] (clean dev) + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. It may + be an empty package. + . + This package contains the source, without a built-using tag. diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/fill-values b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/fill-values new file mode 100644 index 0000000..130e255 --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/fill-values @@ -0,0 +1,4 @@ +Skeleton: upload-native +Testname: control-file-golang-xs-go-import-path +Description: False-positive test for XS-Go-Import field +Package-Architecture: any diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/orig/Makefile b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/orig/Makefile new file mode 100644 index 0000000..6047afb --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/orig/Makefile @@ -0,0 +1,12 @@ +NOPIE_CFLAGS = $(filter-out -fPIE,$(CFLAGS)) +NOPIE_LDFLAGS = $(filter-out -fPIE -pie,$(LDFLAGS)) +COMPILE:= $(CC) $(NOPIE_CFLAGS) $(CPPFLAGS) $(NOPIE_LDFLAGS) + +all: + # static version + $(COMPILE) -static -o static basic.c + +clean distclean: + rm -f basic + +check test: diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/orig/basic.c b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/orig/basic.c new file mode 100644 index 0000000..7dea5a0 --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/build-spec/orig/basic.c @@ -0,0 +1,12 @@ +#include <stdio.h> + +int +main(void) +{ + char t[10]; + printf("Hello world!\n"); + /* Bad choice for reading from stdin, but it forces a stack + protector, so meh. + */ + gets (t); +} diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/eval/desc b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/eval/desc new file mode 100644 index 0000000..3281454 --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/eval/desc @@ -0,0 +1,4 @@ +Testname: control-file-golang-xs-go-import-path +Check: languages/golang/import-path +Test-Against: + missing-xs-go-import-path-for-golang-package diff --git a/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/eval/hints b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/eval/hints new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/t/recipes/checks/languages/golang/import-path/control-file-golang-xs-go-import-path/eval/hints @@ -0,0 +1 @@ + |