Commit 2567f726 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

removing old test, adding updated docker ci files

parent d15890aa
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
from xacc/ubuntu:18.04

run apt-get update && apt-get install -y ninja-build \
    && git clone https://github.com/hfinkel/llvm-project-csp llvm \
    && cd llvm && mkdir build && cd build \
    && cmake -G Ninja ../llvm -DCMAKE_INSTALL_PREFIX=$HOME/.llvm -DBUILD_SHARED_LIBS=TRUE -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS=clang \
    && cmake --build . --target install \
    && ln -sf $HOME/.llvm/bin/llvm-config /usr/bin/ && cd ../../ && rm -rf /llvm /var/lib/apt/lists/*
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
from xacc/ubuntu:18.04
from qcor/qcor-base
run git clone --recursive https://github.com/eclipse/xacc && cd xacc && mkdir build && cd build \
    && cmake .. \
    && make -j$(nproc) install \
    && cd ../../ && git clone -b master https://github.com/ornl-qci/qcor && cd qcor && mkdir build && cd build \
    && cmake .. -DXACC_DIR=~/.xacc -DQCOR_BUILD_TESTS=TRUE \
    && make -j$(nproc) install && ctest --output-on-failure
 No newline at end of file
    && make -j$(nproc) install 
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ install(FILES ${HEADERS} DESTINATION include/qcor)
install(TARGETS ${LIBRARY_NAME} DESTINATION lib)

if (QCOR_BUILD_TESTS)
  add_subdirectory(tests)
  #add_subdirectory(tests)
endif()

add_subdirectory(objectives)
 No newline at end of file

runtime/tests/CMakeLists.txt

deleted100644 → 0
+0 −12
Original line number Diff line number Diff line
set(CMAKE_CXX_COMPILER ${CMAKE_BINARY_DIR}/qcor)
set(ORIGINAL_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
link_directories(${XACC_ROOT}/lib)

set(CMAKE_CXX_FLAGS "--qcor-driver-path ${CMAKE_BINARY_DIR}/compiler ${ORIGINAL_CXX_FLAGS} -a local-ibm -I${CMAKE_SOURCE_DIR}/runtime -L${CMAKE_BINARY_DIR}/runtime ")

add_executable(test_simple_kernel test_simple_kernel.cpp)
target_include_directories(test_simple_kernel PRIVATE ${XACC_INCLUDE_ROOT}/gtest)
add_test(test_simple_kernel test_simple_kernel)
target_link_libraries(test_simple_kernel PRIVATE gtest gtest_main)

add_dependencies(test_simple_kernel qcor-driver)
+0 −45
Original line number Diff line number Diff line
#include <gtest/gtest.h>
#include "qcor.hpp"



TEST(test_task_initiate, checkVariations) {

  auto bell = [&](qbit q) {
      H(q[0]);
      CX(q[0],q[1]);
      Measure(q[0]);
      Measure(q[1]);
  };

  // Test just executing the kernel
  auto q = qcor::qalloc(2);
  bell(q);
  q->print();
  EXPECT_TRUE(q->getMeasurementCounts().count("00"));
  EXPECT_TRUE(q->getMeasurementCounts().count("11"));

  // Now test with submit()
  auto handle = qcor::submit([&](qcor::qpu_handler& qh) {
      qh.execute(bell);
  });
  auto results = qcor::sync(handle);
  results->print();
  EXPECT_TRUE(results->getMeasurementCounts().count("00"));
  EXPECT_TRUE(results->getMeasurementCounts().count("11"));

  // Now test with task initiate
//   auto handle1 = qcor::taskInitiate(bell);
//   auto results2 = qcor::sync(handle1);
//   results2->print();
//   EXPECT_TRUE(results->getMeasurementCounts().count("00"));
//   EXPECT_TRUE(results->getMeasurementCounts().count("11"));

}

int main(int argc, char **argv) {
  xacc::Initialize();//argc, argv);
  ::testing::InitGoogleTest(&argc, argv);
  auto ret = RUN_ALL_TESTS();
  return ret;
}