-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixed indeterministic shuffle of contexts in MX_Device.h * Added MX_Device.h path to add-path: * fixed error in mxDevice_test.go * Fixed old test * Forgot to remove comment chars of t.Parallel * switched secure and non secure mode added tests added download info from global.generator.yml * Fixed formatting and lint complaints * corrected wrong test for not set environment variable * Removed fPaths again, they are not necessary, can used project directly Added more tests * removed a ; * Added I2C filter extraction more Tests * changed formatting * tried to fix a lint problem * fixed publish coverage step * fixed publish coverage step * added output of command line commented out reading of packs fro cbuild-gen.yml --------- Co-authored-by: Sourabh Mehta <sourabh.mehta@arm.com>
- Loading branch information
Showing
11 changed files
with
388 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,62 @@ | ||
/* | ||
* Copyright (c) 2023 Arm Limited. All rights reserved. | ||
* Copyright (c) 2023-2024 Arm Limited. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package commands_test | ||
package commands | ||
|
||
import ( | ||
"bytes" | ||
"testing" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
func Test_configureGlobalCmd(t *testing.T) { | ||
type args struct { | ||
cmd *cobra.Command | ||
args []string | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
wantErr bool | ||
}{ | ||
{"test", args{cmd: &cobra.Command{}}, false}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
NewCli() | ||
if err := configureGlobalCmd(tt.args.cmd, tt.args.args); (err != nil) != tt.wantErr { | ||
t.Errorf("configureGlobalCmd() %s error = %v, wantErr %v", tt.name, err, tt.wantErr) | ||
} | ||
}) | ||
} | ||
} | ||
|
||
func Test_printVersionAndLicense(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
version string | ||
copyright string | ||
wantFile string | ||
}{ | ||
{"test", "v1.2.3", "copy", "generator-bridge version 1.2.3 copy\n"}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
file := &bytes.Buffer{} | ||
saveVersion := Version | ||
saveCopyright := Copyright | ||
Version = tt.version | ||
Copyright = tt.copyright | ||
printVersionAndLicense(file) | ||
if gotFile := file.String(); gotFile != tt.wantFile { | ||
t.Errorf("printVersionAndLicense() %s = %v, want %v", tt.name, gotFile, tt.wantFile) | ||
} | ||
Version = saveVersion | ||
Copyright = saveCopyright | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,49 @@ | ||
/* | ||
* Copyright (c) 2023 Arm Limited. All rights reserved. | ||
* Copyright (c) 2023-2024 Arm Limited. All rights reserved. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package common_test | ||
package common | ||
|
||
import "testing" | ||
import ( | ||
"reflect" | ||
"testing" | ||
) | ||
|
||
func TestFoo(t *testing.T) { | ||
func TestReadYml(t *testing.T) { | ||
type TestYml struct { | ||
Test []struct { | ||
Xx string `yaml:"xx"` | ||
} `yaml:"test"` | ||
} | ||
var testyml TestYml | ||
|
||
t1 := TestYml{Test: []struct { | ||
Xx string `yaml:"xx"` | ||
}{{Xx: "abc"}}} | ||
|
||
type args struct { | ||
path string | ||
out interface{} | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
want TestYml | ||
wantErr bool | ||
}{ | ||
{"test", args{"../../testdata/test.yml", &testyml}, t1, false}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if err := ReadYml(tt.args.path, tt.args.out); (err != nil) != tt.wantErr { | ||
t.Errorf("ReadYml() %s error = %v, wantErr %v", tt.name, err, tt.wantErr) | ||
} | ||
xx := tt.want | ||
if !reflect.DeepEqual(tt.args.out, &xx) { | ||
t.Errorf("ReadYml() %s got = %v, want %v", tt.name, tt.args.out, tt.want) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.