mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-23281: Support command line that starts with !
This commit is contained in:
@@ -112,7 +112,7 @@ public class _CommandLineLexer implements FlexLexer {
|
||||
|
||||
/* The ZZ_CMAP_A table has 3088 entries */
|
||||
static final char ZZ_CMAP_A[] = zzUnpackCMap(
|
||||
"\11\0\5\2\22\0\1\2\1\0\1\14\4\0\1\15\5\0\1\10\2\7\12\12\1\6\2\0\1\16\3\0\32"+
|
||||
"\11\0\5\2\22\0\1\2\1\7\1\14\4\0\1\15\5\0\1\10\2\7\12\12\1\6\2\0\1\16\3\0\32"+
|
||||
"\5\1\0\1\6\2\0\1\4\13\5\3\0\1\13\6\0\1\1\12\0\1\1\11\0\1\3\12\0\1\3\4\0\1"+
|
||||
"\3\5\0\27\3\1\0\12\3\4\0\14\3\16\0\5\3\7\0\1\3\1\0\1\3\1\0\5\3\1\0\2\3\2\0"+
|
||||
"\4\3\1\0\1\3\6\0\1\3\1\0\3\3\1\0\1\3\1\0\4\3\1\0\23\3\1\0\13\3\10\0\6\3\1"+
|
||||
|
||||
@@ -26,15 +26,15 @@ EOL=\R
|
||||
WHITE_SPACE=\s+
|
||||
|
||||
SPACE=[ \t\n\x0B\f\r]+
|
||||
LITERAL_STARTS_FROM_LETTER=[:letter:]([a-zA-Z_0-9]|:|\\|"/"|\.|-)*
|
||||
LITERAL_STARTS_FROM_DIGIT=[:digit:]([a-zA-Z_0-9]|:|\\|"/"|\.|-)*
|
||||
LITERAL_STARTS_FROM_SYMBOL=([/\~\.]([a-zA-Z_0-9]|:|\\|"/"|\.|-)*)
|
||||
SPACED_LITERAL_STARTS_FROM_LETTER=\"[:letter:]([a-zA-Z_0-9]|:|\\|"/"|\.|-|[ \t\n\x0B\f\r])*\"
|
||||
SPACED_LITERAL_STARTS_FROM_DIGIT=\"[:digit:]([a-zA-Z_0-9]|:|\\|"/"|\.|-|[ \t\n\x0B\f\r])*\"
|
||||
SPACED_LITERAL_STARTS_FROM_SYMBOL=\"([/\~\.]([a-zA-Z_0-9]|:|\\|"/"|\.|-|[ \t\n\x0B\f\r])*)\"
|
||||
SINGLE_Q_SPACED_LITERAL_STARTS_FROM_LETTER='[:letter:]([a-zA-Z_0-9]|:|\\|"/"|\.|-|[ \t\n\x0B\f\r])*'
|
||||
SINGLE_Q_SPACED_LITERAL_STARTS_FROM_DIGIT='[:digit:]([a-zA-Z_0-9]|:|\\|"/"|\.|-|[ \t\n\x0B\f\r])*'
|
||||
SINGLE_Q_SPACED_LITERAL_STARTS_FROM_SYMBOL='([/\~\.]([a-zA-Z_0-9]|:|\\|"/"|\.|-|[ \t\n\x0B\f\r])*)'
|
||||
LITERAL_STARTS_FROM_LETTER=[:letter:]([a-zA-Z_0-9]|:|\\|"/"|\.|-|\!)*
|
||||
LITERAL_STARTS_FROM_DIGIT=[:digit:]([a-zA-Z_0-9]|:|\\|"/"|\.|-|\!)*
|
||||
LITERAL_STARTS_FROM_SYMBOL=([/\~\.!]([a-zA-Z_0-9]|:|\\|"/"|\.|-|\!)*)
|
||||
SPACED_LITERAL_STARTS_FROM_LETTER=\"[:letter:]([a-zA-Z_0-9]|:|\\|"/"|\.|-|[ \t\n\x0B\f\r]|\!)*\"
|
||||
SPACED_LITERAL_STARTS_FROM_DIGIT=\"[:digit:]([a-zA-Z_0-9]|:|\\|"/"|\.|-|[ \t\n\x0B\f\r]|\!)*\"
|
||||
SPACED_LITERAL_STARTS_FROM_SYMBOL=\"([/\~\.!]([a-zA-Z_0-9]|:|\\|"/"|\.|-|[ \t\n\x0B\f\r]|\!)*)\"
|
||||
SINGLE_Q_SPACED_LITERAL_STARTS_FROM_LETTER='[:letter:]([a-zA-Z_0-9]|:|\\|"/"|\.|-|[ \t\n\x0B\f\r]|\!)*'
|
||||
SINGLE_Q_SPACED_LITERAL_STARTS_FROM_DIGIT='[:digit:]([a-zA-Z_0-9]|:|\\|"/"|\.|-|[ \t\n\x0B\f\r]|\!)*'
|
||||
SINGLE_Q_SPACED_LITERAL_STARTS_FROM_SYMBOL='([/\~\.!]([a-zA-Z_0-9]|:|\\|"/"|\.|-|[ \t\n\x0B\f\r]|\!)*)'
|
||||
SHORT_OPTION_NAME_TOKEN=-[:letter:]
|
||||
LONG_OPTION_NAME_TOKEN=--[:letter:](-|[a-zA-Z_0-9])*
|
||||
|
||||
|
||||
@@ -25,18 +25,18 @@
|
||||
tokens=[
|
||||
space='regexp:\s+' // WARNING: Comment out or remove this (space) before generating Flex file! It is here only for live preview.
|
||||
EQ = '='
|
||||
LITERAL_STARTS_FROM_LETTER='regexp:\p{Alpha}(\w|:|\\|/|\.|-)*'
|
||||
LITERAL_STARTS_FROM_DIGIT='regexp:\p{Digit}(\w|:|\\|/|\.|-)*'
|
||||
LITERAL_STARTS_FROM_SYMBOL='regexp:([/\~\.](\w|:|\\|/|\.|-)*)'
|
||||
LITERAL_STARTS_FROM_LETTER='regexp:\p{Alpha}(\w|:|\\|/|\.|-|\!)*'
|
||||
LITERAL_STARTS_FROM_DIGIT='regexp:\p{Digit}(\w|:|\\|/|\.|-|\!)*'
|
||||
LITERAL_STARTS_FROM_SYMBOL='regexp:([/\~\.!](\w|:|\\|/|\.|-|\!)*)'
|
||||
|
||||
SPACED_LITERAL_STARTS_FROM_LETTER='regexp:"\p{Alpha}(\w|:|\\|/|\.|-|\s)*"'
|
||||
SPACED_LITERAL_STARTS_FROM_DIGIT='regexp:"\p{Digit}(\w|:|\\|/|\.|-|\s)*"'
|
||||
SPACED_LITERAL_STARTS_FROM_SYMBOL='regexp:"([/\~\.](\w|:|\\|/|\.|-|\s)*)"'
|
||||
SPACED_LITERAL_STARTS_FROM_LETTER='regexp:"\p{Alpha}(\w|:|\\|/|\.|-|\s|\!)*"'
|
||||
SPACED_LITERAL_STARTS_FROM_DIGIT='regexp:"\p{Digit}(\w|:|\\|/|\.|-|\s|\!)*"'
|
||||
SPACED_LITERAL_STARTS_FROM_SYMBOL='regexp:"([/\~\.!](\w|:|\\|/|\.|-|\s|\!)*)"'
|
||||
|
||||
|
||||
SINGLE_Q_SPACED_LITERAL_STARTS_FROM_LETTER="regexp:'\p{Alpha}(\w|:|\\|/|\.|-|\s)*'"
|
||||
SINGLE_Q_SPACED_LITERAL_STARTS_FROM_DIGIT="regexp:'\p{Digit}(\w|:|\\|/|\.|-|\s)*'"
|
||||
SINGLE_Q_SPACED_LITERAL_STARTS_FROM_SYMBOL="regexp:'([/\~\.](\w|:|\\|/|\.|-|\s)*)'"
|
||||
SINGLE_Q_SPACED_LITERAL_STARTS_FROM_LETTER="regexp:'\p{Alpha}(\w|:|\\|/|\.|-|\s|\!)*'"
|
||||
SINGLE_Q_SPACED_LITERAL_STARTS_FROM_DIGIT="regexp:'\p{Digit}(\w|:|\\|/|\.|-|\s|\!)*'"
|
||||
SINGLE_Q_SPACED_LITERAL_STARTS_FROM_SYMBOL="regexp:'([/\~\.!](\w|:|\\|/|\.|-|\s|\!)*)'"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
from nose.plugins.attrib import attr
|
||||
|
||||
def test_fast():
|
||||
pass
|
||||
|
||||
@attr('slow')
|
||||
def test_Slow():
|
||||
pass
|
||||
@@ -6,11 +6,14 @@ import com.jetbrains.env.PyEnvTestCase;
|
||||
import com.jetbrains.env.PyProcessWithConsoleTestTask;
|
||||
import com.jetbrains.env.python.testing.CreateConfigurationTestTask.PyConfigurationCreationTask;
|
||||
import com.jetbrains.env.ut.PyNoseTestProcessRunner;
|
||||
import com.jetbrains.env.ut.PyTestTestProcessRunner;
|
||||
import com.jetbrains.python.sdkTools.SdkCreationType;
|
||||
import com.jetbrains.python.testing.PythonTestConfigurationsModel;
|
||||
import com.jetbrains.python.testing.universalTests.PyUniversalNoseTestConfiguration;
|
||||
import com.jetbrains.python.testing.universalTests.PyUniversalNoseTestFactory;
|
||||
import com.jetbrains.python.testing.universalTests.PyUniversalPyTestConfiguration;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -23,6 +26,41 @@ import static org.junit.Assert.assertEquals;
|
||||
@EnvTestTagsRequired(tags = "nose")
|
||||
public final class PythonNoseTestingTest extends PyEnvTestCase {
|
||||
|
||||
|
||||
// Ensure slow test is not run when --attr="!slow" is provided
|
||||
@Test
|
||||
public void testMarkerWithSlow() throws Exception {
|
||||
runPythonTest(
|
||||
new PyProcessWithConsoleTestTask<PyNoseTestProcessRunner>("/testRunner/env/nose/test_with_slow", SdkCreationType.EMPTY_SDK) {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected PyNoseTestProcessRunner createProcessRunner() throws Exception {
|
||||
return new PyNoseTestProcessRunner("test_with_slow.py", 0) {
|
||||
@Override
|
||||
protected void configurationCreatedAndWillLaunch(@NotNull PyUniversalNoseTestConfiguration configuration) throws IOException {
|
||||
super.configurationCreatedAndWillLaunch(configuration);
|
||||
configuration.setAdditionalArguments("--attr=\"!slow\"");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void checkTestResults(@NotNull PyNoseTestProcessRunner runner,
|
||||
@NotNull String stdout,
|
||||
@NotNull String stderr,
|
||||
@NotNull String all) {
|
||||
Assert.assertEquals("--slow runner borken", "Test tree:\n" +
|
||||
"[root]\n" +
|
||||
".test_with_slow\n" +
|
||||
"..test_fast(+)\n",
|
||||
runner.getFormattedTestTree());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testMultipleCases() throws Exception {
|
||||
runPythonTest(
|
||||
|
||||
Reference in New Issue
Block a user