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

fix: Uniform backend testing #4115

Merged
merged 75 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
431d723
Start on analysis script
robin-aws May 26, 2023
558ca9c
Progress on conversion logic
robin-aws May 26, 2023
e4b77db
Merge branch 'master' of https://github.com/dafny-lang/dafny into uni…
robin-aws May 26, 2023
5d0c398
More script
robin-aws May 26, 2023
597891c
Improve conversion script, fix a Java bug
robin-aws May 31, 2023
1b735fa
Handling more options
robin-aws May 31, 2023
20f704c
Marking a couple of intentionally non-uniform tests
robin-aws May 31, 2023
786bd6a
Add support for backend-specific exceptions to MultiBackendTest
robin-aws Jun 1, 2023
987250c
More exceptions
robin-aws Jun 1, 2023
ced635e
Use environment variables to configure, generate exceptions automatic…
robin-aws Jun 1, 2023
a68fc85
Better error message
robin-aws Jun 1, 2023
7949f08
Handle warnings
robin-aws Jun 1, 2023
98fd743
Fix for first chunk
robin-aws Jun 2, 2023
6f4d1c1
Converting all tests
robin-aws Jun 2, 2023
aa45d59
Revert "Converting all tests"
robin-aws Jun 2, 2023
31f2efc
Merge branch 'master' of https://github.com/dafny-lang/dafny into uni…
robin-aws Jun 2, 2023
4417fcf
Converting all tests
robin-aws Jun 2, 2023
cfa3c68
Revert "Converting all tests"
robin-aws Jun 2, 2023
7e8163f
Manually marking nonuniform tests, converting some special cases
robin-aws Jun 2, 2023
422f950
Restore .gitmodules
robin-aws Jun 2, 2023
d4fcd16
Convert all tests
robin-aws Jun 2, 2023
543d99e
Build warning and whitespace
robin-aws Jun 2, 2023
e21c2d9
Exceptions for firstSteps tests
robin-aws Jun 2, 2023
35964c2
Tweaks
robin-aws Jun 2, 2023
f59314e
Revert "Convert all tests"
robin-aws Jun 2, 2023
2c043c2
Fix verifier chunk extraction
robin-aws Jun 2, 2023
eda93bb
A few more options translations and nonuniform tests
robin-aws Jun 2, 2023
35d2efd
Converting all tests
robin-aws Jun 2, 2023
e59a21d
Revert "Converting all tests"
robin-aws Jun 2, 2023
3fc649a
Manually fix line number for NONUNIFORM test
robin-aws Jun 2, 2023
ca3b582
Fix a few unsupported feature exceptions for C++
robin-aws Jun 2, 2023
29b5c22
A few more option translations
robin-aws Jun 2, 2023
c3fba27
Always (b|r)print in MultiBackendTest, add lots of known bugs
robin-aws Jun 2, 2023
204efa3
Convert all tests
robin-aws Jun 2, 2023
e898aa3
Revert "Convert all tests"
robin-aws Jun 8, 2023
5802460
Another batch
robin-aws Jun 8, 2023
3e6dbbb
Merge branch 'master' into uniform-backend-testing
robin-aws Jun 8, 2023
7e80a1e
Fix bad merge
robin-aws Jun 8, 2023
c401ebb
Fixing line numbers/warnings on manually edited tests
robin-aws Jun 9, 2023
13ae819
Partial fix to using —print and --rprint together
robin-aws Jun 9, 2023
b171628
Improve environment variable names
robin-aws Jun 9, 2023
d92b698
Whitespace
robin-aws Jun 9, 2023
2b669e5
Merge branch 'master' of https://github.com/dafny-lang/dafny into uni…
robin-aws Jun 9, 2023
44cba87
Convert all tests
robin-aws Jun 9, 2023
da7e466
Naming tweaks
robin-aws Jun 9, 2023
55e2a9f
A few more issues/fixes
robin-aws Jun 9, 2023
4bda0f7
Revert "Convert all tests"
robin-aws Jun 9, 2023
973dba5
Should be the last batch of manual fixes
robin-aws Jun 9, 2023
394df55
Convert all tests
robin-aws Jun 9, 2023
8a8b443
Revert "Convert all tests"
robin-aws Jun 9, 2023
dd5ed71
Last three I’m sure
robin-aws Jun 10, 2023
788783a
Convert all tests
robin-aws Jun 10, 2023
59ffa26
Revert "Convert all tests"
robin-aws Jun 10, 2023
42255ac
LAST ONE
robin-aws Jun 10, 2023
3ab861b
Convert all tests
robin-aws Jun 10, 2023
e04a1b9
Add CI to check uniformity, and make sure it can fail
robin-aws Jun 12, 2023
38cd896
dotnet being picky
robin-aws Jun 12, 2023
8e9ea0e
Sorry dotnet, I should not have blamed you
robin-aws Jun 12, 2023
a3a6f5f
README updates
robin-aws Jun 12, 2023
0539b71
Comments and alignment
robin-aws Jun 12, 2023
a37f8c2
Whitespace
robin-aws Jun 12, 2023
275d651
Revert "Convert all tests"
robin-aws Jun 12, 2023
485d856
Unbreak test
robin-aws Jun 12, 2023
bc53898
Convert all tests
robin-aws Jun 12, 2023
5fc6f3e
Merge branch 'master' into uniform-backend-testing
robin-aws Jun 12, 2023
33e80b1
Revert "Convert all tests"
robin-aws Jun 13, 2023
70c4be2
PR feedback
robin-aws Jun 13, 2023
7bbbcfb
Merge branch 'master' of https://github.com/dafny-lang/dafny into uni…
robin-aws Jun 13, 2023
c5f26cc
Merge branch 'uniform-backend-testing' of github.com:robin-aws/dafny …
robin-aws Jun 13, 2023
3d08f4d
Convert all tests
robin-aws Jun 13, 2023
e09c231
Revert "Convert all tests"
robin-aws Jun 13, 2023
6fc0364
Force manually specifying the reason for tests with inconsistent output
robin-aws Jun 13, 2023
8852b25
Convert all tests
robin-aws Jun 13, 2023
788b199
Filling in NONUNIFORM reasons
robin-aws Jun 13, 2023
e9d0be9
Escape periods in CHECK directives
robin-aws Jun 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
run: dotnet tool run dotnet-format -w -s error --check Source/Dafny.sln --exclude DafnyCore/Scanner.cs --exclude DafnyCore/Parser.cs
- name: Create NuGet package (just to make sure it works)
run: dotnet pack --no-build dafny/Source/Dafny.sln
- name: Check uniformity of integration tests that exercise backends
run: DAFNY_INTEGRATION_TESTS_MODE=uniformity-check dotnet test dafny/Source/IntegrationTests

