Regres: Restructure directories for main packages
A directory should only contain either library code, or contain a single `main`.
Attempting to have two main packages upsets the go tools.
Add a `run.sh` bash script in the root regres folder to `go run` the `cmd/regres/main.go` file, to keep usage simple for non-go people.
Change-Id: Ia37ce9a64e1e1a7e23ee3336e6e312cef9e63a9f
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/40528
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
diff --git a/tests/regres/export_to_sheets.go b/tests/regres/cmd/export_to_sheets/main.go
similarity index 98%
rename from tests/regres/export_to_sheets.go
rename to tests/regres/cmd/export_to_sheets/main.go
index e982a5c..139dc4b 100644
--- a/tests/regres/export_to_sheets.go
+++ b/tests/regres/cmd/export_to_sheets/main.go
@@ -30,10 +30,10 @@
"path/filepath"
"strings"
- "./cause"
- "./consts"
- "./git"
- "./testlist"
+ "../../cause"
+ "../../consts"
+ "../../git"
+ "../../testlist"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
diff --git a/tests/regres/main.go b/tests/regres/cmd/regres/main.go
similarity index 99%
rename from tests/regres/main.go
rename to tests/regres/cmd/regres/main.go
index 359550f..9ab0735 100644
--- a/tests/regres/main.go
+++ b/tests/regres/cmd/regres/main.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Regres is a tool that detects test regressions with SwiftShader changes.
+// regres is a tool that detects test regressions with SwiftShader changes.
//
// Regres monitors changes that have been put up for review with Gerrit.
// Once a new patchset has been found, regres will checkout, build and test the
@@ -44,13 +44,13 @@
"strings"
"time"
- "./cause"
- "./consts"
- "./deqp"
- "./git"
- "./shell"
- "./testlist"
- "./util"
+ "../../cause"
+ "../../consts"
+ "../../deqp"
+ "../../git"
+ "../../shell"
+ "../../testlist"
+ "../../util"
gerrit "github.com/andygrunwald/go-gerrit"
)
diff --git a/tests/regres/run.sh b/tests/regres/run.sh
new file mode 100755
index 0000000..7dd18f4
--- /dev/null
+++ b/tests/regres/run.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"
+
+go run $ROOT_DIR/cmd/regres/main.go $@