Skip to content

Commit

Permalink
Renames testdata/{r4,stu3}/google/ to testdata/{r4,stu3}/extensions s…
Browse files Browse the repository at this point in the history
…ince all the testdata are extensions.

Deletes existing, unused data in testdata/stu3/extensions

PiperOrigin-RevId: 339354965
  • Loading branch information
nickgeorge authored and Cameron Tew committed Oct 28, 2020
1 parent 2b8b016 commit a56ab2d
Show file tree
Hide file tree
Showing 400 changed files with 20 additions and 103,697 deletions.
1 change: 0 additions & 1 deletion cc/google/fhir/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ cc_test(
srcs = ["codes_test.cc"],
data = [
"//testdata/r4/codes:testdata",
"//testdata/stu3:google",
],
deps = [
":codes",
Expand Down
2 changes: 1 addition & 1 deletion cc/google/fhir/r4/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ cc_test(
name = "extensions_test",
srcs = ["extensions_test.cc"],
data = [
"//testdata/r4:google",
"//testdata/r4:extensions",
],
deps = [
":extensions",
Expand Down
5 changes: 3 additions & 2 deletions cc/google/fhir/r4/extensions_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ using testing::DigitalMediaType;

template <class T>
void ReadR4TestData(const std::string& type, T* message, Extension* extension) {
*message = ReadR4Proto<T>(absl::StrCat("google/", type, ".message.prototxt"));
*message =
ReadR4Proto<T>(absl::StrCat("extensions/", type, ".message.prototxt"));
*extension = ReadR4Proto<Extension>(
absl::StrCat("google/", type, ".extension.prototxt"));
absl::StrCat("extensions/", type, ".extension.prototxt"));
}

template <class T>
Expand Down
2 changes: 1 addition & 1 deletion cc/google/fhir/stu3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ cc_test(
name = "extensions_test",
srcs = ["extensions_test.cc"],
data = [
"//testdata/stu3:google",
"//testdata/stu3:extensions",
],
deps = [
":extensions",
Expand Down
4 changes: 2 additions & 2 deletions cc/google/fhir/stu3/extensions_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ template <class T>
void ReadStu3TestData(const std::string& type, T* message,
proto::Extension* extension) {
*message =
ReadStu3Proto<T>(absl::StrCat("google/", type, ".message.prototxt"));
ReadStu3Proto<T>(absl::StrCat("extensions/", type, ".message.prototxt"));
*extension = ReadStu3Proto<proto::Extension>(
absl::StrCat("google/", type, ".extension.prototxt"));
absl::StrCat("extensions/", type, ".extension.prototxt"));
}

template <class T>
Expand Down
3 changes: 1 addition & 2 deletions java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ java_test(
size = "medium",
srcs = ["src/test/java/com/google/fhir/wrappers/ExtensionWrapperTest.java"],
data = [
"//testdata/stu3:google",
"//testdata/stu3:extensions",
],
test_class = "com.google.fhir.wrappers.ExtensionWrapperTest",
deps = [
Expand Down Expand Up @@ -617,7 +617,6 @@ java_test(
"//spec:uscore_stu3_package_filegroup",
"//testdata/r4:descriptors",
"//testdata/stu3:descriptors",
"//testdata/stu3:google",
],
test_class = "com.google.fhir.protogen.ProtoGeneratorTest",
deps = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public final class ExtensionWrapperTest {
/** Read the specifed prototxt file from the testdata directory and parse it. */
private void mergeText(java.lang.String filename, Message.Builder builder) throws IOException {
File file =
new File(runfiles.rlocation("com_google_fhir/testdata/stu3/google/" + filename));
new File(
runfiles.rlocation("com_google_fhir/testdata/stu3/extensions/" + filename));
textParser.merge(Files.asCharSource(file, StandardCharsets.UTF_8).read(), builder);
}

Expand Down
2 changes: 1 addition & 1 deletion py/google/fhir/r4/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ py_test(
"extensions_test.py",
],
data = [
"//testdata/r4:google",
"//testdata/r4:extensions",
],
legacy_create_init = 0,
python_version = "PY3",
Expand Down
2 changes: 1 addition & 1 deletion py/google/fhir/r4/extensions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from google.fhir import extensions_test
from testdata.r4.profiles import test_extensions_pb2

_EXTENSIONS_DIR = os.path.join('testdata', 'r4', 'google')
_EXTENSIONS_DIR = os.path.join('testdata', 'r4', 'extensions')


class ExtensionsTest(extensions_test.ExtensionsTest):
Expand Down
2 changes: 1 addition & 1 deletion py/google/fhir/stu3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ py_test(
"extensions_test.py",
],
data = [
"//testdata/stu3:google",
"//testdata/stu3:extensions",
],
legacy_create_init = 0,
python_version = "PY3",
Expand Down
2 changes: 1 addition & 1 deletion py/google/fhir/stu3/extensions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from google.fhir import extensions_test
from testdata.stu3.profiles import test_extensions_pb2

_EXTENSIONS_DIR = os.path.join('testdata', 'stu3', 'google')
_EXTENSIONS_DIR = os.path.join('testdata', 'stu3', 'extensions')


class ExtensionsTest(extensions_test.ExtensionsTest):
Expand Down
6 changes: 3 additions & 3 deletions testdata/r4/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ filegroup(
]),
)

# These files contain google extensions.
# These files contain extensions in both profiled and unprofiled form.
filegroup(
name = "google",
name = "extensions",
srcs = glob([
"google/*",
"extensions/*",
]),
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions testdata/r4/google/google_package_info.prototxt

This file was deleted.

9 changes: 3 additions & 6 deletions testdata/stu3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,11 @@ filegroup(
]),
)

# These files contain google extensions.
# These files contain extensions in both profiled and unprofiled form.
filegroup(
name = "google",
name = "extensions",
srcs = glob([
"google/*.json",
"google/*.descriptor.prototxt",
"google/*.extension.prototxt",
"google/*.message.prototxt",
"extensions/*",
]),
)

Expand Down
File renamed without changes.
Loading

0 comments on commit a56ab2d

Please sign in to comment.