summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Magefile.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/Magefile.go b/Magefile.go
index 6782f90..f3f7a16 100644
--- a/Magefile.go
+++ b/Magefile.go
@@ -42,10 +42,7 @@ func Run() error {
// Test runs all tests.
func Test() error {
fmt.Println("Running tests...")
- if err := sh.RunV("go", "test", "./..."); err != nil {
- return fmt.Errorf("test: %w", err)
- }
- return nil
+ return runTests()
}
// Verify runs formatting and static checks before tests.
@@ -116,3 +113,13 @@ func installBinDir() (string, error) {
return filepath.Join(goPath, "bin"), nil
}
+
+func runTests() error {
+ if err := sh.RunV("go", "test", "./..."); err != nil {
+ return fmt.Errorf("test packages: %w", err)
+ }
+ if err := sh.RunV("go", "test", "-tags", "mage", "."); err != nil {
+ return fmt.Errorf("test Magefile: %w", err)
+ }
+ return nil
+}