summaryrefslogtreecommitdiffstats
path: root/cmd/commands/exec_command_test.go
blob: 79e65fe833c09d5da273f16f4f9b2be1b07c49f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

package commands

import (
	"flag"
	"testing"

	"github.com/stretchr/testify/require"

	"github.com/mattermost/mattermost-server/cmd"
)

func TestExecCommand(t *testing.T) {
	if filter := flag.Lookup("test.run").Value.String(); filter != "ExecCommand" {
		t.Skip("use -run ExecCommand to execute a command via the test executable")
	}
	cmd.RootCmd.SetArgs(flag.Args())
	require.NoError(t, cmd.RootCmd.Execute())
}