Skip to content

Commit

Permalink
[NFC] Reorganization of the nightly target tests (part 1) (NVIDIA#851)
Browse files Browse the repository at this point in the history
* Reorganize the tests.

This moves target tests into their own directory tree. This fixes the
following issues.
  - tests being run more than once in regression tests
  - test names having to be hardcoded into scripts
  - the closed selection of new tests on backend simulators

* Workaround the aggressive code format checking.

* Remove another format check.
  • Loading branch information
schweitzpgi authored Nov 2, 2023
1 parent 717a224 commit 5117efc
Show file tree
Hide file tree
Showing 65 changed files with 71 additions and 6 deletions.
1 change: 1 addition & 0 deletions targettests/ionq/bug_qubit.cpp
1 change: 1 addition & 0 deletions targettests/ionq/callable_kernel_arg.cpp
1 change: 1 addition & 0 deletions targettests/ionq/graph_coloring-1.cpp
1 change: 1 addition & 0 deletions targettests/ionq/graph_coloring.cpp
1 change: 1 addition & 0 deletions targettests/ionq/if_jit.cpp
1 change: 1 addition & 0 deletions targettests/ionq/load_value.cpp
1 change: 1 addition & 0 deletions targettests/ionq/qspan_slices.cpp
1 change: 1 addition & 0 deletions targettests/ionq/sudoku_2x2-1.cpp
1 change: 1 addition & 0 deletions targettests/ionq/sudoku_2x2-bit_names.cpp
1 change: 1 addition & 0 deletions targettests/ionq/sudoku_2x2-reg_name.cpp
1 change: 1 addition & 0 deletions targettests/ionq/sudoku_2x2.cpp
1 change: 1 addition & 0 deletions targettests/ionq/swap_gate.cpp
1 change: 1 addition & 0 deletions targettests/ionq/test-int8_t.cpp
1 change: 1 addition & 0 deletions targettests/ionq/test-int8_t_free_func.cpp
1 change: 1 addition & 0 deletions targettests/ionq/test-observe.cpp
1 change: 1 addition & 0 deletions targettests/ionq/variable_size_qreg.cpp
1 change: 1 addition & 0 deletions targettests/iqm/bug_qubit.cpp
1 change: 1 addition & 0 deletions targettests/iqm/callable_kernel_arg.cpp
1 change: 1 addition & 0 deletions targettests/iqm/if_jit.cpp
1 change: 1 addition & 0 deletions targettests/iqm/load_value.cpp
1 change: 1 addition & 0 deletions targettests/iqm/swap_gate.cpp
1 change: 1 addition & 0 deletions targettests/iqm/test-int8_t.cpp
1 change: 1 addition & 0 deletions targettests/iqm/test-int8_t_free_func.cpp
1 change: 1 addition & 0 deletions targettests/iqm/variable_size_qreg.cpp
1 change: 1 addition & 0 deletions targettests/oqc/bug_qubit.cpp
1 change: 1 addition & 0 deletions targettests/oqc/callable_kernel_arg.cpp
1 change: 1 addition & 0 deletions targettests/oqc/if_jit.cpp
1 change: 1 addition & 0 deletions targettests/oqc/load_value.cpp
1 change: 1 addition & 0 deletions targettests/oqc/swap_gate.cpp
1 change: 1 addition & 0 deletions targettests/oqc/test-int8_t.cpp
1 change: 1 addition & 0 deletions targettests/oqc/test-int8_t_free_func.cpp
1 change: 1 addition & 0 deletions targettests/oqc/variable_size_qreg.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/bug_qubit.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/callable_kernel_arg.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/graph_coloring-1.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/graph_coloring.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/if_jit.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/load_value.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/qspan_slices.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/sudoku_2x2-1.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/sudoku_2x2-bit_names.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/sudoku_2x2-reg_name.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/sudoku_2x2.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/swap_gate.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/test-int8_t.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/test-int8_t_free_func.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/test-observe.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/testConditionalSample.cpp
1 change: 1 addition & 0 deletions targettests/quantinuum/variable_size_qreg.cpp
3 changes: 2 additions & 1 deletion test/NVQPP/bug_qubit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

// This code is from Issue 251.

// clang-format off
// RUN: nvq++ --enable-mlir -v %s --target quantinuum --emulate -o %t.x && %t.x | FileCheck %s
// RUN: cudaq-quake %s | cudaq-opt --promote-qubit-allocation | FileCheck --check-prefixes=MLIR %s

Expand Down Expand Up @@ -38,4 +39,4 @@ int main() {
return 0;
}

// CHECK: 1
// CHECK: 1
1 change: 1 addition & 0 deletions test/NVQPP/callable_kernel_arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ %s -o %basename_t.x --target quantinuum --emulate && ./%basename_t.x | FileCheck %s

#include <cudaq.h>
Expand Down
1 change: 1 addition & 0 deletions test/NVQPP/conditional_sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ --enable-mlir %s -o %basename_t.x && ./%basename_t.x
// RUN: nvq++ --target quantinuum --emulate %s -o %basename_t.x && ./%basename_t.x

Expand Down
1 change: 1 addition & 0 deletions test/NVQPP/cudaq_observe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ %s -o %basename_t.x --target quantinuum --emulate && ./%basename_t.x | FileCheck %s

// 2 different IQM machines for 2 different topologies
Expand Down
1 change: 1 addition & 0 deletions test/NVQPP/graph_coloring-1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ -v %s -o %basename_t.x --target quantinuum --emulate && ./%basename_t.x | FileCheck %s

#include <cudaq.h>
Expand Down
1 change: 1 addition & 0 deletions test/NVQPP/graph_coloring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ -v %s -o %basename_t.x --target quantinuum --emulate && ./%basename_t.x | FileCheck %s

#include <cudaq.h>
Expand Down
3 changes: 2 additions & 1 deletion test/NVQPP/int8_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ -v %s -o %basename_t.x --target quantinuum --emulate && ./%basename_t.x | FileCheck %s

#include <cudaq.h>
Expand Down Expand Up @@ -35,4 +36,4 @@ int main() {
// CHECK: 0
// CHECK: 00
// CHECK: 000
// CHECK: 0000
// CHECK: 0000
1 change: 1 addition & 0 deletions test/NVQPP/int8_t_free_func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ --target quantinuum --emulate %s -o %basename_t.x && ./%basename_t.x | FileCheck %s

#include <cudaq.h>
Expand Down
1 change: 1 addition & 0 deletions test/NVQPP/load_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ %s -o %basename_t.x --target quantinuum --emulate && ./%basename_t.x | FileCheck %s
// RUN: nvq++ %s -o %basename_t.x --target iqm --iqm-machine Adonis --emulate && ./%basename_t.x | FileCheck %s
// RUN: nvq++ %s -o %basename_t.x --target iqm --iqm-machine Apollo --emulate && ./%basename_t.x | FileCheck %s
Expand Down
1 change: 1 addition & 0 deletions test/NVQPP/qspan_slices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ -v %s -o %basename_t.x --target quantinuum --emulate && ./%basename_t.x | FileCheck %s
// RUN: nvq++ -v %s -o %basename_t.x --target iqm --iqm-machine Adonis --emulate && ./%basename_t.x | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions test/NVQPP/sudoku_2x2-1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ -v %s -o %basename_t.x --target quantinuum --emulate && ./%basename_t.x | FileCheck %s

#include <cudaq.h>
Expand Down
3 changes: 2 additions & 1 deletion test/NVQPP/sudoku_2x2-bit_names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ -v %s -o %basename_t.x --target quantinuum --emulate && ./%basename_t.x | FileCheck %s

#include <cudaq.h>
Expand Down Expand Up @@ -91,4 +92,4 @@ int main() {
}

// CHECK-DAG: 1001
// CHECK-DAG: 0110
// CHECK-DAG: 0110
3 changes: 2 additions & 1 deletion test/NVQPP/sudoku_2x2-reg_name.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ -v %s -o %basename_t.x --target quantinuum --emulate && ./%basename_t.x | FileCheck %s

#include <cudaq.h>
Expand Down Expand Up @@ -67,4 +68,4 @@ int main() {
}

// CHECK-DAG: 1001
// CHECK-DAG: 0110
// CHECK-DAG: 0110
3 changes: 2 additions & 1 deletion test/NVQPP/sudoku_2x2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ -v %s -o %basename_t.x --target quantinuum --emulate && ./%basename_t.x | FileCheck %s

#include <cudaq.h>
Expand Down Expand Up @@ -66,4 +67,4 @@ int main() {
}

// CHECK-DAG: 1001
// CHECK-DAG: 0110
// CHECK-DAG: 0110
3 changes: 2 additions & 1 deletion test/NVQPP/swap_gate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ -v %s -o %basename_t.x --target quantinuum --emulate && ./%basename_t.x | FileCheck %s

#include "cudaq.h"
Expand All @@ -31,4 +32,4 @@ int main() {
return 0;
}

// CHECK: 01
// CHECK: 01
1 change: 1 addition & 0 deletions test/NVQPP/variable_size_qreg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* the terms of the Apache License 2.0 which accompanies this distribution. *
******************************************************************************/

// clang-format off
// RUN: nvq++ -v %s -o %basename_t.x --target quantinuum --emulate && ./%basename_t.x | FileCheck %s

#include <cudaq.h>
Expand Down

0 comments on commit 5117efc

Please sign in to comment.