forked from ukaea/parallel-preprocessor
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_all_tests.sh
More file actions
75 lines (64 loc) · 2.65 KB
/
run_all_tests.sh
File metadata and controls
75 lines (64 loc) · 2.65 KB
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
#!/bin/bash
#inside the build folder, assuming out of source building
if [ -d wiki ]; then
echo "this script only work for out of source building like this`
echo `mkdir build && cd build && cmake ..``"
exit -1
fi
echo "start test in the folder $(pwd)"
# using symbolic link created manually, instead of copy for POSIX
# this may have been done in cmake
if [ ! -d data ]; then
ln -s ../data data
#cp -r ../data data # this will not fail even data folder exists
fi
# # this may have been done in cmake, but fine to redo it
if [ -d ppptest ]; then rm -rf ppptest; fi
mkdir ppptest && cd ppptest
echo "start unit test in the folder:$(pwd)"
../bin/pppBaseTests
../bin/pppParallelTests
../bin/pppAppTests
../bin/pppGeomTests
echo "start python tests in the folder:$(pwd)"
# this for loop is support by bash only, not sh
#for ((i=1;i<=10;i++)) ; do echo "sample_file$i.txt"; done > sampleManifest.txt
# this works for sh
for i in `seq 1 10` ; do echo "sample_file$i.txt"; done > sampleManifest.txt
# PPP::CommandLineProcessor is not merged
#pppPipelineController.py sampleManifest.txt
geomPipeline.py search ../data/test_geometry/test_geometry.stp --verbosity WARNING
if [ ! $? -eq 0 ]
then
echo "Error during geometry search action"
exit 1
fi
geomPipeline.py detect ../data/test_geometry/test_geometry.stp --verbosity WARNING
# run `geomPipeline.py` to generate a config.json file for test_*.py below
geomPipeline.py ../data/test_geometry/test_geometry.stp -o test_geometry_result.brep
# test manifest.json input file type
geomPipeline.py check ../data/test_geometry/test_geometry_manifest.json --verbosity WARNING
if [ ! $? -eq 0 ] ; then echo "Error during geometry test" ; exit 1 ; fi
# test scaling, output to a diff output folder
geomPipeline.py imprint ../data/test_geometry/test_geometry.stp -o /tmp/test_geometry_scaled.brep --output-unit M
geomPipeline.py imprint ../data/test_geometry/test_geometry.stp --working-dir /tmp/ -o test_geometry_scaled.stp --output-unit M
if [ ! $? -eq 0 ] ; then echo "Error during geometry output unit (scaling) test " ; exit 1 ; fi
# test single thread mode, only for non-coupled operations
geomPipeline.py check ../data/test_geometry/test_geometry.stp --thread-count 1 --verbosity WARNING
if [ ! $? -eq 0 ] ; then echo "Error during geometry test in single thread mode" ; exit 1 ; fi
# test_*.py has not been installed by package, so must be copied into this place
cp ../../src/python/*.py ./
if [ $? -eq 0 ]
then
echo "Successfully run geometry pipeline"
test_imprint.py
#test_collision.py
#test_fixing.py
if [ $? -eq 0 ]; then
test_collision.py
fi
echo "test completed"
else
echo "geometry pipeline test failed"
exit 2
fi