File tree Expand file tree Collapse file tree 2 files changed +32
-7
lines changed
regression/validate-trace-xml-schema Expand file tree Collapse file tree 2 files changed +32
-7
lines changed Original file line number Diff line number Diff line change 1
1
# The Schema tests require a JDK because we use the
2
2
# Java standard libraries builtin schema validation functionality
3
3
find_package (Java COMPONENTS Development )
4
- if (${Java_FOUND} AND ${Java_VERSION_MAJOR} VERSION_GREATER 8 )
4
+ find_package (Python3 COMPONENTS Interpreter )
5
+ if (${Python3_FOUND} AND ${Python3_VERSION} VERSION_GREATER 3.5
6
+ AND ${Java_FOUND} AND ${Java_VERSION_MAJOR} VERSION_GREATER 8 )
5
7
add_test (NAME validate-trace-xml-schema
6
8
COMMAND python3 check.py $< TARGET_FILE:cbmc>
7
9
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} )
@@ -10,4 +12,4 @@ if(${Java_FOUND} AND ${Java_VERSION_MAJOR} VERSION_GREATER 8)
10
12
LABELS "CBMC;CORE" )
11
13
else ()
12
14
message (WARNING "JDK not found, skipping trace schema tests" )
13
- endif ()
15
+ endif ()
Original file line number Diff line number Diff line change 1
- if command -v javac && command -v python3
2
- then
3
- python3 check.py ../../src/cbmc/cbmc
4
- else
5
- echo " javac or python3 not found, skipping XSD tests"
1
+ if ! command -v python3 > /dev/null; then
2
+ echo " python3 not found, skipping XSD tests"
3
+ exit
6
4
fi
5
+
6
+ python_minor_version=$( python3 --version | cut -d ' ' -f 2 | cut -d ' .' -f 2)
7
+
8
+ if [ $python_minor_version -lt 5 ]; then
9
+ echo " python version less than 3.5, skipping XSD tests"
10
+ exit
11
+ fi
12
+
13
+ if ! command -v javac > /dev/null; then
14
+ echo " javac not found, skipping XSD tests"
15
+ exit
16
+ fi
17
+
18
+ # Java versions are complicated
19
+
20
+ java_version=$( javac -version | cut -d ' ' -f 2)
21
+ javac_major_version=$( echo $java_version | cut -d ' .' -f 1)
22
+ javac_minor_version=$( echo $java_version | cut -d ' .' -f 2)
23
+
24
+ if [ $javac_major_version -eq 1 ] || [ $javac_minor_version -ge 8 ]; then
25
+ echo " JDK version less than 8, skipping XSD tests"
26
+ exit
27
+ fi
28
+
29
+ python3 check.py ../../src/cbmc/cbmc
You can’t perform that action at this time.
0 commit comments