2 * Copyright 2000-2015 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.jetbrains.python.testing.tox;
18 import com.intellij.execution.configurations.GeneralCommandLine;
19 import com.intellij.execution.configurations.ParamsGroup;
20 import com.intellij.execution.runners.ExecutionEnvironment;
21 import com.jetbrains.python.HelperPackage;
22 import com.jetbrains.python.PythonHelper;
23 import com.jetbrains.python.testing.PythonTestCommandLineStateBase;
24 import org.jetbrains.annotations.NotNull;
26 import java.util.Collections;
27 import java.util.List;
30 * @author Ilya.Kazakevich
32 class PyToxCommandLineState extends PythonTestCommandLineStateBase {
35 private final String[] myArguments;
38 PyToxCommandLineState(@NotNull final PyToxConfiguration configuration,
39 @NotNull final ExecutionEnvironment environment,
40 @NotNull final String... arguments) {
41 super(configuration, environment);
42 myArguments = arguments;
46 protected HelperPackage getRunner() {
47 return PythonHelper.TOX;
52 public GeneralCommandLine generateCommandLine() {
53 final GeneralCommandLine line = super.generateCommandLine();
54 final ParamsGroup group = line.getParametersList().getParamsGroup(GROUP_SCRIPT);
55 assert group != null: "No group " + GROUP_SCRIPT;
56 group.addParameters(myArguments);
62 protected List<String> getTestSpecs() {
63 return Collections.emptyList();