diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2021-09-06 15:25:43 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2021-09-06 15:25:43 -0500 |
| commit | 3e7c553f5072300b1e8ab3cdde973d2ca17b59b8 (patch) | |
| tree | 9d41b529f69108dc10ec2246bf1b15ef9def3439 /adapters | |
| parent | 2fcc17cb12dc76f0322dcf39829b5ceaf3db8a12 (diff) | |
Show debug output if student links external main
Diffstat (limited to 'adapters')
| -rw-r--r-- | adapters/gtest/executable.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/adapters/gtest/executable.go b/adapters/gtest/executable.go index f0eb158..5506f42 100644 --- a/adapters/gtest/executable.go +++ b/adapters/gtest/executable.go @@ -1,18 +1,20 @@ package gtest import ( - "os" + "context" "errors" - "time" + "fmt" "io/ioutil" "log" + "os" "os/exec" "path" "reflect" "sort" - "context" + "time" - "golang.furkistan.com/planr") + "golang.furkistan.com/planr" +) type executable struct { exeNm string @@ -159,7 +161,10 @@ func runGtest(exe string, tc planr.TestCase, builddir string) planr.TestResult { results, err := decodeResults(f) if err != nil { - log.Fatalf("Could not collect results from %s: %v", exe, err) + result.Status = planr.COMPILATION_FAILURE + result.DebugOutput += fmt.Sprintf("Could not collect results from %s: %v\n\nDid you mistakenly create a main?\n", exe, err) + + return result } if len(results) < 1 { |
