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

Use the samples files from the conformance tests zip. #123

Merged
merged 5 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ tasks.register('jspecifySamplesTest', Test) {
include '**/NullSpecTest$Lenient.class'
include '**/NullSpecTest$Strict.class'

inputs.files("${jspecify.projectDir}/samples")
inputs.files(unzipConformanceTestSuite)
}

tasks.register('unzipConformanceTestSuite', Copy) {
Expand All @@ -140,11 +140,11 @@ tasks.register('conformanceTests', Test) {
}

// Conformance tests run on the samples directory
inputs.dir("${jspecify.projectDir}/samples")
inputs.dir("${unzipConformanceTestSuite.destinationDir}/samples")
inputs.files("tests/ConformanceTestOnSamples-report.txt")
doFirst {
systemProperties([
"JSpecifyConformanceTest.samples.inputs": "${jspecify.projectDir}/samples",
"JSpecifyConformanceTest.samples.inputs": "${unzipConformanceTestSuite.destinationDir}/samples",
"JSpecifyConformanceTest.samples.report": "tests/ConformanceTestOnSamples-report.txt"
])
}
Expand Down
8 changes: 6 additions & 2 deletions src/test/java/tests/NullSpecTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Lenient(List<File> testFiles) {

@Parameters
public static String[] getTestDirs() {
return new String[] {"../../jspecify/samples"};
return getSamplesDirs();
}
}

Expand All @@ -61,10 +61,14 @@ public Strict(List<File> testFiles) {

@Parameters
public static String[] getTestDirs() {
return new String[] {"../../jspecify/samples"};
return getSamplesDirs();
}
}

private static String[] getSamplesDirs() {
return new String[] {"../build/conformanceTests/samples"};
}

private final boolean strict;

NullSpecTest(List<File> testFiles, boolean strict) {
Expand Down