Skip to content

Commit 45e12a9

Browse files
authored
Merge branch 'master' into mh-add-bazelrc-verbose
2 parents 34b86fe + 5d8e38e commit 45e12a9

4 files changed

Lines changed: 18 additions & 12 deletions

File tree

WORKSPACE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ http_archive(
1111

1212
http_archive(
1313
name = "com_google_googletest",
14-
sha256 = "ab78fa3f912d44d38b785ec011a25f26512aaedc5291f51f3807c592b506d33a",
15-
strip_prefix = "googletest-58d77fa8070e8cec2dc1ed015d66b454c8d78850",
16-
url = "https://github.com/google/googletest/archive/58d77fa8070e8cec2dc1ed015d66b454c8d78850.zip",
14+
sha256 = "40d4ec942217dcc84a9ebe2a68584ada7d4a33a8ee958755763278ea1c5e18ff",
15+
strip_prefix = "googletest-1.17.0",
16+
url = "https://github.com/google/googletest/archive/refs/tags/v1.17.0.zip",
1717
)
1818

1919
# Required for testing compatibility with TF Quantum:

dev-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
black~=25.1.0
22
flynt~=1.0
33
pytest
4+
pytest-xdist

tests/BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ cc_test(
360360
cc_test(
361361
name = "simulator_sse_test",
362362
size = "small",
363+
tags = ["sse"],
363364
srcs = ["simulator_sse_test.cc"],
364365
deps = [
365366
":simulator_testfixture",
@@ -451,6 +452,7 @@ cc_test(
451452
cc_test(
452453
name = "statespace_sse_test",
453454
size = "small",
455+
tags = ["sse"],
454456
srcs = ["statespace_sse_test.cc"],
455457
deps = [
456458
":statespace_testfixture",
@@ -532,6 +534,7 @@ cc_test(
532534
cc_test(
533535
name = "unitaryspace_sse_test",
534536
size = "small",
537+
tags = ["sse"],
535538
srcs = ["unitaryspace_sse_test.cc"],
536539
copts = select({
537540
":windows": windows_copts,
@@ -617,6 +620,7 @@ cc_test(
617620
cc_test(
618621
name = "unitary_calculator_sse_test",
619622
size = "small",
623+
tags = ["sse"],
620624
srcs = ["unitary_calculator_sse_test.cc"],
621625
copts = select({
622626
":windows": windows_copts,

tests/Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ GMOCK_DIR = $(CURDIR)/googletest/googlemock
2222

2323
CMAKE=cmake
2424

25-
TESTFLAGS = -I$(GTEST_DIR)/include -L$(GTEST_DIR)/make/lib -lgtest
25+
TESTFLAGS = -I$(GTEST_DIR)/include -L$(GTEST_DIR)/build/lib -lgtest
2626

2727
.PHONY: cxx-tests
2828
cxx-tests: $(CXX_TARGETS)
@@ -52,24 +52,25 @@ run-custatevec-tests: custatevec-tests
5252
run-hip-tests: hip-tests
5353
for exe in $(HIP_TARGETS); do if ! ./$$exe; then exit 1; fi; done
5454

55-
$(GTEST_DIR)/make:
55+
$(GTEST_DIR)/build:
5656
-git submodule update --init --recursive googletest
57-
mkdir -p $(GTEST_DIR)/make
58-
cd $(GTEST_DIR)/make && $(CMAKE) .. && $(MAKE)
57+
mkdir -p $(GTEST_DIR)/build
58+
cd $(GTEST_DIR) && $(CMAKE) -B build -S ..
59+
cd $(GTEST_DIR)/build && make
5960

60-
%.x: %.cc $(GTEST_DIR)/make
61+
%.x: %.cc $(GTEST_DIR)/build
6162
$(CXX) -o ./$@ $< $(TESTFLAGS) $(CXXFLAGS) $(ARCHFLAGS)
6263

63-
%cuda_test.x: %cuda_test.cu $(GTEST_DIR)/make
64+
%cuda_test.x: %cuda_test.cu $(GTEST_DIR)/build
6465
$(NVCC) -o ./$@ $< $(TESTFLAGS) $(NVCCFLAGS)
6566

66-
%custatevec_test.x: %custatevec_test.cu $(GTEST_DIR)/make
67+
%custatevec_test.x: %custatevec_test.cu $(GTEST_DIR)/build
6768
$(NVCC) -o ./$@ $< $(TESTFLAGS) $(NVCCFLAGS) $(CUSTATEVECFLAGS)
6869

69-
%hip_test.x: %cuda_test.cu $(GTEST_DIR)/make
70+
%hip_test.x: %cuda_test.cu $(GTEST_DIR)/build
7071
$(HIPCC) -o ./$@ $< $(TESTFLAGS) $(HIPCCFLAGS)
7172

7273
.PHONY: clean
7374
clean:
7475
-rm -f ./*.x ./*.a ./*.so ./*.mod
75-
rm -rf $(GTEST_DIR)/make
76+
rm -rf $(GTEST_DIR)/build

0 commit comments

Comments
 (0)