From 4b842fb0d1d7f9f09a205550f4a58f894003bce5 Mon Sep 17 00:00:00 2001 From: Flu0r1ne Date: Mon, 6 Sep 2021 15:25:43 -0500 Subject: Show debug output if student links external main --- adapters/gtest/executable.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'adapters/gtest') diff --git a/adapters/gtest/executable.go b/adapters/gtest/executable.go index 80560c5..bb47d9c 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.flu0r1ne.net/planr") + "golang.flu0r1ne.net/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 { -- cgit v1.2.3