0
|
1 #!/bin/sh
|
|
2
|
|
3 ENABLE=$1
|
|
4
|
|
5 echo ""
|
|
6 echo " DataTables unit tests"
|
|
7 echo ""
|
|
8
|
|
9 if [ ! "$ENABLE" = "Enable" -a ! "$ENABLE" = "Disable" -o "ENABLE" = "-h" ]; then
|
|
10 echo " Enable or Disable must be given as the first argument."
|
|
11 echo " Optionally the second argument can be given as an integer to enable/disable a certain "
|
|
12 echo " set of tests or the string 'sanity' to run the sanity check for all data types."
|
|
13 echo ""
|
|
14 exit 1
|
|
15 fi
|
|
16
|
|
17 cd ../media/unit_testing
|
|
18
|
|
19 if [ "$ENABLE" = "Enable" ]; then
|
|
20 if [ ! -d tests ]; then
|
|
21 echo " Building test directory"
|
|
22 mkdir tests
|
|
23 mkdir tests/1_dom
|
|
24 mkdir tests/2_js
|
|
25 mkdir tests/3_ajax
|
|
26 mkdir tests/4_server-side
|
|
27 mkdir tests/5_ajax_objects
|
|
28 mkdir tests/6_delayed_rendering
|
|
29 fi
|
|
30
|
|
31 echo " Enabling:"
|
|
32 if [ ! -z $2 ]; then
|
|
33 if [ "$2" = "sanity" ]; then
|
|
34 echo " Sanity checks"
|
|
35 mv tests_onhold/1_dom/_zero_config.js tests/1_dom/
|
|
36 mv tests_onhold/2_js/_zero_config.js tests/2_js/
|
|
37 mv tests_onhold/3_ajax/_zero_config.js tests/3_ajax/
|
|
38 mv tests_onhold/4_server-side/_zero_config.js tests/4_server-side/
|
|
39 mv tests_onhold/5_ajax_objects/_zero_config.js tests/5_ajax_objects/
|
|
40 mv tests_onhold/6_delayed_rendering/_zero_config.js tests/6_delayed_rendering/
|
|
41 elif [ $2 -eq 1 ]; then
|
|
42 echo " DOM"
|
|
43 mv tests_onhold/1_dom/* tests/1_dom/
|
|
44 elif [ $2 -eq 2 ]; then
|
|
45 echo " JS"
|
|
46 mv tests_onhold/2_js/* tests/2_js/
|
|
47 elif [ $2 -eq 3 ]; then
|
|
48 echo " Ajax"
|
|
49 mv tests_onhold/3_ajax/* tests/3_ajax/
|
|
50 elif [ $2 -eq 4 ]; then
|
|
51 echo " SErver-side"
|
|
52 mv tests_onhold/4_server-side/* tests/4_server-side/
|
|
53 elif [ $2 -eq 5 ]; then
|
|
54 echo " Ajax objects"
|
|
55 mv tests_onhold/5_ajax_objects/* tests/5_ajax_objects/
|
|
56 elif [ $2 -eq 6 ]; then
|
|
57 echo " Delayed rendering"
|
|
58 mv tests_onhold/6_delayed_rendering/* tests/6_delayed_rendering/
|
|
59 fi
|
|
60 else
|
|
61 echo " All tests"
|
|
62 mv tests_onhold/1_dom/* tests/1_dom/
|
|
63 mv tests_onhold/2_js/* tests/2_js/
|
|
64 mv tests_onhold/3_ajax/* tests/3_ajax/
|
|
65 mv tests_onhold/4_server-side/* tests/4_server-side/
|
|
66 mv tests_onhold/5_ajax_objects/* tests/5_ajax_objects/
|
|
67 mv tests_onhold/6_delayed_rendering/* tests/6_delayed_rendering/
|
|
68 fi
|
|
69
|
|
70 else
|
|
71 echo " Disabling:"
|
|
72 if [ ! -z $2 ]; then
|
|
73 if [ "$2" = "sanity" ]; then
|
|
74 echo " Sanity checks"
|
|
75 mv tests/1_dom/* tests_onhold/1_dom/
|
|
76 mv tests/2_js/* tests_onhold/2_js/
|
|
77 mv tests/3_ajax/* tests_onhold/3_ajax/
|
|
78 mv tests/4_server-side/* tests_onhold/4_server-side/
|
|
79 mv tests/5_ajax_objects/* tests_onhold/5_ajax_objects/
|
|
80 mv tests/6_delayed_rendering/* tests_onhold/6_delayed_rendering/
|
|
81 elif [ $2 -eq 1 ]; then
|
|
82 echo " DOM"
|
|
83 mv tests/1_dom/* tests_onhold/1_dom/
|
|
84 elif [ $2 -eq 2 ]; then
|
|
85 echo " JS"
|
|
86 mv tests/2_js/* tests_onhold/2_js/
|
|
87 elif [ $2 -eq 3 ]; then
|
|
88 echo " Ajax"
|
|
89 mv tests/3_ajax/* tests_onhold/3_ajax/
|
|
90 elif [ $2 -eq 4 ]; then
|
|
91 echo " Server-side"
|
|
92 mv tests/4_server-side/* tests_onhold/4_server-side/
|
|
93 elif [ $2 -eq 5 ]; then
|
|
94 echo " Ajax objects"
|
|
95 mv tests/5_ajax_objects/* tests_onhold/5_ajax_objects/
|
|
96 elif [ $2 -eq 6 ]; then
|
|
97 echo " Delayed rendering"
|
|
98 mv tests/6_delayed_rendering/* tests_onhold/6_delayed_rendering/
|
|
99 fi
|
|
100 else
|
|
101 echo " All tests"
|
|
102 mv tests/1_dom/* tests_onhold/1_dom/
|
|
103 mv tests/2_js/* tests_onhold/2_js/
|
|
104 mv tests/3_ajax/* tests_onhold/3_ajax/
|
|
105 mv tests/4_server-side/* tests_onhold/4_server-side/
|
|
106 mv tests/5_ajax_objects/* tests_onhold/5_ajax_objects/
|
|
107 mv tests/6_delayed_rendering/* tests_onhold/6_delayed_rendering/
|
|
108 fi
|
|
109 fi
|