From 4e14e26886db80ad07cf7fb9edac5926308c5fdb Mon Sep 17 00:00:00 2001 From: Christian Banse Date: Sat, 4 Jan 2025 18:06:14 +0100 Subject: [PATCH] Skip C++ neo4j tests if C++ frontend is not enabled This PR skips the C++-based neo4j tests, if the C++ frontend is not enabled. We should also add more language-neutral tests to neo4j in the future. --- .../aisec/cpg_vis_neo4j/ApplicationTest.kt | 2 + .../aisec/cpg_vis_neo4j/Neo4JTest.kt | 3 + .../SkipIfLanguageIsNotAvailable.kt | 64 +++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 cpg-neo4j/src/test/kotlin/de/fraunhofer/aisec/cpg_vis_neo4j/SkipIfLanguageIsNotAvailable.kt diff --git a/cpg-neo4j/src/test/kotlin/de/fraunhofer/aisec/cpg_vis_neo4j/ApplicationTest.kt b/cpg-neo4j/src/test/kotlin/de/fraunhofer/aisec/cpg_vis_neo4j/ApplicationTest.kt index e121a98116d..f1474218a92 100644 --- a/cpg-neo4j/src/test/kotlin/de/fraunhofer/aisec/cpg_vis_neo4j/ApplicationTest.kt +++ b/cpg-neo4j/src/test/kotlin/de/fraunhofer/aisec/cpg_vis_neo4j/ApplicationTest.kt @@ -60,6 +60,7 @@ fun createTranslationResult(file: String = "client.cpp"): Pair + } catch (_: ClassNotFoundException) { + return ConditionEvaluationResult.disabled( + "Language ${annotation.language} is not available" + ) + } + + return ConditionEvaluationResult.enabled("Language ${annotation.language} is available") + } +}