From bef115af819ce70dfabe3fe57bf86e44b2bd68b0 Mon Sep 17 00:00:00 2001 From: Sam Wilson Date: Thu, 11 Jan 2024 00:30:42 -0500 Subject: [PATCH] Gate tests based on feature macros --- tests/aztec_blackbox_tests.rs | 1 + tests/codabar_blackbox_1_test_case.rs | 1 + tests/code_128_blackbox.rs | 2 ++ tests/code_39_blackbox_reader.rs | 2 ++ tests/code_93_blackbox_1_testcase.rs | 1 + tests/cpp_qr_code_blackbox_tests.rs | 1 + tests/datamatrix_black_box_test_cases.rs | 1 + tests/ean_13_blackbox_tests.rs | 1 + tests/ean_8_black_box_1_testcase.rs | 1 + tests/github_issues.rs | 5 +++-- tests/inverted_data_matrix_black_box_testcase.rs | 1 + tests/itf_blackbox.rs | 1 + tests/maxicode_blackbox_tests.rs | 1 + tests/pdf_417_black_box_4_testcase.rs | 2 ++ tests/pdf_417_blackbox_tests.rs | 2 ++ tests/qr_code_blackbox_tests.rs | 1 + tests/rss_14_blackbox.rs | 1 + tests/rss_expanded_blackbox.rs | 1 + tests/telepen_blackbox_1_test_case.rs | 1 + tests/upc_a_blackbox_tests.rs | 1 + tests/upc_e_blackbox_tests.rs | 1 + tests/upc_ean_extension_black_box_1_testcase.rs | 1 + 22 files changed, 28 insertions(+), 2 deletions(-) diff --git a/tests/aztec_blackbox_tests.rs b/tests/aztec_blackbox_tests.rs index 8120407..de0cbae 100644 --- a/tests/aztec_blackbox_tests.rs +++ b/tests/aztec_blackbox_tests.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{aztec::AztecReader, BarcodeFormat}; diff --git a/tests/codabar_blackbox_1_test_case.rs b/tests/codabar_blackbox_1_test_case.rs index e7c3e81..3f3a158 100644 --- a/tests/codabar_blackbox_1_test_case.rs +++ b/tests/codabar_blackbox_1_test_case.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{oned::CodaBarReader, BarcodeFormat}; diff --git a/tests/code_128_blackbox.rs b/tests/code_128_blackbox.rs index dcf17e5..bcf3c92 100644 --- a/tests/code_128_blackbox.rs +++ b/tests/code_128_blackbox.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "image")] + use rxing::{BarcodeFormat, MultiFormatReader}; mod common; diff --git a/tests/code_39_blackbox_reader.rs b/tests/code_39_blackbox_reader.rs index ce70a40..6abc014 100644 --- a/tests/code_39_blackbox_reader.rs +++ b/tests/code_39_blackbox_reader.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "image")] + /** * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/tests/code_93_blackbox_1_testcase.rs b/tests/code_93_blackbox_1_testcase.rs index db2feb7..04e7c55 100644 --- a/tests/code_93_blackbox_1_testcase.rs +++ b/tests/code_93_blackbox_1_testcase.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{BarcodeFormat, MultiFormatReader}; diff --git a/tests/cpp_qr_code_blackbox_tests.rs b/tests/cpp_qr_code_blackbox_tests.rs index d068684..6fe7297 100644 --- a/tests/cpp_qr_code_blackbox_tests.rs +++ b/tests/cpp_qr_code_blackbox_tests.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{qrcode::cpp_port::QrReader, BarcodeFormat, MultiUseMultiFormatReader}; diff --git a/tests/datamatrix_black_box_test_cases.rs b/tests/datamatrix_black_box_test_cases.rs index 94836ba..37bb1f7 100644 --- a/tests/datamatrix_black_box_test_cases.rs +++ b/tests/datamatrix_black_box_test_cases.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::MultiFormatReader; diff --git a/tests/ean_13_blackbox_tests.rs b/tests/ean_13_blackbox_tests.rs index 52e64bd..e794ea5 100644 --- a/tests/ean_13_blackbox_tests.rs +++ b/tests/ean_13_blackbox_tests.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{BarcodeFormat, MultiFormatReader}; diff --git a/tests/ean_8_black_box_1_testcase.rs b/tests/ean_8_black_box_1_testcase.rs index 1cf30d7..f21aaca 100644 --- a/tests/ean_8_black_box_1_testcase.rs +++ b/tests/ean_8_black_box_1_testcase.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{BarcodeFormat, MultiFormatReader}; diff --git a/tests/github_issues.rs b/tests/github_issues.rs index 0a6db83..164a550 100644 --- a/tests/github_issues.rs +++ b/tests/github_issues.rs @@ -1,7 +1,5 @@ use std::io::Read; -use rxing::DecodingHintDictionary; - #[test] fn issue_27_part_2() { let mut data = Vec::new(); @@ -13,8 +11,11 @@ fn issue_27_part_2() { rxing::helpers::detect_multiple_in_luma(data, 720, 618).unwrap_or_default(); } +#[cfg(feature = "image")] #[test] fn issue_28() { + use rxing::DecodingHintDictionary; + let mut hints: DecodingHintDictionary = DecodingHintDictionary::new(); hints.insert( rxing::DecodeHintType::TRY_HARDER, diff --git a/tests/inverted_data_matrix_black_box_testcase.rs b/tests/inverted_data_matrix_black_box_testcase.rs index a6efffd..9b52a5c 100644 --- a/tests/inverted_data_matrix_black_box_testcase.rs +++ b/tests/inverted_data_matrix_black_box_testcase.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{DecodeHintType, DecodeHintValue, MultiFormatReader}; diff --git a/tests/itf_blackbox.rs b/tests/itf_blackbox.rs index 9bfbb0f..6e05ac4 100644 --- a/tests/itf_blackbox.rs +++ b/tests/itf_blackbox.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{BarcodeFormat, MultiFormatReader}; diff --git a/tests/maxicode_blackbox_tests.rs b/tests/maxicode_blackbox_tests.rs index fe2bbe0..e27a7b9 100644 --- a/tests/maxicode_blackbox_tests.rs +++ b/tests/maxicode_blackbox_tests.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{BarcodeFormat, DecodeHintType, MultiFormatReader}; diff --git a/tests/pdf_417_black_box_4_testcase.rs b/tests/pdf_417_black_box_4_testcase.rs index d36c12e..0ea8ccc 100644 --- a/tests/pdf_417_black_box_4_testcase.rs +++ b/tests/pdf_417_black_box_4_testcase.rs @@ -13,6 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] + mod common; use rxing::pdf417::PDF417Reader; diff --git a/tests/pdf_417_blackbox_tests.rs b/tests/pdf_417_blackbox_tests.rs index 59e6eae..7dd6bf3 100644 --- a/tests/pdf_417_blackbox_tests.rs +++ b/tests/pdf_417_blackbox_tests.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "image")] + use rxing::MultiFormatReader; mod common; diff --git a/tests/qr_code_blackbox_tests.rs b/tests/qr_code_blackbox_tests.rs index 1952f05..93b9a69 100644 --- a/tests/qr_code_blackbox_tests.rs +++ b/tests/qr_code_blackbox_tests.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{qrcode::QRCodeReader, BarcodeFormat, MultiFormatReader}; diff --git a/tests/rss_14_blackbox.rs b/tests/rss_14_blackbox.rs index 56a7c87..3372fe0 100644 --- a/tests/rss_14_blackbox.rs +++ b/tests/rss_14_blackbox.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{BarcodeFormat, MultiFormatReader}; diff --git a/tests/rss_expanded_blackbox.rs b/tests/rss_expanded_blackbox.rs index e3dad0a..2f0f392 100644 --- a/tests/rss_expanded_blackbox.rs +++ b/tests/rss_expanded_blackbox.rs @@ -23,6 +23,7 @@ * * http://www.piramidepse.com/ */ +#![cfg(feature = "image")] use rxing::{BarcodeFormat, MultiFormatReader}; diff --git a/tests/telepen_blackbox_1_test_case.rs b/tests/telepen_blackbox_1_test_case.rs index 9d63585..97a8bc1 100644 --- a/tests/telepen_blackbox_1_test_case.rs +++ b/tests/telepen_blackbox_1_test_case.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{oned::TelepenReader, BarcodeFormat}; diff --git a/tests/upc_a_blackbox_tests.rs b/tests/upc_a_blackbox_tests.rs index d206ff2..6e25036 100644 --- a/tests/upc_a_blackbox_tests.rs +++ b/tests/upc_a_blackbox_tests.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{BarcodeFormat, MultiFormatReader}; diff --git a/tests/upc_e_blackbox_tests.rs b/tests/upc_e_blackbox_tests.rs index f8a29e9..ce52b18 100644 --- a/tests/upc_e_blackbox_tests.rs +++ b/tests/upc_e_blackbox_tests.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{BarcodeFormat, MultiFormatReader}; diff --git a/tests/upc_ean_extension_black_box_1_testcase.rs b/tests/upc_ean_extension_black_box_1_testcase.rs index 1e58a0d..f9e6bee 100644 --- a/tests/upc_ean_extension_black_box_1_testcase.rs +++ b/tests/upc_ean_extension_black_box_1_testcase.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#![cfg(feature = "image")] use rxing::{BarcodeFormat, MultiFormatReader};