Skip to content

Commit

Permalink
Split shootout compatibility module into three — normal, GMP, and RE2 (
Browse files Browse the repository at this point in the history
…chapel-lang#23443)

[trivial, not reviewed]

In chapel-lang#23428, I failed to recognize the obvious — that in introducing my
'Compat' module, I was infecting all tests that `use`d it with potential
dependencies (GMP, RE2) that their skipifs wouldn't skip past. Here, I'm
splitting the Compat module into three so that each test can only bring
in those third-party dependencies that it was already expecting to use.
  • Loading branch information
bradcray authored Sep 19, 2023
2 parents c1f20a6 + 1fe8d11 commit df7343d
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 19 deletions.
17 changes: 1 addition & 16 deletions test/studies/shootout/submitted/Compat.chpl
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
use IO, BigInteger, Regex;
use IO;

@deprecated("openfd is deprecated, please use the file initializer with a 'c_int' argument instead")
proc openfd(x) {
return new file(x);
}

@deprecated("bigint.div_q using Round is deprecated, use the standalone function div with roundingMode instead")
proc ref bigint.div_q(x, y) {
div(this, x, y);
}

@deprecated("'Regex.compile' is deprecated. Please use 'new regex()' instead.")
proc compile(x) {
return new regex(x);
}

@deprecated("regex.sub is deprecated. Please use string.replace.")
proc regex.sub(x, y) {
return y.replace(this, x);
}
6 changes: 6 additions & 0 deletions test/studies/shootout/submitted/CompatGMP.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use BigInteger;

@deprecated("bigint.div_q using Round is deprecated, use the standalone function div with roundingMode instead")
proc ref bigint.div_q(x, y) {
div(this, x, y);
}
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/CompatGMP.notest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Compatability shim
11 changes: 11 additions & 0 deletions test/studies/shootout/submitted/CompatRE2.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use Regex;

@deprecated("'Regex.compile' is deprecated. Please use 'new regex()' instead.")
proc compile(x) {
return new regex(x);
}

@deprecated("regex.sub is deprecated. Please use string.replace.")
proc regex.sub(x, y) {
return y.replace(this, x);
}
1 change: 1 addition & 0 deletions test/studies/shootout/submitted/CompatRE2.notest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Compatability shim
2 changes: 1 addition & 1 deletion test/studies/shootout/submitted/pidigits2.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ iter genDigits(numDigits) {
numer *= 10;
}
}
use Compat;
use Compat, CompatGMP;
2 changes: 1 addition & 1 deletion test/studies/shootout/submitted/regexredux2.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ proc main(args: [] string) {
writeln(data.size);
writeln(copy.size);
}
use Compat;
use Compat, CompatRE2;
2 changes: 1 addition & 1 deletion test/studies/shootout/submitted/regexredux3.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ proc main(args: [] string) {
writeln(data.size);
writeln(copy.size);
}
use Compat;
use Compat, CompatRE2;

0 comments on commit df7343d

Please sign in to comment.