xunit-tests:
needs: check-deep-tests
Expand Down
2 changes: 1 addition & 1 deletion Source/DafnyCore/AST/Grammar/Printer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public void PrintTopLevelDecls(Program program, IEnumerable<TopLevelDecl> decls,
wr.WriteLine();
}

if (options.DafnyPrintResolvedFile != null) {
if (afterResolver) {
// also print the members that were created as part of the interpretation of the iterator
Contract.Assert(iter.Members.Count != 0); // filled in during resolution
Indent(indent); wr.WriteLine("/*---------- iterator members ----------");
Expand Down
12 changes: 5 additions & 7 deletions Source/DafnyCore/Compilers/Cplusplus/Compiler-cpp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ protected override IClassWriter CreateClass(string moduleName, string name, bool
throw new UnsupportedFeatureException(tok, Feature.ExternalClasses, String.Format("extern in class {0}", name));
}
if (superClasses != null && superClasses.Any(trait => !trait.IsObject)) {
throw new UnsupportedFeatureException(tok, Feature.Traits, String.Format("traits in class {0}", name));
throw new UnsupportedFeatureException(tok, Feature.Traits);
MikaelMayer marked this conversation as resolved.
Show resolved Hide resolved
}

var classDeclWriter = modDeclWr;
Expand Down Expand Up @@ -270,7 +270,7 @@ protected override IClassWriter CreateClass(string moduleName, string name, bool

protected override IClassWriter CreateTrait(string name, bool isExtern, List<TypeParameter> typeParameters /*?*/,
TopLevelDecl trait, List<Type> superClasses /*?*/, IToken tok, ConcreteSyntaxTree wr) {
throw new UnsupportedFeatureException(tok, Feature.Traits, String.Format("traits in class {0}", name));
throw new UnsupportedFeatureException(tok, Feature.Traits);
}

protected override ConcreteSyntaxTree CreateIterator(IteratorDecl iter, ConcreteSyntaxTree wr) {
Expand Down Expand Up @@ -610,7 +610,7 @@ protected override IClassWriter DeclareNewtype(NewtypeDecl nt, ConcreteSyntaxTre
wr.WriteLine("typedef {0} {1};", nt_name_def, nt.Name);
}
} else {
throw new UnsupportedFeatureException(nt.tok, Feature.NonNativeNewtypes, String.Format("non-native newtype {0}", nt));
throw new UnsupportedFeatureException(nt.tok, Feature.NonNativeNewtypes);
}
var className = "class_" + IdName(nt);
var cw = CreateClass(nt.EnclosingModuleDefinition.GetCompileName(Options), className, nt, wr) as ClassWriter;
Expand Down Expand Up @@ -2168,8 +2168,7 @@ protected override void CompileBinOp(BinaryExpr.ResolvedOpcode op,
if (resultType.IsCharType || AsNativeType(resultType) != null) {
opString = "-";
} else {
throw new UnsupportedFeatureException(tok, Feature.NonNativeNewtypes,
"Subtraction of non-native type");
throw new UnsupportedFeatureException(tok, Feature.NonNativeNewtypes);
}
break;
case BinaryExpr.ResolvedOpcode.Mul:
Expand All @@ -2179,8 +2178,7 @@ protected override void CompileBinOp(BinaryExpr.ResolvedOpcode op,
if (AsNativeType(resultType) != null) {
opString = "*";
} else {
throw new UnsupportedFeatureException(tok, Feature.NonNativeNewtypes,
"Multiplication of non-native type");
throw new UnsupportedFeatureException(tok, Feature.NonNativeNewtypes);
}
break;
case BinaryExpr.ResolvedOpcode.Div:
Expand Down
2 changes: 1 addition & 1 deletion Source/DafnyCore/Compilers/Java/JavaBackend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public override bool CompileTargetProgram(string dafnyProgramName, string target
if (Options.SpillTargetCode == 0) {
Directory.Delete(targetDirectory, true);
} else {
classFiles.ForEach(f => File.Delete(f));
classFiles.ForEach(f => File.Delete(Path.Join(targetDirectory, f)));
MikaelMayer marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
Loading