From 3cc2154e3ad47d52e54dadc484155184dd981f95 Mon Sep 17 00:00:00 2001 From: kobe63 Date: Tue, 14 Nov 2023 22:15:55 +0100 Subject: [PATCH] ignore empty experimental directory --- build.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index e5cfe3d6..88e7b59c 100644 --- a/build.rs +++ b/build.rs @@ -77,10 +77,14 @@ fn create_tests_module() -> String { "//TEST_FUNCTIONS_STABLE", &create_test_functions("./tests/jsons/stable", TestType::Stable), ); - tests_mod = tests_mod.replace( - "//TEST_FUNCTIONS_EXPERIMENTAL", - &create_test_functions("./tests/jsons/experimental", TestType::Experimental), - ); + let experimental_testdir = "./tests/jsons/experimental"; + if std::fs::read_dir(experimental_testdir).is_ok_and(|dir| dir.count() > 0) { + //ignore empty experimental directory + tests_mod = tests_mod.replace( + "//TEST_FUNCTIONS_EXPERIMENTAL", + &create_test_functions(experimental_testdir, TestType::Experimental), + ); + } tests_mod }