Skip to content

Commit

Permalink
Move conformance test framework code to a new package. (#109)
Browse files Browse the repository at this point in the history
Part of #107.
  • Loading branch information
netdpb authored Nov 15, 2023
1 parent 00277ba commit 5d21c9a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
package tests.conformance;
// Copyright 2023 The JSpecify Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.jspecify.conformance;

import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.collect.Lists.partition;
Expand All @@ -13,7 +27,7 @@
import static java.util.Objects.requireNonNull;
import static java.util.Objects.requireNonNullElse;
import static java.util.stream.Collectors.toList;
import static tests.conformance.AbstractConformanceTest.ExpectedFact.readExpectedFact;
import static org.jspecify.conformance.AbstractConformanceTest.ExpectedFact.readExpectedFact;

import com.google.common.base.Ascii;
import com.google.common.base.Strings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package tests.conformance;
package org.jspecify.conformance;

import static com.google.common.collect.ImmutableListMultimap.flatteningToImmutableListMultimap;
import static com.google.common.collect.Iterables.concat;
Expand All @@ -28,9 +28,9 @@
import java.nio.file.Path;
import java.util.Collection;
import java.util.Formatter;
import tests.conformance.AbstractConformanceTest.ExpectedFact;
import tests.conformance.AbstractConformanceTest.Fact;
import tests.conformance.AbstractConformanceTest.ReportedFact;
import org.jspecify.conformance.AbstractConformanceTest.ExpectedFact;
import org.jspecify.conformance.AbstractConformanceTest.Fact;
import org.jspecify.conformance.AbstractConformanceTest.ReportedFact;

/** Represents the results of running an {@link AbstractConformanceTest} on a set of files. */
public final class ConformanceTestReport {
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/tests/ConformanceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
import static java.util.Collections.emptyList;
import static java.util.Objects.requireNonNullElse;
import static java.util.stream.Collectors.joining;
import static tests.conformance.AbstractConformanceTest.ExpectedFact.cannotConvert;
import static tests.conformance.AbstractConformanceTest.ExpectedFact.expressionType;
import static tests.conformance.AbstractConformanceTest.ExpectedFact.irrelevantAnnotation;
import static tests.conformance.AbstractConformanceTest.ExpectedFact.isNullnessMismatch;
import static tests.conformance.AbstractConformanceTest.ExpectedFact.sinkType;
import static org.jspecify.conformance.AbstractConformanceTest.ExpectedFact.cannotConvert;
import static org.jspecify.conformance.AbstractConformanceTest.ExpectedFact.expressionType;
import static org.jspecify.conformance.AbstractConformanceTest.ExpectedFact.irrelevantAnnotation;
import static org.jspecify.conformance.AbstractConformanceTest.ExpectedFact.isNullnessMismatch;
import static org.jspecify.conformance.AbstractConformanceTest.ExpectedFact.sinkType;

import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
Expand All @@ -40,9 +40,9 @@
import org.checkerframework.framework.test.TypecheckResult;
import org.checkerframework.framework.test.diagnostics.DiagnosticKind;
import org.jspecify.annotations.Nullable;
import org.jspecify.conformance.AbstractConformanceTest;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import tests.conformance.AbstractConformanceTest;

/** An {@link AbstractConformanceTest} for the JSpecify reference checker. */
@RunWith(JUnit4.class)
Expand Down

0 comments on commit 5d21c9a

Please sign in to comment.