-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
CMakeLists.txt
1460 lines (1317 loc) · 67.9 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# instructions - see ../doc/testing.txt
#set(DEBUG_OSCD 1) # print debug info during cmake
cmake_minimum_required(VERSION 3.0)
if(POLICY CMP0017)
# Explicitly use new include policy to avoid globally shadowing included modules
# http://www.cmake.org/cmake/help/cmake-2-8-docs.html#policy:CMP0017
cmake_policy(SET CMP0017 NEW)
endif()
cmake_policy(SET CMP0057 NEW) # Interpret IN_LIST
cmake_policy(SET CMP0070 NEW) # Allow relative paths for file(GENERATE ...)
enable_testing()
option(USE_IMAGE_COMPARE_PY "Use built-in image_compare.py" ON)
# Use variables for common paths, to reduce line lengths.
# Very commonly used cmake-provided paths
set(CBD ${CMAKE_BINARY_DIR}) # build top level
set(CSD ${CMAKE_SOURCE_DIR}) # project top level
set(CCBD ${CMAKE_CURRENT_BINARY_DIR}) # tests build dir
set(CCSD ${CMAKE_CURRENT_SOURCE_DIR}) # tests source dir
# Project paths
set(LIBRARIES_DIR "${CSD}/libraries")
set(EXAMPLES_DIR "${CSD}/examples")
# Test Data paths
set(TEST_DATA_DIR "${CCSD}/data")
set(TEST_SCAD_DIR "${CCSD}/data/scad")
set(TEST_CUSTOMIZER_DIR "${CCSD}/data/scad/customizer")
set(TEST_PYTHON_DIR "${CCSD}/data/python")
# Test runner Python scripts
set(CGALSTLSANITYTEST_PY "${CCSD}/cgalstlsanitytest.py")
set(EX_IM_PNGTEST_PY "${CCSD}/export_import_pngtest.py")
set(EXPORT_PNGTEST_PY "${CCSD}/export_pngtest.py")
set(SHOULDFAIL_PY "${CCSD}/shouldfail.py")
set(TEST_CMDLINE_TOOL_PY "${CCSD}/test_cmdline_tool.py")
######################
# Check Dependencies #
######################
# If ctest is run with no configuration specified, then force "Default"
set_directory_properties(PROPERTIES TEST_INCLUDE_FILES "${CCSD}/EnforceConfig.cmake")
# MCAD
if(NOT EXISTS ${LIBRARIES_DIR}/MCAD/__init__.py)
message(FATAL_ERROR "MCAD not found. You can install from the OpenSCAD root as follows: \n git submodule update --init")
endif()
list(APPEND CTEST_ENVIRONMENT "OPENSCADPATH=${LIBRARIES_DIR}")
find_package(PythonInterp 3.4 REQUIRED)
# Image comparison - expected test image vs actual generated image
if(USE_IMAGE_COMPARE_PY)
set(VENV_DIR "${CCBD}/venv")
message(STATUS "Preparing image_compare.py for test suite image comparison")
if(WIN32)
set(IMAGE_COMPARE_EXE "${VENV_DIR}/Scripts/python.exe")
else()
set(IMAGE_COMPARE_EXE "${VENV_DIR}/bin/python")
endif()
if(EXISTS "${IMAGE_COMPARE_EXE}")
message(STATUS "venv found, testing libraries")
execute_process(
COMMAND "${IMAGE_COMPARE_EXE}" "${CCSD}/image_compare.py" "--status"
WORKING_DIRECTORY "${CCSD}" ERROR_QUIET RESULT_VARIABLE ret)
if(ret AND NOT ret EQUAL 0)
message(STATUS "venv libraries incomplete")
set(BUILD_VENV TRUE)
else()
message(STATUS "venv libraries complete")
set(BUILD_VENV FALSE)
endif()
else()
message(STATUS "venv not found")
set(BUILD_VENV TRUE)
endif()
if(BUILD_VENV)
message(STATUS "Setting up testing venv for image comparison")
find_package(Python3 COMPONENTS Interpreter)
execute_process(
COMMAND "${Python3_EXECUTABLE}" "-m" "venv" "venv" "--without-pip"
WORKING_DIRECTORY "${CCBD}")
execute_process(
COMMAND "${IMAGE_COMPARE_EXE}" "-m" "ensurepip"
WORKING_DIRECTORY "${CCBD}")
execute_process(
COMMAND "${IMAGE_COMPARE_EXE}" "-m" "pip" "install" "numpy" "Pillow"
WORKING_DIRECTORY "${CCBD}")
endif()
set(COMPARATOR "--comparator=image_compare")
if(BUILD_VENV)
execute_process(
COMMAND "${IMAGE_COMPARE_EXE}" "${CCSD}/image_compare.py" "--status"
WORKING_DIRECTORY "${CCSD}" RESULT_VARIABLE ret)
if(ret AND NOT ret EQUAL 0)
message(WARNING "Failed to setup the test suite venv for ${IMAGE_COMPARE_EXE} See doc/testing.txt for dependency information.")
else()
message(STATUS "venv setup for ${IMAGE_COMPARE_EXE}")
endif()
else()
message(STATUS "venv already setup for ${IMAGE_COMPARE_EXE}")
endif()
else()
# Imagemagick
find_package(ImageMagick COMPONENTS convert)
if(ImageMagick_convert_FOUND)
message(STATUS "ImageMagick convert executable found: " ${ImageMagick_convert_EXECUTABLE})
set(IMAGE_COMPARE_EXE ${ImageMagick_convert_EXECUTABLE})
if ("${ImageMagick_VERSION_STRING}" VERSION_LESS "6.5.9.4")
message(STATUS "ImageMagick version less than 6.5.9.4, cannot use -morphology comparison")
message(STATUS "ImageMagick Using older image comparison method")
set(COMPARATOR "--comparator=old")
endif()
execute_process(COMMAND ${IMAGE_COMPARE_EXE} --version OUTPUT_VARIABLE IM_OUT)
if (${IM_OUT} MATCHES "OpenMP")
# http://www.daniloaz.com/en/617/systems/high-cpu-load-when-converting-images-with-imagemagick
message(STATUS "ImageMagick: OpenMP bug workaround - setting MAGICK_THREAD_LIMIT=1")
list(APPEND CTEST_ENVIRONMENT "MAGICK_THREAD_LIMIT=1")
endif()
message(STATUS "Comparing magicktest1.png with magicktest2.png")
set(IM_TEST_FILES "${CCSD}/magicktest1.png" "${CCSD}/magicktest2.png")
set(COMPARE_ARGS ${IMAGE_COMPARE_EXE} ${IM_TEST_FILES} -alpha On -compose difference -composite -threshold 8% -morphology Erode Square -format %[fx:w*h*mean] info:)
# compare arguments taken from test_cmdline_tool.py
message(STATUS "Running ImageMagick compare: ${COMPARE_ARGS}")
execute_process(COMMAND ${COMPARE_ARGS} RESULT_VARIABLE IM_RESULT OUTPUT_VARIABLE IM_OUT)
if (IM_RESULT)
message(STATUS "ImageMagick failed to run")
message(STATUS "Using alternative image comparison")
set(DIFFPNG 1)
elif (${IM_OUT} STREQUAL "0")
message(STATUS "magicktest1.png and magicktest2.png were incorrectly detected as identical")
message(STATUS "Using alternative image comparison")
set(DIFFPNG 1)
else()
message(STATUS "ImageMagick OK: Detected pixel difference of ${IM_OUT}")
endif()
else()
message(STATUS "Couldn't find imagemagick 'convert' program")
set(DIFFPNG 1)
endif()
if (${DIFFPNG})
set(IMAGE_COMPARE_EXE ${CCBD}/diffpng)
set(COMPARATOR "--comparator=diffpng")
add_executable(diffpng diffpng.cpp ${CSD}/src/ext/lodepng/lodepng.cpp)
target_include_directories(diffpng PRIVATE ${CSD}/src/ext/lodepng)
message(STATUS "using diffpng for image comparison")
endif()
endif()
find_package(Lib3MF QUIET)
# Disable LIB3MF tests if library was disabled in build
if(NOT LIB3MF_FOUND)
# check again via pkgconfig
if(NOT MSVC)
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(LIB3MF lib3MF)
endif()
endif()
endif()
####################################
# Platform Specific Configurations #
####################################
# Workaround Gallium bugs
if ( ${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
message(STATUS "Workaround PPC bug https://bugs.freedesktop.org/show_bug.cgi?id=42540")
list(APPEND CTEST_ENVIRONMENT "GALLIUM_DRIVER=softpipe")
list(APPEND CTEST_ENVIRONMENT "DRAW_USE_LLVM=no")
endif()
if ( ${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips")
message(STATUS "Workaround MIPS bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868745")
list(APPEND CTEST_ENVIRONMENT "GALLIUM_DRIVER=softpipe")
list(APPEND CTEST_ENVIRONMENT "DRAW_USE_LLVM=no")
endif()
# Determine path for openscad executable
if(EXISTS "$ENV{OPENSCAD_BINARY}")
set(OPENSCAD_BINPATH "$ENV{OPENSCAD_BINARY}")
elseif(APPLE)
set(OPENSCAD_BINPATH "${CBD}/OpenSCAD.app/Contents/MacOS/OpenSCAD")
elseif (WIN32 OR MXECROSS)
set(OPENSCAD_BINPATH "${CBD}/openscad.com")
elseif(EXISTS "${CBD}/bin/openscad")
set(OPENSCAD_BINPATH "${CBD}/bin/openscad")
else()
set(OPENSCAD_BINPATH "${CBD}/openscad")
endif()
#if(EXISTS "${OPENSCAD_BINPATH}")
# message(STATUS "Found OpenSCAD binary: ${OPENSCAD_BINPATH}")
#else()
# message(STATUS "Couldn't find the OpenSCAD binary: ${OPENSCAD_BINPATH}")
# message(FATAL_ERROR "Please build the OpenSCAD binary and place it here: ${OPENSCAD_BINPATH}")
#endif()
list(APPEND CTEST_ENVIRONMENT "OPENSCAD_BINARY=${OPENSCAD_BINPATH}")
# Argument used for import/export tests
set(OPENSCAD_ARG "--openscad=${OPENSCAD_BINPATH}")
###############################
# Define Macros and Functions #
###############################
# Tags tests as experimental. This will add all the --enable=<feature>
# options for the tagged tests.
macro(experimental_tests)
foreach (TESTNAME ${ARGN})
# message("Marking as experimental ${TESTNAME}")
list(APPEND EXPERIMENTAL_TESTS ${TESTNAME})
endforeach()
endmacro()
#
# Returns into the FULLNAME variable the global full test name (identifier)
# given a test command and source filename
#
function(get_test_fullname TESTCMD FILENAME FULLNAME)
get_filename_component(TESTCMD_NAME ${TESTCMD} NAME_WE)
get_filename_component(TESTNAME ${FILENAME} NAME_WE)
string(REPLACE " " "_" TESTNAME ${TESTNAME}) # Test names cannot include spaces
set(${FULLNAME} ${TESTCMD_NAME}_${TESTNAME})
# Export to parent scope
set(${FULLNAME} ${${FULLNAME}} PARENT_SCOPE)
endfunction()
#
# Tags the given tests as belonging to the given CONFIG, i.e. will
# only be executed when run using ctest -C <CONFIG>
#
# Usage example: set_test_config(Heavy dumptest_testname opencsgtest_testname2)
#
function(set_test_config CONFIG)
cmake_parse_arguments(TESTCFG "" "" "FILES;PREFIXES" ${ARGN})
# Get fullnames for test files
if (TESTCFG_PREFIXES)
foreach(PREFIX ${TESTCFG_PREFIXES})
foreach(FILE ${TESTCFG_FILES})
get_test_fullname(${PREFIX} ${FILE} TESTCFG_FULLNAME)
list(APPEND FULLNAMES ${TESTCFG_FULLNAME})
endforeach()
endforeach()
else()
list(APPEND FULLNAMES ${TESTCFG_FILES})
endif()
# Set config on fullnames
list(APPEND ${CONFIG}_TEST_CONFIG ${FULLNAMES})
list(FIND TEST_CONFIGS ${CONFIG} FOUND)
if (FOUND EQUAL -1)
list(APPEND TEST_CONFIGS ${CONFIG})
list(SORT TEST_CONFIGS)
# Export to parent scope
set(TEST_CONFIGS ${TEST_CONFIGS} CACHE INTERNAL "")
endif()
# Export to parent scope
set(${CONFIG}_TEST_CONFIG ${${CONFIG}_TEST_CONFIG} CACHE INTERNAL "")
endfunction()
#
# Returns a list of test configs
#
function(get_test_config TESTNAME OUTVAR)
unset(CONFIGS)
foreach(CONFIG ${TEST_CONFIGS})
list(FIND ${CONFIG}_TEST_CONFIG ${TESTNAME} IDX)
if (IDX GREATER -1)
list(APPEND CONFIGS ${CONFIG})
endif()
endforeach()
set(${OUTVAR} "${CONFIGS}" PARENT_SCOPE)
endfunction()
#
# Check if a test file is a 2D test
#
function(is_2d FULLNAME RESULT)
list(FIND ALL_2D_FILES ${FULLNAME} IDX)
if (${IDX} GREATER -1)
set(${RESULT} 1 PARENT_SCOPE)
else()
set(${RESULT} PARENT_SCOPE)
endif()
endfunction()
#
# This functions adds cmd-line tests given files.
#
# Usage add_cmdline_test(testbasename [EXE <executable>] [ARGS <args to exe>]
# [SCRIPT <script>]
# [EXPECTEDDIR <shared dir>] SUFFIX <suffix> FILES <test files>)
#
function(add_cmdline_test TESTCMD_BASENAME)
cmake_parse_arguments(TESTCMD "OPENSCAD;STDIO" "EXE;SCRIPT;SUFFIX;KERNEL;EXPECTEDDIR" "FILES;ARGS" ${ARGN})
set(EXTRA_OPTIONS "")
# If sharing results with another test, pass on this to the python script
if (TESTCMD_EXPECTEDDIR)
list(APPEND EXTRA_OPTIONS -e ${TESTCMD_EXPECTEDDIR})
endif()
if (TESTCMD_KERNEL)
list(APPEND EXTRA_OPTIONS -k ${TESTCMD_KERNEL})
endif()
if (TESTCMD_STDIO)
list(APPEND EXTRA_OPTIONS --stdin --stdout)
endif()
if ((TESTCMD_EXE OR TESTCMD_SCRIPT) AND TESTCMD_OPENSCAD)
message(FATAL_ERROR "add_cmdline_test() does not allow OPENSCAD flag alongside EXE or SCRIPT values")
endif()
# python script implies PYTHON_EXECUTABLE
if (TESTCMD_SCRIPT MATCHES \\.[Pp][Yy]$)
set(TESTCMD_EXE ${PYTHON_EXECUTABLE})
endif()
if (TESTCMD_OPENSCAD)
set(TESTCMD_EXE ${OPENSCAD_BINPATH})
endif()
if (TESTCMD_EXE)
set(TESTNAME_OPTION -t ${TESTCMD_BASENAME})
else()
# If no executable was specified, assume it was built by us and resides here
set(TESTCMD_EXE ${CCBD}/${TESTCMD_BASENAME})
endif()
# Add tests from args
foreach (SCADFILE ${TESTCMD_FILES})
get_filename_component(FILE_BASENAME ${SCADFILE} NAME_WE)
string(REPLACE " " "_" FILE_BASENAME ${FILE_BASENAME}) # Test names cannot include spaces
set(TEST_FULLNAME "${TESTCMD_BASENAME}_${FILE_BASENAME}")
list(FIND EXPERIMENTAL_TESTS ${TEST_FULLNAME} EXPERIMENTAL_TEST)
set(EXPERIMENTAL_OPTION "")
if (NOT (${EXPERIMENTAL_TEST} EQUAL -1))
# add global experimental options here
set(EXPERIMENTAL_OPTION ${EXPERIMENTAL_OPTION} "--enable=roof" "--enable=lazy-union" "--enable=textmetrics" "--enable=import-function")
endif()
# Enable fast-csg for all tests but those that have different expectations or fail for other reasons.
if (NOT SCADFILE IN_LIST SCADFILES_WITH_DIFFERENT_FAST_CSG_EXPECTATIONS
AND NOT SCADFILE IN_LIST SCADFILES_FAILING_WITH_FAST_CSG
AND NOT TEST_FULLNAME IN_LIST TESTS_FAILING_WITH_FAST_CSG)
set(EXPERIMENTAL_OPTION ${EXPERIMENTAL_OPTION} "--enable=fast-csg" "--enable=fast-csg-remesh")
if (NOT SCADFILE IN_LIST FAST_CSG_TRUST_FAILING_SCADFILES)
set(EXPERIMENTAL_OPTION ${EXPERIMENTAL_OPTION} "--enable=fast-csg-trust-corefinement")
endif()
endif()
# 2D tests should be viewed from the top, not an angle.
set(CAMERA_OPTION "")
is_2d(${SCADFILE} IS2D)
if (IS2D)
set(CAMERA_OPTION "--camera=0,0,100,0,0,0" "--viewall" "--autocenter" "--projection=ortho")
endif()
# Handle configurations
get_test_config(${TEST_FULLNAME} FOUNDCONFIGS)
if (NOT FOUNDCONFIGS)
set_test_config(Default FILES ${TEST_FULLNAME})
endif()
set_test_config(All FILES ${TEST_FULLNAME})
list(FIND FOUNDCONFIGS Bugs FOUND)
if (FOUND EQUAL -1)
set_test_config(Good FILES ${TEST_FULLNAME})
endif()
get_test_config(${TEST_FULLNAME} CONFVAL)
set(FILENAME_OPTION -f ${FILE_BASENAME})
# Apply lazy-union to *all* tests for comprehensive testing of this experimental feature.
# Would need all passing before making lazy-union non-experimental, but that's probably a long way off.
# Mostly just breaks issues that export non-manifold/intersecting geometry without explicit union.
#set(EXPERIMENTAL_OPTION ${EXPERIMENTAL_OPTION} "--enable=lazy-union")
# Enable vertex-object-renderers by default for all test if experimental build and openscad executable
if (EXPERIMENTAL AND TESTCMD_OPENSCAD)
set(EXPERIMENTAL_OPTION ${EXPERIMENTAL_OPTION} "--enable=vertex-object-renderers")
#set(EXPERIMENTAL_OPTION ${EXPERIMENTAL_OPTION} "--enable=vertex-object-renderers-prealloc")
#set(EXPERIMENTAL_OPTION ${EXPERIMENTAL_OPTION} "--enable=vertex-object-renderers-direct")
#set(EXPERIMENTAL_OPTION ${EXPERIMENTAL_OPTION} "--enable=vertex-object-renderers-indexing")
endif()
string(JOIN " " DBG_COMMAND_STR
"add_test(" ${TEST_FULLNAME} CONFIGURATIONS ${CONFVAL}
COMMAND ${PYTHON_EXECUTABLE}
${TEST_CMDLINE_TOOL_PY} ${COMPARATOR} -c ${IMAGE_COMPARE_EXE}
-s ${TESTCMD_SUFFIX} ${EXTRA_OPTIONS} ${TESTNAME_OPTION} ${FILENAME_OPTION}
${TESTCMD_EXE} ${TESTCMD_SCRIPT} ${SCADFILE} ${CAMERA_OPTION}
${EXPERIMENTAL_OPTION} ${TESTCMD_ARGS} ")"
)
# Use cmake option "--log-level DEBUG" during top level config to see this
message(DEBUG "${DBG_COMMAND_STR}")
# only add test if it is not experimental or if it is and experimental option is enabled
if (${EXPERIMENTAL_TEST} EQUAL -1 OR EXPERIMENTAL)
add_test(NAME ${TEST_FULLNAME} CONFIGURATIONS ${CONFVAL}
COMMAND ${PYTHON_EXECUTABLE}
${TEST_CMDLINE_TOOL_PY} ${COMPARATOR} -c ${IMAGE_COMPARE_EXE}
-s ${TESTCMD_SUFFIX} ${EXTRA_OPTIONS} ${TESTNAME_OPTION} ${FILENAME_OPTION}
${TESTCMD_EXE} ${TESTCMD_SCRIPT} "${SCADFILE}" ${CAMERA_OPTION}
${EXPERIMENTAL_OPTION} ${TESTCMD_ARGS}
)
set_property(TEST ${TEST_FULLNAME} PROPERTY ENVIRONMENT ${CTEST_ENVIRONMENT})
endif()
endforeach()
endfunction()
# Usage add_failing_test(testbasename RETVAL <expected return value> SUFFIX <suffix> FILES <test files>
# [EXE <executable>] [SCRIPT <script>] [ARGS <args to exe>])
#
function(add_failing_test TESTCMD_BASENAME)
cmake_parse_arguments(TESTCMD "" "RETVAL;EXE;SCRIPT;SUFFIX" "FILES;ARGS" ${ARGN})
if ("${TESTCMD_SUFFIX}" STREQUAL "") # Suffix "off" counts as a false value, so check directly for empty string.
message(FATAL_ERROR "add_failing_test() requires SUFFIX to be set" )
endif()
if (NOT TESTCMD_EXE)
set(TESTCMD_EXE ${PYTHON_EXECUTABLE})
endif()
if (NOT TESTCMD_SCRIPT)
set(TESTCMD_SCRIPT ${SHOULDFAIL_PY})
endif()
set(TESTNAME_OPTION -t ${TESTCMD_BASENAME})
# Add tests from args
foreach (SCADFILE ${TESTCMD_FILES})
get_filename_component(FILE_BASENAME ${SCADFILE} NAME_WE)
string(REPLACE " " "_" FILE_BASENAME ${FILE_BASENAME}) # Test names cannot include spaces
set(TEST_FULLNAME "${TESTCMD_BASENAME}_${FILE_BASENAME}")
# Handle configurations
unset(FOUNDCONFIGS)
get_test_config(${TEST_FULLNAME} FOUNDCONFIGS)
if (NOT FOUNDCONFIGS)
set_test_config(Default FILES ${TEST_FULLNAME})
endif()
set_test_config(All FILES ${TEST_FULLNAME})
unset(FOUNDCONFIGS)
get_test_config(${TEST_FULLNAME} FOUNDCONFIGS)
set(CONFVAL ${FOUNDCONFIGS})
# The python script cannot extract the testname when given extra parameters
if (TESTCMD_ARGS)
set(FILENAME_OPTION -f ${FILE_BASENAME})
endif()
add_test(NAME ${TEST_FULLNAME} CONFIGURATIONS ${CONFVAL} COMMAND ${TESTCMD_EXE} ${TESTCMD_SCRIPT} "${SCADFILE}" -s ${TESTCMD_SUFFIX} ${TESTCMD_ARGS})
set_property(TEST ${TEST_FULLNAME} PROPERTY ENVIRONMENT "${CTEST_ENVIRONMENT}")
endforeach()
endfunction()
#################################################
# Configure Templated Files and Generated Tests #
#################################################
configure_file(${TEST_SCAD_DIR}/templates/include-tests-template.scad
${TEST_SCAD_DIR}/misc/include-tests.scad)
configure_file(${TEST_SCAD_DIR}/templates/use-tests-template.scad
${TEST_SCAD_DIR}/misc/use-tests.scad)
configure_file(${TEST_SCAD_DIR}/templates/import_stl-tests-template.scad
${TEST_SCAD_DIR}/3D/features/import_stl-tests.scad)
configure_file(${TEST_SCAD_DIR}/templates/import_3mf-tests-template.scad
${TEST_SCAD_DIR}/3D/features/import_3mf-tests.scad)
configure_file(${TEST_SCAD_DIR}/templates/import_dxf-tests-template.scad
${TEST_SCAD_DIR}/2D/features/import_dxf-tests.scad)
configure_file(${TEST_PYTHON_DIR}/gen_issue2342-template.py
${TEST_PYTHON_DIR}/gen_issue2342.py)
configure_file(${TEST_PYTHON_DIR}/gen_svg_viewbox_tests-template.py
${TEST_PYTHON_DIR}/gen_svg_viewbox_tests.py)
# Set up custom commands to run before & after Ctest run.
# 1. Start/stop Virtual Framebuffer for linux/bsd. 2. Pretty Print
# Please see the CTestCustom.template file for more info.
message(STATUS "creating CTestCustom.cmake")
set(TEMPLATE_HEADER "Generated by cmake from ${CCSD}/CTestCustom.template")
set(UPLOADARG "")
if ($ENV{OPENSCAD_UPLOAD_TESTS})
set(UPLOADARG "--upload")
endif()
configure_file(${CCSD}/CTestCustom.template ${CCBD}/CTestCustom.cmake @ONLY)
# generate a very large scad file which we would rather not commit to the source tree
# this is for stress-testing the parser
add_custom_target(issue2342 ALL
COMMAND ${PYTHON_EXECUTABLE} ${TEST_PYTHON_DIR}/gen_issue2342.py ">${TEST_SCAD_DIR}/issues/issue2342.scad"
WORKING_DIRECTORY ${GEN_SCRIPT_DIR}
COMMENT "Generating issue2342.scad"
)
add_custom_target(svg_viewbox_tests ALL
COMMAND ${PYTHON_EXECUTABLE} ${TEST_PYTHON_DIR}/gen_svg_viewbox_tests.py "${TEST_DATA_DIR}/svg/viewbox" "${TEST_SCAD_DIR}/svg/extruded"
WORKING_DIRECTORY ${GEN_SCRIPT_DIR}
COMMENT "Generating svg viewbox tests"
)
##################################
# Define Various Test File Lists #
##################################
# Find all scad files
file(GLOB DEPRECATED_3D_FILES ${TEST_SCAD_DIR}/3D/deprecated/*.scad)
file(GLOB FEATURES_2D_FILES ${TEST_SCAD_DIR}/2D/features/*.scad)
file(GLOB FEATURES_3D_FILES ${TEST_SCAD_DIR}/3D/features/*.scad)
file(GLOB ISSUES_2D_FILES ${TEST_SCAD_DIR}/2D/issues/*.scad)
file(GLOB ISSUES_3D_FILES ${TEST_SCAD_DIR}/3D/issues/*.scad)
file(GLOB SCAD_DXF_FILES ${TEST_SCAD_DIR}/dxf/*.scad)
file(GLOB SCAD_PDF_FILES ${TEST_SCAD_DIR}/pdf/*.scad)
file(GLOB SCAD_SVG_FILES ${TEST_SCAD_DIR}/svg/svg-spec/*.scad
${TEST_SCAD_DIR}/svg/box-w-holes-2d.scad
${TEST_SCAD_DIR}/svg/display.scad
${TEST_SCAD_DIR}/svg/id-selection-test.scad
${TEST_SCAD_DIR}/svg/id-layer-selection-test.scad
${TEST_SCAD_DIR}/svg/line-cap-line-join.scad
${TEST_SCAD_DIR}/svg/simple-center-2d.scad
${TEST_SCAD_DIR}/svg/use-transform.scad
${TEST_SCAD_DIR}/svg/size-percent.scad)
file(GLOB SCAD_AMF_FILES ${TEST_SCAD_DIR}/amf/*.scad)
file(GLOB SCAD_NEF3_FILES ${TEST_SCAD_DIR}/nef3/*.scad)
file(GLOB FUNCTION_FILES ${TEST_SCAD_DIR}/functions/*.scad)
file(GLOB REDEFINITION_FILES ${TEST_SCAD_DIR}/redefinition/*.scad)
file(GLOB_RECURSE BUGS_FILES ${TEST_SCAD_DIR}/bugs/*.scad)
file(GLOB_RECURSE BUGS_2D_FILES ${TEST_SCAD_DIR}/bugs2D/*.scad)
file(GLOB_RECURSE EXAMPLE_3D_FILES ${EXAMPLES_DIR}/*.scad)
list(REMOVE_ITEM EXAMPLE_3D_FILES
${EXAMPLES_DIR}/Old/example015.scad
${EXAMPLES_DIR}/Advanced/module_recursion.scad
${EXAMPLES_DIR}/Functions/list_comprehensions.scad
${EXAMPLES_DIR}/Functions/polygon_areas.scad
${EXAMPLES_DIR}/Functions/recursion.scad
)
list(APPEND EXAMPLE_2D_FILES
${EXAMPLES_DIR}/Old/example015.scad
${EXAMPLES_DIR}/Advanced/module_recursion.scad
${EXAMPLES_DIR}/Functions/list_comprehensions.scad
${EXAMPLES_DIR}/Functions/polygon_areas.scad
${EXAMPLES_DIR}/Functions/recursion.scad
)
list(APPEND EXAMPLE_FILES ${EXAMPLE_3D_FILES} ${EXAMPLE_2D_FILES})
list(APPEND MISC_FILES
${TEST_SCAD_DIR}/misc/arg-permutations.scad
${TEST_SCAD_DIR}/misc/escape-test.scad
${TEST_SCAD_DIR}/misc/include-tests.scad
${TEST_SCAD_DIR}/misc/include-overwrite-main.scad
${TEST_SCAD_DIR}/misc/include-overwrite-main2.scad
${TEST_SCAD_DIR}/misc/use-tests.scad
${TEST_SCAD_DIR}/misc/assert-tests.scad
${TEST_SCAD_DIR}/misc/let-module-tests.scad
${TEST_SCAD_DIR}/misc/localfiles-test.scad
${TEST_SCAD_DIR}/misc/localfiles_dir/localfiles-compatibility-test.scad
${TEST_SCAD_DIR}/misc/allexpressions.scad
${TEST_SCAD_DIR}/misc/allfunctions.scad
${TEST_SCAD_DIR}/misc/allmodules.scad
${TEST_SCAD_DIR}/misc/special-consts.scad
${TEST_SCAD_DIR}/misc/variable-overwrite.scad
)
list(APPEND FAILING_FILES
${TEST_SCAD_DIR}/issues/issue1890-comment.scad
${TEST_SCAD_DIR}/issues/issue1890-include.scad
${TEST_SCAD_DIR}/issues/issue1890-string.scad
${TEST_SCAD_DIR}/issues/issue1890-use.scad
)
list(APPEND ECHO_FILES ${FUNCTION_FILES} ${MISC_FILES} ${REDEFINITION_FILES}
${TEST_SCAD_DIR}/3D/features/for-tests.scad
${TEST_SCAD_DIR}/3D/features/rotate-parameters.scad
${TEST_SCAD_DIR}/3D/features/linear_extrude-parameter-tests.scad
${TEST_SCAD_DIR}/misc/expression-evaluation-tests.scad
${TEST_SCAD_DIR}/misc/echo-tests.scad
${TEST_SCAD_DIR}/misc/assert-fail1-test.scad
${TEST_SCAD_DIR}/misc/assert-fail2-test.scad
${TEST_SCAD_DIR}/misc/assert-fail3-test.scad
${TEST_SCAD_DIR}/misc/assert-fail4-test.scad
${TEST_SCAD_DIR}/misc/assert-fail5-test.scad
${TEST_SCAD_DIR}/misc/for-c-style-infinite-loop.scad
${TEST_SCAD_DIR}/misc/parser-tests.scad
${TEST_SCAD_DIR}/misc/builtin-tests.scad
${TEST_SCAD_DIR}/misc/dim-all.scad
${TEST_SCAD_DIR}/misc/string-test.scad
${TEST_SCAD_DIR}/misc/string-indexing.scad
${TEST_SCAD_DIR}/misc/string-unicode.scad
${TEST_SCAD_DIR}/misc/chr-tests.scad
${TEST_SCAD_DIR}/misc/ord-tests.scad
${TEST_SCAD_DIR}/misc/vector-values.scad
${TEST_SCAD_DIR}/misc/search-tests.scad
${TEST_SCAD_DIR}/misc/search-tests-unicode.scad
${TEST_SCAD_DIR}/misc/recursion-test-function.scad
${TEST_SCAD_DIR}/misc/recursion-test-function2.scad
${TEST_SCAD_DIR}/misc/recursion-test-function3.scad
${TEST_SCAD_DIR}/misc/recursion-test-module.scad
${TEST_SCAD_DIR}/misc/tail-recursion-tests.scad
${TEST_SCAD_DIR}/misc/value-reassignment-tests.scad
${TEST_SCAD_DIR}/misc/value-reassignment-tests2.scad
${TEST_SCAD_DIR}/misc/variable-scope-tests.scad
${TEST_SCAD_DIR}/misc/scope-assignment-tests.scad
${TEST_SCAD_DIR}/misc/lookup-tests.scad
${TEST_SCAD_DIR}/misc/expression-shortcircuit-tests.scad
${TEST_SCAD_DIR}/misc/parent_module-tests.scad
${TEST_SCAD_DIR}/misc/children-tests.scad
${TEST_SCAD_DIR}/misc/range-tests.scad
${TEST_SCAD_DIR}/misc/no-break-space-test.scad
${TEST_SCAD_DIR}/misc/unicode-tests.scad
${TEST_SCAD_DIR}/misc/utf8-tests.scad
${TEST_SCAD_DIR}/misc/nbsp-utf8-test.scad
${TEST_SCAD_DIR}/misc/nbsp-latin1-test.scad
${TEST_SCAD_DIR}/misc/concat-tests.scad
${TEST_SCAD_DIR}/misc/include-recursive-test.scad
${TEST_SCAD_DIR}/misc/errors-warnings.scad
${TEST_SCAD_DIR}/misc/errors-warnings-included.scad
${TEST_SCAD_DIR}/misc/children-warnings-tests.scad
${TEST_SCAD_DIR}/misc/isundef-test.scad
${TEST_SCAD_DIR}/misc/islist-test.scad
${TEST_SCAD_DIR}/misc/isnum-test.scad
${TEST_SCAD_DIR}/misc/isbool-test.scad
${TEST_SCAD_DIR}/misc/isstring-test.scad
${TEST_SCAD_DIR}/misc/isobject-test.scad
${TEST_SCAD_DIR}/misc/operators-tests.scad
${TEST_SCAD_DIR}/misc/expression-precedence.scad
${TEST_SCAD_DIR}/misc/builtins-calling-vec3vec2.scad
${TEST_SCAD_DIR}/misc/leaf-module-warnings.scad
${TEST_SCAD_DIR}/issues/issue1472.scad
${TEST_SCAD_DIR}/misc/empty-stl.scad
${TEST_SCAD_DIR}/issues/issue1516.scad
${TEST_SCAD_DIR}/issues/issue1528.scad
${TEST_SCAD_DIR}/issues/issue1923.scad
${TEST_SCAD_DIR}/misc/preview_variable.scad
${TEST_SCAD_DIR}/issues/issue1851-each-fail-on-scalar.scad
${TEST_SCAD_DIR}/issues/issue2342.scad
${TEST_SCAD_DIR}/issues/issue3118-recur-limit.scad
${TEST_SCAD_DIR}/issues/issue3541.scad
${TEST_SCAD_DIR}/misc/function-scope.scad
${TEST_SCAD_DIR}/misc/root-modifiers.scad
${TEST_SCAD_DIR}/misc/root-modifier-for.scad
${TEST_DATA_DIR}/use-order-test/use-order-test.scad
${TEST_SCAD_DIR}/misc/text-metrics-test.scad
${TEST_SCAD_DIR}/json/import-json.scad
${TEST_SCAD_DIR}/json/import-json-relative-path.scad
${TEST_SCAD_DIR}/misc/vector-swizzling.scad
${TEST_SCAD_DIR}/misc/linenumber.scad
)
list(APPEND ASTDUMPTEST_FILES ${MISC_FILES}
${TEST_SCAD_DIR}/functions/assert-expression-fail1-test.scad
${TEST_SCAD_DIR}/functions/assert-expression-fail2-test.scad
${TEST_SCAD_DIR}/functions/assert-expression-fail3-test.scad
${TEST_SCAD_DIR}/functions/assert-expression-tests.scad
${TEST_SCAD_DIR}/functions/echo-expression-tests.scad
${TEST_SCAD_DIR}/functions/expression-precedence-tests.scad
${TEST_SCAD_DIR}/functions/let-test-single.scad
${TEST_SCAD_DIR}/functions/let-tests.scad
${TEST_SCAD_DIR}/functions/list-comprehensions.scad
${TEST_SCAD_DIR}/functions/exponent-operator-test.scad
${TEST_SCAD_DIR}/misc/ifelse-ast-dump.scad
${TEST_SCAD_DIR}/svg/id-layer-selection-test.scad
)
list(APPEND DUMPTEST_FILES ${FEATURES_2D_FILES} ${FEATURES_3D_FILES} ${DEPRECATED_3D_FILES} ${MISC_FILES})
list(APPEND CGALPNGTEST_2D_FILES ${FEATURES_2D_FILES} ${SCAD_DXF_FILES} ${ISSUES_2D_FILES} ${EXAMPLE_2D_FILES})
list(APPEND CGALPNGTEST_3D_FILES ${FEATURES_3D_FILES} ${SCAD_AMF_FILES} ${DEPRECATED_3D_FILES} ${ISSUES_3D_FILES} ${EXAMPLE_3D_FILES} ${SCAD_NEF3_FILES})
list(APPEND CGALPNGTEST_3D_FILES
${TEST_SCAD_DIR}/misc/include-tests.scad
${TEST_SCAD_DIR}/misc/use-tests.scad
${TEST_SCAD_DIR}/misc/assert-tests.scad
${TEST_SCAD_DIR}/misc/let-module-tests.scad
${TEST_SCAD_DIR}/misc/localfiles-test.scad
${TEST_SCAD_DIR}/misc/localfiles_dir/localfiles-compatibility-test.scad
${TEST_SCAD_DIR}/misc/rotate-empty-bbox.scad
${TEST_SCAD_DIR}/misc/empty-shape-tests.scad
${TEST_SCAD_DIR}/misc/null-polygons.scad
${TEST_SCAD_DIR}/misc/internal-cavity.scad
${TEST_SCAD_DIR}/misc/internal-cavity-polyhedron.scad
${TEST_SCAD_DIR}/misc/bad-stl-pcbvicebar.scad
${TEST_SCAD_DIR}/misc/bad-stl-tardis.scad
${TEST_SCAD_DIR}/misc/bad-stl-wing.scad
${TEST_SCAD_DIR}/misc/rotate_extrude-hole.scad
${TEST_SCAD_DIR}/misc/preview_variable.scad
)
# test importing unparseable files, result will be an empty image
list(APPEND STL_IMPORT_FILES
${TEST_SCAD_DIR}/stl/stl-import-invalidvertex.scad
${TEST_SCAD_DIR}/stl/stl-import-toomanyvertices.scad
${TEST_SCAD_DIR}/stl/stl-import-unparseable.scad
)
list(GET CGALPNGTEST_2D_FILES 0 1 2 CGALPNGSTDIOTEST_FILES)
list(APPEND CGALPNGTEST_FILES ${CGALPNGTEST_2D_FILES} ${CGALPNGTEST_3D_FILES})
set(PRUNE_TEST ${TEST_SCAD_DIR}/misc/intersection-prune-test.scad)
list(APPEND OPENCSGTEST_FILES ${STL_IMPORT_FILES} ${CGALPNGTEST_FILES} ${BUGS_FILES} ${BUGS_2D_FILES} ${PRUNE_TEST})
list(APPEND THROWNTOGETHERTEST_FILES ${CGALPNGTEST_FILES} ${PRUNE_TEST})
list(APPEND CGALSTLSANITYTEST_FILES ${TEST_SCAD_DIR}/misc/normal-nan.scad)
list(APPEND EXPORT_STL_TEST_FILES ${TEST_SCAD_DIR}/stl/stl-export.scad)
list(APPEND EXPORT_OBJ_TEST_FILES ${TEST_SCAD_DIR}/obj/obj-export.scad)
list(APPEND EXPORT_3MF_TEST_FILES ${TEST_SCAD_DIR}/3mf/3mf-export.scad)
list(APPEND EXPORT3D_CGALCGAL_TEST_FILES
${TEST_SCAD_DIR}/3D/features/polyhedron-nonplanar-tests.scad
${TEST_SCAD_DIR}/3D/features/rotate_extrude-tests.scad
${TEST_SCAD_DIR}/3D/features/union-coincident-test.scad
${TEST_SCAD_DIR}/3D/features/mirror-tests.scad
${TEST_SCAD_DIR}/misc/null-polygons.scad
${TEST_SCAD_DIR}/misc/internal-cavity.scad
${TEST_SCAD_DIR}/misc/internal-cavity-polyhedron.scad
${TEST_SCAD_DIR}/misc/bad-stl-pcbvicebar.scad
${TEST_SCAD_DIR}/misc/bad-stl-tardis.scad
${TEST_SCAD_DIR}/misc/rotate_extrude-hole.scad
${TEST_SCAD_DIR}/3D/issues/issue904.scad
${TEST_SCAD_DIR}/3D/issues/issue1105.scad
${TEST_SCAD_DIR}/3D/issues/issue1105d.scad
${TEST_SCAD_DIR}/3D/issues/issue1215.scad
${TEST_SCAD_DIR}/3D/issues/issue1215c.scad
${TEST_SCAD_DIR}/3D/issues/issue1221.scad
${TEST_SCAD_DIR}/3D/issues/issue1225.scad
${TEST_SCAD_DIR}/misc/preview_variable.scad
${TEST_SCAD_DIR}/3D/issues/fn_bug.scad
)
list(APPEND EXPORT3D_CGAL_TEST_FILES
${TEST_SCAD_DIR}/3D/features/polyhedron-tests.scad
${TEST_SCAD_DIR}/3D/issues/issue1105b.scad
${TEST_SCAD_DIR}/3D/issues/issue1105c.scad
${TEST_SCAD_DIR}/3D/issues/issue1215b.scad
${TEST_SCAD_DIR}/3D/issues/issue1258.scad
${TEST_SCAD_DIR}/3D/issues/issue2259.scad
)
list(APPEND EXPORT3D_TEST_FILES
${TEST_SCAD_DIR}/misc/nonmanifold-polyhedron.scad
${TEST_SCAD_DIR}/misc/bad-stl-wing.scad
)
# 2D tests
list(APPEND FILES_2D ${FEATURES_2D_FILES} ${ISSUES_2D_FILES} ${EXAMPLE_2D_FILES})
list(APPEND ALL_2D_FILES ${FILES_2D} ${SCAD_DXF_FILES} ${SCAD_SVG_FILES})
# We know that we cannot import weakly manifold files into CGAL, so to make tests easier
# to manage, don't try. Once we improve import, we can reenable this
# Known good manifold files -> EXPORT3D_CGALCGAL_TEST_FILES
# Known weak manifold files -> EXPORT3D_CGAL_TEST_FILES
# Known non-manifold files -> EXPORT3D_TEST_FILES
list(APPEND EXPORT3D_CGALCGAL_TEST_FILES ${BUGS_FILES})
#list(REMOVE_ITEM EXPORT3D_CGALCGAL_TEST_FILES
#)
#list(APPEND EXPORT3D_CGAL_TEST_FILES
#)
list(APPEND CGALPNGTEST_FILES ${BUGS_FILES} ${BUGS_2D_FILES})
# lazy-union
list(APPEND LAZYUNION_3D_FILES
${TEST_SCAD_DIR}/experimental/lazyunion-toplevel-objects.scad
${TEST_SCAD_DIR}/experimental/lazyunion-toplevel-for.scad
${TEST_SCAD_DIR}/experimental/lazyunion-nested-for.scad
${TEST_SCAD_DIR}/experimental/lazyunion-children.scad
${TEST_SCAD_DIR}/experimental/lazyunion-hull-for.scad
${TEST_SCAD_DIR}/experimental/lazyunion-root-for.scad
${TEST_SCAD_DIR}/experimental/lazyunion-intersection-for.scad
${TEST_SCAD_DIR}/experimental/lazyunion-difference-for.scad
${TEST_SCAD_DIR}/experimental/lazyunion-minkowski-for.scad
${TEST_SCAD_DIR}/experimental/lazyunion-transform-for.scad
${TEST_SCAD_DIR}/3D/features/2d-3d.scad
)
list(APPEND LAZYUNION_2D_FILES
${TEST_SCAD_DIR}/experimental/lazyunion-toplevel-2dobjects.scad
)
list(APPEND LAZYUNION_FILES ${LAZYUNION_2D_FILES} ${LAZYUNION_3D_FILES})
list(APPEND FASTCSG_LAZYUNION_FILES ${LAZYUNION_3D_FILES}
${TEST_SCAD_DIR}/experimental/fastcsg-lazyunion-issue4109-1.scad
${TEST_SCAD_DIR}/experimental/fastcsg-lazyunion-issue4109-2.scad
${TEST_SCAD_DIR}/experimental/fastcsg-lazyunion-issue4109-3.scad
${TEST_SCAD_DIR}/experimental/fastcsg-lazyunion-issue4109-4.scad
)
list(APPEND SVG_VIEWBOX_TESTS
viewbox_300x400_none viewbox_600x200_none
viewbox_300x400_meet_xMinYMin viewbox_300x400_meet_xMidYMin viewbox_300x400_meet_xMaxYMin
viewbox_600x200_meet_xMinYMin viewbox_600x200_meet_xMinYMid viewbox_600x200_meet_xMinYMax
viewbox_600x200_slice_xMinYMin viewbox_600x200_slice_xMidYMin viewbox_600x200_slice_xMaxYMin
viewbox_600x600_slice_xMinYMin viewbox_600x600_slice_xMinYMid viewbox_600x600_slice_xMinYMax
)
# Specific tests for which fast-csg cannot be enabled yet.
list(APPEND TESTS_FAILING_WITH_FAST_CSG
# Different order of vertices
3mfexport_3mf-export
# Test script argument passing issue
cgalstlsanitytest_normal-nan
)
# Tests for which fast-csg works but produces different expectation files.
# These tests are run twice (w/ and without fast-csg).
list(APPEND SCADFILES_FAILING_WITH_FAST_CSG
# Corefinement leaves some polyhedra in a state that we can't build Nefs from
${TEST_SCAD_DIR}/3D/features/mirror-tests.scad
# Resize issue!
${TEST_SCAD_DIR}/3D/features/resize-convexity-tests.scad
# Needs investigation:
${TEST_SCAD_DIR}/3D/issues/issue1246.scad
)
list(APPEND FAST_CSG_TRUST_FAILING_SCADFILES
${TEST_SCAD_DIR}/3D/features/edge-cases.scad
)
# Tests for which fast-csg works but produces different expectation files.
# These tests are run twice (w/ and without fast-csg).
list(APPEND SCADFILES_WITH_DIFFERENT_FAST_CSG_EXPECTATIONS
# This one no longer crashes, yay!
${TEST_SCAD_DIR}/bugs/issue1455.scad
# These are less broken than before:
${TEST_SCAD_DIR}/bugs/issue791.scad
${TEST_SCAD_DIR}/3D/issues/issue1138.scad
${TEST_SCAD_DIR}/3D/issues/issue1137.scad
# No more green faces from differences.
${EXAMPLES_DIR}/Basics/CSG-modules.scad
${EXAMPLES_DIR}/Basics/CSG.scad
${EXAMPLES_DIR}/Basics/logo.scad
${EXAMPLES_DIR}/Old/example001.scad
${EXAMPLES_DIR}/Old/example002.scad
${EXAMPLES_DIR}/Old/example003.scad
${EXAMPLES_DIR}/Old/example004.scad
${EXAMPLES_DIR}/Old/example005.scad
${EXAMPLES_DIR}/Old/example006.scad
${EXAMPLES_DIR}/Old/example012.scad
${EXAMPLES_DIR}/Old/example016.scad
${EXAMPLES_DIR}/Old/example024.scad
${TEST_SCAD_DIR}/2D/features/highlight-modifier-2d.scad
${TEST_SCAD_DIR}/3D/features/difference-tests.scad
${TEST_SCAD_DIR}/3D/features/highlight-modifier.scad
${TEST_SCAD_DIR}/3D/features/highlight-modifier2.scad
${TEST_SCAD_DIR}/3D/features/minkowski3-erosion.scad
${TEST_SCAD_DIR}/3D/features/render-tests.scad
${TEST_SCAD_DIR}/3D/issues/issue1105.scad
${TEST_SCAD_DIR}/3D/issues/issue1105b.scad
${TEST_SCAD_DIR}/3D/issues/issue1105c.scad
${TEST_SCAD_DIR}/3D/issues/issue1105d.scad
${TEST_SCAD_DIR}/3D/issues/issue1215c.scad
${TEST_SCAD_DIR}/3D/issues/issue1803.scad
${TEST_SCAD_DIR}/3D/issues/issue3158.scad
${TEST_SCAD_DIR}/3D/issues/issue835.scad
${TEST_SCAD_DIR}/3D/issues/issue911.scad
${TEST_SCAD_DIR}/3D/issues/issue913.scad
${TEST_SCAD_DIR}/3D/misc/view-options-tests.scad
${TEST_SCAD_DIR}/misc/internal-cavity-polyhedron.scad
${TEST_SCAD_DIR}/misc/internal-cavity.scad
${TEST_SCAD_DIR}/misc/let-module-tests.scad
${TEST_SCAD_DIR}/misc/rotate_extrude-hole.scad
${TEST_SCAD_DIR}/misc/rotate-empty-bbox.scad
# Less broken and no green faces
${TEST_SCAD_DIR}/3D/features/polyhedron-tests.scad
)
###################################
# Add experimental features tests #
###################################
experimental_tests(dumptest-examples_roof)
experimental_tests(cgalpngtest_roof)
experimental_tests(csgpngtest_roof)
experimental_tests(opencsgtest_roof)
experimental_tests(throwntogethertest_roof)
experimental_tests(echotest_allexpressions)
experimental_tests(astdumptest_allexpressions)
experimental_tests(echotest_function-literal-tests)
experimental_tests(echotest_function-literal-compare)
experimental_tests(echotest_isobject-test)
experimental_tests(echotest_text-metrics-test)
experimental_tests(dumptest_text-metrics)
experimental_tests(cgalpngtest_text-metrics)
experimental_tests(opencsgtest_text-metrics)
experimental_tests(csgpngtest_text-metrics)
experimental_tests(throwntogethertest_text-metrics)
experimental_tests(dxfpngtest_text-metrics)
experimental_tests(svgpngtest_text-metrics)
experimental_tests(echotest_import-json)
experimental_tests(echotest_import-json-relative-path)
experimental_tests(lazyunion-dump_lazyunion-toplevel-2dobjects)
experimental_tests(lazyunion-dump_lazyunion-toplevel-objects)
experimental_tests(lazyunion-dump_lazyunion-toplevel-for)
experimental_tests(lazyunion-dump_lazyunion-nested-for)
experimental_tests(lazyunion-dump_lazyunion-children)
experimental_tests(lazyunion-dump_lazyunion-hull-for)
experimental_tests(lazyunion-dump_lazyunion-root-for)
experimental_tests(lazyunion-dump_lazyunion-intersection-for)
experimental_tests(lazyunion-dump_lazyunion-difference-for)
experimental_tests(lazyunion-dump_lazyunion-minkowski-for)
experimental_tests(lazyunion-dump_lazyunion-transform-for)
experimental_tests(lazyunion-dump_2d-3d)
experimental_tests(lazyunion-opencsg_lazyunion-toplevel-2dobjects)
experimental_tests(lazyunion-opencsg_lazyunion-toplevel-objects)
experimental_tests(lazyunion-opencsg_lazyunion-toplevel-for)
experimental_tests(lazyunion-opencsg_lazyunion-nested-for)
experimental_tests(lazyunion-opencsg_lazyunion-children)
experimental_tests(lazyunion-opencsg_lazyunion-hull-for)
experimental_tests(lazyunion-opencsg_lazyunion-root-for)
experimental_tests(lazyunion-opencsg_lazyunion-intersection-for)
experimental_tests(lazyunion-opencsg_lazyunion-difference-for)
experimental_tests(lazyunion-opencsg_lazyunion-minkowski-for)
experimental_tests(lazyunion-opencsg_lazyunion-transform-for)
experimental_tests(lazyunion-opencsg_2d-3d)
experimental_tests(lazyunion-cgalpng_lazyunion-toplevel-2dobjects)
experimental_tests(lazyunion-cgalpng_lazyunion-toplevel-objects)
experimental_tests(lazyunion-cgalpng_lazyunion-toplevel-for)
experimental_tests(lazyunion-cgalpng_lazyunion-nested-for)
experimental_tests(lazyunion-cgalpng_lazyunion-children)
experimental_tests(lazyunion-cgalpng_lazyunion-hull-for)
experimental_tests(lazyunion-cgalpng_lazyunion-root-for)
experimental_tests(lazyunion-cgalpng_lazyunion-intersection-for)
experimental_tests(lazyunion-cgalpng_lazyunion-difference-for)
experimental_tests(lazyunion-cgalpng_lazyunion-minkowski-for)
experimental_tests(lazyunion-cgalpng_lazyunion-transform-for)
experimental_tests(lazyunion-cgalpng_2d-3d)
experimental_tests(lazyunion-monotonepng_lazyunion-toplevel-objects)
experimental_tests(lazyunion-monotonepng_lazyunion-toplevel-for)
experimental_tests(lazyunion-monotonepng_lazyunion-nested-for)
experimental_tests(lazyunion-monotonepng_lazyunion-children)
experimental_tests(lazyunion-monotonepng_lazyunion-hull-for)
experimental_tests(lazyunion-monotonepng_lazyunion-root-for)
experimental_tests(lazyunion-monotonepng_lazyunion-intersection-for)
experimental_tests(lazyunion-monotonepng_lazyunion-difference-for)
experimental_tests(lazyunion-monotonepng_lazyunion-minkowski-for)
experimental_tests(lazyunion-monotonepng_lazyunion-transform-for)
experimental_tests(lazyunion-monotonepng_2d-3d)
experimental_tests(lazyunion-stlpngtest_lazyunion-toplevel-objects)
experimental_tests(lazyunion-stlpngtest_lazyunion-toplevel-for)
experimental_tests(lazyunion-stlpngtest_lazyunion-nested-for)
experimental_tests(lazyunion-stlpngtest_lazyunion-children)
experimental_tests(lazyunion-stlpngtest_lazyunion-hull-for)
experimental_tests(lazyunion-stlpngtest_lazyunion-root-for)
experimental_tests(lazyunion-stlpngtest_lazyunion-intersection-for)
experimental_tests(lazyunion-stlpngtest_lazyunion-difference-for)
experimental_tests(lazyunion-stlpngtest_lazyunion-minkowski-for)
experimental_tests(lazyunion-stlpngtest_lazyunion-transform-for)
experimental_tests(lazyunion-stlpngtest_2d-3d)
experimental_tests(lazyunion-offpngtest_lazyunion-toplevel-objects)
experimental_tests(lazyunion-offpngtest_lazyunion-toplevel-for)
experimental_tests(lazyunion-offpngtest_lazyunion-nested-for)
experimental_tests(lazyunion-offpngtest_lazyunion-children)
experimental_tests(lazyunion-offpngtest_lazyunion-hull-for)
experimental_tests(lazyunion-offpngtest_lazyunion-root-for)
experimental_tests(lazyunion-offpngtest_lazyunion-intersection-for)
experimental_tests(lazyunion-offpngtest_lazyunion-difference-for)
experimental_tests(lazyunion-offpngtest_lazyunion-minkowski-for)
experimental_tests(lazyunion-offpngtest_lazyunion-transform-for)
experimental_tests(lazyunion-offpngtest_2d-3d)
experimental_tests(lazyunion-dxfpngtest_lazyunion-toplevel-2dobjects)
experimental_tests(lazyunion-svgpngtest_lazyunion-toplevel-2dobjects)
##############################
# Define test configurations #
##############################
# Must be done BEFORE adding any tests
# Clear test config cache variables
foreach(CONFIG $CACHE{TEST_CONFIGS})
unset(${CONFIG}_TEST_CONFIG CACHE)
endforeach()
# Heavy tests are tests taking more than 10 seconds on a development computer
set_test_config(Heavy FILES
cgalbinstlcgalpngtest_rotate_extrude-tests
cgalpngtest_camera-tests
cgalpngtest_for-nested-tests
cgalpngtest_fractal
cgalpngtest_issue267-normalization-crash
cgalpngtest_iteration
cgalpngtest_linear_extrude-scale-zero-tests
cgalpngtest_minkowski3-erosion
cgalpngtest_projection-extrude-tests
cgalpngtest_resize-tests
cgalpngtest_rotate_extrude-angle
cgalpngtest_rotate_extrude-tests
cgalpngtest_sphere-tests
cgalpngtest_surface-tests
cgalstlcgalpngtest_rotate_extrude-tests
csgpngtest_camera-tests
csgpngtest_for-nested-tests
csgpngtest_fractal
csgpngtest_issue267-normalization-crash