Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove in-tree regex/base64 support #21458

Merged
merged 2 commits into from
Jan 24, 2015

Conversation

alexcrichton
Copy link
Member

The base64 support can be trivially removed (there are no in-tree users) and the regex support is a whopping 4k lines of code to maintain for a few non-critical uses in-tree. This commit migrates all current users in-tree away from regexes to custom matching code.

The most critical application affected by this migration is that the testing framework no longer considers filter arguments as regexes, but rather just a substring matching. It is expected that more featureful testing frameworks can evolve outside of the in-tree libtest version over time which can properly depend on libregex from crates.io.

[breaking-change]

@rust-highfive
Copy link
Collaborator

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

@pczarn
Copy link
Contributor

pczarn commented Jan 21, 2015

src/grammar/verify.rs remains to be migrated.

@steveklabnik
Copy link
Member

Most of src/grammar is just vestigial.

@alexcrichton
Copy link
Member Author

Ack I knew I forgot something! Thanks @pczarn for pointing that out, I've ported it over now.

@brson
Copy link
Contributor

brson commented Jan 23, 2015

@bors: r+ 1c17d4f

@bors
Copy link
Contributor

bors commented Jan 23, 2015

⌛ Testing commit 1c17d4f with merge e0cfc25...

@bors
Copy link
Contributor

bors commented Jan 23, 2015

💔 Test failed - auto-mac-64-nopt-t

@alexcrichton
Copy link
Member Author

@bors: r=brson a4fbe08

@frewsxcv
Copy link
Member

Needs a rebase

This is not used in-tree and is available out-of-tree
The regex library was largely used for non-critical aspects of the compiler and
various external tooling. The library at this point is duplicated with its
out-of-tree counterpart and as such imposes a bit of a maintenance overhead as
well as compile time hit for the compiler itself.

The last major user of the regex library is the libtest library, using regexes
for filters when running tests. This removal means that the filtering has gone
back to substring matching rather than using regexes.
@alexcrichton
Copy link
Member Author

@bors: r=brson 6c29708

@bors
Copy link
Contributor

bors commented Jan 24, 2015

⌛ Testing commit 6c29708 with merge e5c1f16...

bors added a commit that referenced this pull request Jan 24, 2015
The base64 support can be trivially removed (there are no in-tree users) and the regex support is a whopping 4k lines of code to maintain for a few non-critical uses in-tree. This commit migrates all current users in-tree away from regexes to custom matching code.

The most critical application affected by this migration is that the testing framework no longer considers filter arguments as regexes, but rather just a substring matching. It is expected that more featureful testing frameworks can evolve outside of the in-tree libtest version over time which can properly depend on libregex from crates.io.

[breaking-change]
@bors bors merged commit 6c29708 into rust-lang:master Jan 24, 2015
@alexcrichton alexcrichton deleted the remove-some-code branch February 4, 2015 18:04
nelsonjchen added a commit to nelsonjchen/pulldown-cmark that referenced this pull request Sep 18, 2017
While the main executable can also run tests, keeping the standard
`cargo test` function useful is also helpful.

* Add end character to generated tests to work with substring only
matching of tests cases.

Regex test matching was removed in early 2015 in:

rust-lang/rust#21458

You can only filter tests by substring. What if you wanted to run
`spec_test_6`? You would run `spec_test_64` too. Adding the character,
`_` to the end allows a workaround of specifying `spec_test_6_` as the
match to run if you wanted to only run `spec_test_6_`.

E.g. `cargo test spec_test_6_`

* Tests are modified to generate tests with spec names in the tests

Previously, all tests were generated with `spec_test_#_` as their name,
even if they were not generated from `spec.txt`. The `tables.txt` spec
would also generate a `spec_test_#_`. This is an issue if you wanted to
test `spec_test_6_` and only wanted to run the one from `spec.txt` and
not `tables.txt`'s `spec_test_6_`'. While you could build the test
executables and only run the specific test executable with the
`spec_test_#_` you want, it's kind of annoying.

This change derives the test names from the spec filename. For example,
`spec.txt` will generate `spec_test_6_` while `tables.txt` and
`footnotes.txt` will generate `tables_test_6_` and `footnotes_test_6_`
respectively. Future optional specifications that might be added will
utilize the same rule.

This allows testing of example 6 from the `footnotes.txt` spec by simply
doing:

`cargo test footnotes_test_6_`
nelsonjchen added a commit to nelsonjchen/pulldown-cmark that referenced this pull request Sep 18, 2017
While the main executable can also run tests, keeping the standard
`cargo test` function useful is also helpful.

* * *

Add end character to generated tests to work with substring only
matching of tests cases.

Regex test matching was removed in early 2015 in:

rust-lang/rust#21458

You can only filter tests by substring. What if you wanted to run
`spec_test_6`? You would run `spec_test_64` too. Adding the character,
`_` to the end allows a workaround of specifying `spec_test_6_` as the
match to run if you wanted to only run `spec_test_6_`.

E.g. `cargo test spec_test_6_`

* * *

Tests are modified to generate tests with spec names in the tests

Previously, all tests were generated with `spec_test_#_` as their name,
even if they were not generated from `spec.txt`. The `tables.txt` spec
would also generate a `spec_test_#_`. This is an issue if you wanted to
test `spec_test_6_` and only wanted to run the one from `spec.txt` and
not `tables.txt`'s `spec_test_6_`'. While you could build the test
executables and only run the specific test executable with the
`spec_test_#_` you want, it's kind of annoying.

This change derives the test names from the spec filename. For example,
`spec.txt` will generate `spec_test_6_` while `tables.txt` and
`footnotes.txt` will generate `tables_test_6_` and `footnotes_test_6_`
respectively. Future optional specifications that might be added will
utilize the same rule.

This allows testing of example 6 from the `footnotes.txt` spec by simply
doing:

`cargo test footnotes_test_6_`
nelsonjchen added a commit to nelsonjchen/pulldown-cmark that referenced this pull request Sep 18, 2017
While the main executable can also run tests, keeping the standard
`cargo test` function useful is also helpful.

* * *

Add end character to generated tests to work with substring only
matching of tests cases.

Regex test matching was removed in early 2015 in:

rust-lang/rust#21458

You can only filter tests by substring. What if you wanted to run
`spec_test_6`? You would run `spec_test_64` too. Adding the character,
`_` to the end allows a workaround of specifying `spec_test_6_` as the
match to run if you wanted to only run `spec_test_6_`.

E.g. `cargo test spec_test_6_`

* * *

Tests are modified to generate tests with spec names in the tests

Previously, all tests were generated with `spec_test_#_` as their name,
even if they were not generated from `spec.txt`. The `tables.txt` spec
would also generate a `spec_test_#_`. This is an issue if you wanted to
test `spec_test_6_` and only wanted to run the one from `spec.txt` and
not `tables.txt`'s `spec_test_6_`. While you could build the test
executables and only run the specific test executable with the
`spec_test_#_` you want, it's kind of annoying.

This change derives the test names from the spec filename. For example,
`spec.txt` will generate `spec_test_6_` while `tables.txt` and
`footnotes.txt` will generate `tables_test_6_` and `footnotes_test_6_`
respectively. Future optional specifications that might be added will
utilize the same rule.

This allows testing of example 6 from the `footnotes.txt` spec by simply
doing:

`cargo test footnotes_test_6_`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants