diff options
author | flu0r1ne <flu0r1ne@flu0r1ne.net> | 2021-09-06 02:12:52 -0500 |
---|---|---|
committer | flu0r1ne <flu0r1ne@flu0r1ne.net> | 2021-09-06 02:12:52 -0500 |
commit | fd4ff9192a004ade9174a58dd51abb31277fc1a7 (patch) | |
tree | 0b19b37c8a0ad66986dba2ed63b1066a7318ab72 /adapters/gtest/executable.go | |
parent | 087c51bed9da75f5585d176a7b14396cd70f2638 (diff) | |
parent | 788ae3e0266bdb12bdff6c260dda2e3bcbdfc79c (diff) | |
download | deb-planr-fd4ff9192a004ade9174a58dd51abb31277fc1a7.tar.xz deb-planr-fd4ff9192a004ade9174a58dd51abb31277fc1a7.zip |
Merge branch 'upstream' into ppa
Update to v0.1.1
Diffstat (limited to 'adapters/gtest/executable.go')
-rw-r--r-- | adapters/gtest/executable.go | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/adapters/gtest/executable.go b/adapters/gtest/executable.go index 25c83c1..80560c5 100644 --- a/adapters/gtest/executable.go +++ b/adapters/gtest/executable.go @@ -12,14 +12,22 @@ import ( "sort" "context" - "golang.flu0r1ne.net/planr" -) + "golang.flu0r1ne.net/planr") type executable struct { - exeNm string - testpath string - srcs []string - tcs []planr.TestCase + exeNm string + testpath string + srcs []string + includeSrc bool + compilerOptions string + tcs []planr.TestCase +} + +func dieConflictingExeProperty(exe executable, tc planr.TestCase, property string) { + log.Fatalf( + "Two test cases (including %s) belonging to the same executable (%s) have one or more conflicting properties\nProperty :%s", + tc.Cname, exe.testpath, property, + ) } func createExecutables(tcs []planr.TestCase) []executable { @@ -39,10 +47,12 @@ func createExecutables(tcs []planr.TestCase) []executable { exe := executable { - planr.Cname("", file), - file, - cfg.Srcs, - exeTcs, + exeNm: planr.Cname("", file), + testpath: file, + srcs: cfg.Srcs, + includeSrc: *cfg.Include_src, + compilerOptions: cfg.Compiler_options, + tcs: exeTcs, } exes[file] = exe @@ -53,10 +63,15 @@ func createExecutables(tcs []planr.TestCase) []executable { // We could create two different executables for each source list // But, that would be confusing so we're going to disallow it if !reflect.DeepEqual(exe.srcs, cfg.Srcs) { - log.Fatalf( - "Two test case definitions %s and %s have different lists of sources", - exe.testpath, cfg.Testfile, - ) + dieConflictingExeProperty(exe, tc, "srcs") + } + + if exe.compilerOptions != cfg.Compiler_options { + dieConflictingExeProperty(exe, tc, "compiler_options") + } + + if exe.includeSrc != *cfg.Include_src { + dieConflictingExeProperty(exe, tc, "include_src") } exe.tcs = append(exe.tcs, tc) |