summaryrefslogtreecommitdiffstats
path: root/cmd/mattermost/commands/exec_command_test.go
blob: c1c61f3828af163ca0b4419a0cc7d84c284f446a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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"
)

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")
	}
	RootCmd.SetArgs(flag.Args())
	require.NoError(t, RootCmd.Execute())
}