build: add the ability to set enforce all profiles.

Do not do that!!! It forces ALL profiles in enforce mode.
This commit is contained in:
Alexandre Pujol 2023-09-05 19:44:36 +01:00
parent 7c24dde028
commit cad27a3f78
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
4 changed files with 45 additions and 6 deletions

View file

@ -28,6 +28,7 @@ func Test_PreBuild(t *testing.T) {
wantErr bool
full bool
complain bool
enforce bool
dist string
}{
{
@ -35,6 +36,7 @@ func Test_PreBuild(t *testing.T) {
wantErr: false,
full: false,
complain: true,
enforce: false,
dist: "arch",
},
{
@ -42,6 +44,7 @@ func Test_PreBuild(t *testing.T) {
wantErr: false,
full: true,
complain: false,
enforce: true,
dist: "ubuntu",
},
{
@ -49,6 +52,7 @@ func Test_PreBuild(t *testing.T) {
wantErr: false,
full: true,
complain: false,
enforce: false,
dist: "debian",
},
{
@ -56,6 +60,7 @@ func Test_PreBuild(t *testing.T) {
wantErr: false,
full: true,
complain: true,
enforce: false,
dist: "opensuse",
},
// {
@ -76,6 +81,9 @@ func Test_PreBuild(t *testing.T) {
if tt.complain {
Builds = append(Builds, BuildComplain)
}
if tt.enforce {
Builds = append(Builds, BuildEnforce)
}
if err := Prepare(); (err != nil) != tt.wantErr {
t.Errorf("Prepare() error = %v, wantErr %v", err, tt.wantErr)
}