Mxx_ru 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +26 -26
- data/NEWS +107 -107
- data/README +21 -21
- data/Rakefile +56 -56
- data/examples/exe_and_lib/prj.rb +11 -11
- data/examples/exe_and_lib/say.rb +7 -7
- data/examples/exe_dll_lib/inout.rb +18 -18
- data/examples/exe_dll_lib/prj.rb +11 -11
- data/examples/exe_dll_lib/say.rb +9 -9
- data/examples/exe_dll_lib_2/build.rb +10 -10
- data/examples/exe_dll_lib_2/inout/prj.rb +16 -16
- data/examples/exe_dll_lib_2/main/prj.rb +9 -9
- data/examples/exe_dll_lib_2/say/prj.rb +8 -8
- data/examples/simple_exe/prj.rb +7 -7
- data/lib/mxx_ru/abstract_target.rb +335 -335
- data/lib/mxx_ru/binary_library.rb +106 -106
- data/lib/mxx_ru/binary_target.rb +173 -173
- data/lib/mxx_ru/binary_unittest.rb +143 -143
- data/lib/mxx_ru/compat.rb +33 -33
- data/lib/mxx_ru/cpp.rb +38 -38
- data/lib/mxx_ru/cpp/analyzer.rb +237 -237
- data/lib/mxx_ru/cpp/composite.rb +118 -118
- data/lib/mxx_ru/cpp/detect_toolset.rb +122 -122
- data/lib/mxx_ru/cpp/mode.rb +90 -90
- data/lib/mxx_ru/cpp/obj_placement.rb +330 -330
- data/lib/mxx_ru/cpp/obj_placements/custom_subdir.rb +155 -155
- data/lib/mxx_ru/cpp/qt.rb +366 -366
- data/lib/mxx_ru/cpp/rucodegen.rb +157 -157
- data/lib/mxx_ru/cpp/source_file.rb +79 -79
- data/lib/mxx_ru/cpp/target.rb +1523 -1523
- data/lib/mxx_ru/cpp/toolset.rb +1087 -1087
- data/lib/mxx_ru/cpp/toolsets/bcc_win32_5.rb +53 -53
- data/lib/mxx_ru/cpp/toolsets/bcc_win32_family.rb +460 -460
- data/lib/mxx_ru/cpp/toolsets/c89_etk_nsk.rb +59 -59
- data/lib/mxx_ru/cpp/toolsets/c89_nsk.rb +59 -59
- data/lib/mxx_ru/cpp/toolsets/c89_nsk_family.rb +277 -277
- data/lib/mxx_ru/cpp/toolsets/gcc_cygwin.rb +58 -58
- data/lib/mxx_ru/cpp/toolsets/gcc_family.rb +420 -420
- data/lib/mxx_ru/cpp/toolsets/gcc_linux.rb +64 -64
- data/lib/mxx_ru/cpp/toolsets/gcc_mingw.rb +149 -150
- data/lib/mxx_ru/cpp/toolsets/gcc_sparc_solaris.rb +91 -91
- data/lib/mxx_ru/cpp/toolsets/gcc_unix_family.rb +103 -103
- data/lib/mxx_ru/cpp/toolsets/vc7.rb +62 -62
- data/lib/mxx_ru/cpp/toolsets/vc8.rb +455 -455
- data/lib/mxx_ru/cpp/toolsets/vc_family.rb +448 -448
- data/lib/mxx_ru/ex.rb +165 -165
- data/lib/mxx_ru/makestyle_generator.rb +146 -146
- data/lib/mxx_ru/textfile_unittest.rb +303 -303
- data/lib/mxx_ru/util.rb +340 -340
- data/tests/c/pcre/chartables.c +183 -183
- data/tests/c/pcre/config.h +99 -99
- data/tests/c/pcre/dftables.c +167 -167
- data/tests/c/pcre/get.c +349 -349
- data/tests/c/pcre/internal.h +677 -677
- data/tests/c/pcre/maketables.c +140 -140
- data/tests/c/pcre/pcre.c +8304 -8304
- data/tests/c/pcre/pcre.h +193 -193
- data/tests/c/pcre/pcre.rb +14 -14
- data/tests/c/pcre/pcredemo.c +316 -316
- data/tests/c/pcre/pcregrep.c +642 -642
- data/tests/c/pcre/pcreposix.c +305 -305
- data/tests/c/pcre/pcreposix.h +88 -88
- data/tests/c/pcre/pcretest.c +1483 -1483
- data/tests/c/pcre/perltest +211 -211
- data/tests/c/pcre/printint.c +360 -360
- data/tests/c/pcre/study.c +472 -472
- data/tests/cpp/cpp_sources_glob/build.rb +7 -7
- data/tests/cpp/cpp_sources_glob/some/module/prj.rb +10 -10
- data/tests/cpp/cpp_sources_glob/tc_cpp_sources_glob.rb +18 -18
- data/tests/cpp/mswin_res_dll/build.rb +14 -14
- data/tests/cpp/mswin_res_dll/dll.cpp +17 -17
- data/tests/cpp/mswin_res_dll/dll.rb +29 -29
- data/tests/cpp/mswin_res_dll/dll.rc +48 -48
- data/tests/cpp/mswin_res_dll/h/dll.hpp +8 -8
- data/tests/cpp/mswin_res_dll/h/res.h +3 -3
- data/tests/cpp/mswin_res_dll/main.cpp +13 -13
- data/tests/cpp/mswin_res_dll/main.rb +19 -19
- data/tests/cpp/mswin_res_dll/o/dll.o +0 -0
- data/tests/cpp/mswin_res_dll/tc_mswin_res_dll.rb +18 -18
- data/tests/cpp/mswin_res_exe/build.rb +23 -23
- data/tests/cpp/mswin_res_exe/h/res.h +3 -3
- data/tests/cpp/mswin_res_exe/main.cpp +17 -17
- data/tests/cpp/mswin_res_exe/main.rc +48 -48
- data/tests/cpp/mswin_res_exe/o/main.o +0 -0
- data/tests/cpp/mswin_res_exe/tc_mswin_res_exe.rb +18 -18
- data/tests/cpp/rucodegen.embedded/host_config.cpp +32 -32
- data/tests/cpp/rucodegen.embedded/impl/conn_params.cpp +7 -7
- data/tests/cpp/rucodegen.embedded/impl/conn_params.rb +14 -14
- data/tests/cpp/rucodegen.embedded/impl/h/conn_params.hpp +10 -10
- data/tests/cpp/rucodegen.embedded/prj.rb +16 -16
- data/tests/cpp/rucodegen.embedded/tc_rucodegen.rb +18 -18
- data/tests/cpp/rucodegen/host_config.cpp +20 -20
- data/tests/cpp/rucodegen/host_config.rb +14 -14
- data/tests/cpp/rucodegen/impl/conn_params.cpp +7 -7
- data/tests/cpp/rucodegen/impl/conn_params.rb +14 -14
- data/tests/cpp/rucodegen/impl/h/conn_params.hpp +10 -10
- data/tests/cpp/rucodegen/prj.rb +16 -16
- data/tests/cpp/rucodegen/tc_rucodegen.rb +18 -18
- data/tests/cpp/textfile_unittest/build.rb +8 -8
- data/tests/cpp/textfile_unittest/etalons/out_1.txt +1 -1
- data/tests/cpp/textfile_unittest/etalons/out_128.txt +128 -128
- data/tests/cpp/textfile_unittest/main.cpp +89 -89
- data/tests/cpp/textfile_unittest/prj.rb +8 -8
- data/tests/cpp/textfile_unittest/prj.ut.rb +18 -18
- data/tests/cpp/textfile_unittest/tc_textfile_unittest.rb +18 -18
- data/tests/cpp/toolset_name.rb +6 -6
- data/tests/cpp/vc_cleanup/prj_dll_no_implib.rb +10 -10
- data/tests/cpp/vc_cleanup/prj_dll_no_implib_simple_target_root.rb +11 -11
- data/tests/cpp/vc_cleanup/prj_dll_with_implib.rb +11 -11
- data/tests/cpp/vc_cleanup/prj_dll_with_implib_simple_target_root.rb +14 -14
- data/tests/cpp/vc_cleanup/prj_exe_no_implib.rb +10 -10
- data/tests/cpp/vc_cleanup/prj_exe_no_implib_simple_target_root.rb +11 -11
- data/tests/cpp/vc_cleanup/prj_lib.rb +10 -10
- data/tests/cpp/vc_cleanup/prj_lib_with_simple_target_root.rb +11 -11
- data/tests/cpp/vc_cleanup/tc_vc_cleanup.rb +23 -23
- data/tests/mxx_ru/binary_library/tc_binary_library.rb +57 -57
- data/tests/mxx_ru/binary_library/tc_binary_target_lib_methods.rb +114 -114
- data/tests/mxx_ru/change_default_value/ignoring_by_build_root/build.rb +8 -8
- data/tests/mxx_ru/change_default_value/ignoring_by_build_root/child_1.rb +5 -5
- data/tests/mxx_ru/change_default_value/ignoring_by_child_1/build.rb +7 -7
- data/tests/mxx_ru/change_default_value/ignoring_by_child_1/child_1.rb +5 -5
- data/tests/mxx_ru/change_default_value/ignoring_by_child_1/child_2.rb +5 -5
- data/tests/mxx_ru/change_default_value/ok/build.rb +8 -8
- data/tests/mxx_ru/change_default_value/ok/child_1.rb +8 -8
- data/tests/mxx_ru/lib_path/build.rb +8 -8
- data/tests/mxx_ru/lib_path/bye.rb +8 -8
- data/tests/mxx_ru/lib_path/hi.rb +8 -8
- data/tests/mxx_ru/lib_path/main.rb +12 -12
- data/tests/mxx_ru/lib_path/tc_lib_path.rb +18 -18
- data/tests/mxx_ru/obj_placements/tc_custom_subdir.rb +58 -58
- data/tests/mxx_ru/opt_lib_ext/build.rb +7 -7
- data/tests/mxx_ru/opt_lib_ext/hi.rb +7 -7
- data/tests/mxx_ru/opt_lib_ext/tc_opt_lib_ext.rb +18 -18
- data/tests/mxx_ru/opt_lib_ext/test-no-ext.rb +9 -9
- data/tests/mxx_ru/opt_lib_ext/test-with-ext.rb +13 -13
- data/tests/mxx_ru/plural_form_methods/tc.rb +72 -72
- data/tests/mxx_ru/qt_gen/tc_uic_result_subdir.rb +76 -76
- data/tests/mxx_ru/target_ext/prj_dll.rb +8 -8
- data/tests/mxx_ru/target_ext/prj_exe.rb +8 -8
- data/tests/mxx_ru/target_ext/prj_lib.rb +8 -8
- data/tests/mxx_ru/target_ext/tc_target_ext.rb +24 -24
- data/tests/mxx_ru/tc_makestyle_generator.rb +117 -117
- data/tests/mxx_ru/vc8/tc_actual_manifest.rb +230 -230
- data/tests/mxx_ru/vc8/tc_append_mt_commands.rb +104 -104
- data/tests/mxx_ru/vc8/tc_default_manifest.rb +17 -17
- data/tests/mxx_ru/vc8/tc_define_manifest.rb +173 -173
- data/tests/mxx_ru/vc8/tc_drop_default_manifest.rb +16 -16
- data/tests/mxx_ru/vc8/tc_invalid_params.rb +81 -81
- data/tests/mxx_ru/vc8/ts_vc8.rb +10 -10
- data/tests/qt/aclock/aclock.cpp +148 -148
- data/tests/qt/aclock/aclock.h +45 -45
- data/tests/qt/aclock/main.cpp +28 -28
- data/tests/qt/aclock/prj.rb +21 -21
- data/tests/qt/iconview/main.cpp +76 -76
- data/tests/qt/iconview/prj.rb +21 -21
- data/tests/qt/toplevel/main.cpp +9 -9
- data/tests/qt/toplevel/options.ui +587 -587
- data/tests/qt/toplevel/prj.rb +22 -22
- data/tests/test_with_compilation.rb +110 -110
- data/tests/unix/lib_linking_mode/a_shared.rb +7 -7
- data/tests/unix/lib_linking_mode/a_static.rb +7 -7
- data/tests/unix/lib_linking_mode/etalon/shared.txt +2 -2
- data/tests/unix/lib_linking_mode/etalon/static.txt +2 -2
- data/tests/unix/lib_linking_mode/main_conflict.rb +12 -12
- data/tests/unix/lib_linking_mode/main_conflict_2.rb +11 -11
- data/tests/unix/lib_linking_mode/main_shared.rb +9 -9
- data/tests/unix/lib_linking_mode/main_shared.ut.rb +11 -11
- data/tests/unix/lib_linking_mode/main_shared_2.rb +10 -10
- data/tests/unix/lib_linking_mode/main_shared_2.ut.rb +11 -11
- data/tests/unix/lib_linking_mode/main_static.rb +9 -9
- data/tests/unix/lib_linking_mode/main_static.ut.rb +11 -11
- data/tests/unix/lib_linking_mode/main_static_2.rb +10 -10
- data/tests/unix/lib_linking_mode/main_static_2.ut.rb +11 -11
- data/tests/unix/lib_linking_mode/tc_conflicted_build.rb +18 -18
- data/tests/unix/lib_linking_mode/tc_normal_build.rb +18 -18
- data/tests/unix/lib_order/tc_normal_build.rb +16 -16
- metadata +216 -205
@@ -1,58 +1,58 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
require 'fileutils'
|
3
|
-
|
4
|
-
require 'mxx_ru/cpp/obj_placements/custom_subdir'
|
5
|
-
|
6
|
-
class TC_CustomSubdirObjPlacement < Test::Unit::TestCase
|
7
|
-
FINAL_PATH = 'bin'
|
8
|
-
INTERMEDIATE_PATH = 'intermediate'
|
9
|
-
|
10
|
-
def teardown
|
11
|
-
FileUtils.rm_r( FINAL_PATH ) if File.directory?( FINAL_PATH )
|
12
|
-
FileUtils.rm_r( INTERMEDIATE_PATH ) if File.directory?( INTERMEDIATE_PATH )
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_final_path
|
16
|
-
p = Mxx_ru::Cpp::CustomSubdirObjPlacement.new(
|
17
|
-
FINAL_PATH, INTERMEDIATE_PATH )
|
18
|
-
|
19
|
-
r = p.get_exe( '', nil, nil )
|
20
|
-
check_name_and_path( FINAL_PATH + '/', r )
|
21
|
-
r = p.get_exe( 'exe', nil, nil )
|
22
|
-
check_name_and_path( FINAL_PATH + '/exe', r )
|
23
|
-
|
24
|
-
r = p.get_dll( '', nil, nil )
|
25
|
-
check_name_and_path( FINAL_PATH + '/', r )
|
26
|
-
r = p.get_dll( 'dll', nil, nil )
|
27
|
-
check_name_and_path( FINAL_PATH + '/dll', r )
|
28
|
-
|
29
|
-
r = p.get_lib( '', nil, nil )
|
30
|
-
check_name_and_path( FINAL_PATH + '/', r )
|
31
|
-
r = p.get_lib( 'lib', nil, nil )
|
32
|
-
check_name_and_path( FINAL_PATH + '/lib', r )
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_intermediate_path
|
36
|
-
p = Mxx_ru::Cpp::CustomSubdirObjPlacement.new(
|
37
|
-
FINAL_PATH, INTERMEDIATE_PATH )
|
38
|
-
|
39
|
-
r = p.get_obj( nil, nil, nil )
|
40
|
-
check_name_and_path( INTERMEDIATE_PATH, r )
|
41
|
-
|
42
|
-
r = p.get_obj( '', nil, nil )
|
43
|
-
check_name_and_path( INTERMEDIATE_PATH, r )
|
44
|
-
|
45
|
-
r = p.get_obj( '.', nil, nil )
|
46
|
-
check_name_and_path( INTERMEDIATE_PATH, r )
|
47
|
-
|
48
|
-
r = p.get_obj( 'prj_1/src', nil, nil )
|
49
|
-
check_name_and_path( File.join( INTERMEDIATE_PATH, 'prj_1/src' ), r )
|
50
|
-
end
|
51
|
-
|
52
|
-
private
|
53
|
-
def check_name_and_path( expected, actual )
|
54
|
-
assert_equal( expected, actual )
|
55
|
-
assert( File.directory?( expected ) )
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
1
|
+
require 'test/unit'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
require 'mxx_ru/cpp/obj_placements/custom_subdir'
|
5
|
+
|
6
|
+
class TC_CustomSubdirObjPlacement < Test::Unit::TestCase
|
7
|
+
FINAL_PATH = 'bin'
|
8
|
+
INTERMEDIATE_PATH = 'intermediate'
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
FileUtils.rm_r( FINAL_PATH ) if File.directory?( FINAL_PATH )
|
12
|
+
FileUtils.rm_r( INTERMEDIATE_PATH ) if File.directory?( INTERMEDIATE_PATH )
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_final_path
|
16
|
+
p = Mxx_ru::Cpp::CustomSubdirObjPlacement.new(
|
17
|
+
FINAL_PATH, INTERMEDIATE_PATH )
|
18
|
+
|
19
|
+
r = p.get_exe( '', nil, nil )
|
20
|
+
check_name_and_path( FINAL_PATH + '/', r )
|
21
|
+
r = p.get_exe( 'exe', nil, nil )
|
22
|
+
check_name_and_path( FINAL_PATH + '/exe', r )
|
23
|
+
|
24
|
+
r = p.get_dll( '', nil, nil )
|
25
|
+
check_name_and_path( FINAL_PATH + '/', r )
|
26
|
+
r = p.get_dll( 'dll', nil, nil )
|
27
|
+
check_name_and_path( FINAL_PATH + '/dll', r )
|
28
|
+
|
29
|
+
r = p.get_lib( '', nil, nil )
|
30
|
+
check_name_and_path( FINAL_PATH + '/', r )
|
31
|
+
r = p.get_lib( 'lib', nil, nil )
|
32
|
+
check_name_and_path( FINAL_PATH + '/lib', r )
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_intermediate_path
|
36
|
+
p = Mxx_ru::Cpp::CustomSubdirObjPlacement.new(
|
37
|
+
FINAL_PATH, INTERMEDIATE_PATH )
|
38
|
+
|
39
|
+
r = p.get_obj( nil, nil, nil )
|
40
|
+
check_name_and_path( INTERMEDIATE_PATH, r )
|
41
|
+
|
42
|
+
r = p.get_obj( '', nil, nil )
|
43
|
+
check_name_and_path( INTERMEDIATE_PATH, r )
|
44
|
+
|
45
|
+
r = p.get_obj( '.', nil, nil )
|
46
|
+
check_name_and_path( INTERMEDIATE_PATH, r )
|
47
|
+
|
48
|
+
r = p.get_obj( 'prj_1/src', nil, nil )
|
49
|
+
check_name_and_path( File.join( INTERMEDIATE_PATH, 'prj_1/src' ), r )
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
def check_name_and_path( expected, actual )
|
54
|
+
assert_equal( expected, actual )
|
55
|
+
assert( File.directory?( expected ) )
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require 'mxx_ru/cpp'
|
2
|
-
|
3
|
-
Mxx_ru::Cpp::composite_target {
|
4
|
-
required_prj 'hi.rb'
|
5
|
-
required_prj 'test-with-ext.rb'
|
6
|
-
required_prj 'test-no-ext.rb'
|
7
|
-
}
|
1
|
+
require 'mxx_ru/cpp'
|
2
|
+
|
3
|
+
Mxx_ru::Cpp::composite_target {
|
4
|
+
required_prj 'hi.rb'
|
5
|
+
required_prj 'test-with-ext.rb'
|
6
|
+
required_prj 'test-no-ext.rb'
|
7
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require 'mxx_ru/cpp'
|
2
|
-
|
3
|
-
Mxx_ru::Cpp::lib_target {
|
4
|
-
target 'hi'
|
5
|
-
|
6
|
-
c_source 'hi.c'
|
7
|
-
}
|
1
|
+
require 'mxx_ru/cpp'
|
2
|
+
|
3
|
+
Mxx_ru::Cpp::lib_target {
|
4
|
+
target 'hi'
|
5
|
+
|
6
|
+
c_source 'hi.c'
|
7
|
+
}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
|
3
|
-
require File.dirname( __FILE__ ) + '/../../test_with_compilation'
|
4
|
-
|
5
|
-
class TC_OptLibPath < Test::Unit::TestCase
|
6
|
-
include TestWithCompilation
|
7
|
-
|
8
|
-
test_path 'tests/mxx_ru/opt_lib_ext'
|
9
|
-
|
10
|
-
test_case :successful_compile_and_link do
|
11
|
-
assert_nothing_raised {
|
12
|
-
build( 'build.rb' )
|
13
|
-
clean( 'build.rb' )
|
14
|
-
}
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
|
1
|
+
require 'test/unit'
|
2
|
+
|
3
|
+
require File.dirname( __FILE__ ) + '/../../test_with_compilation'
|
4
|
+
|
5
|
+
class TC_OptLibPath < Test::Unit::TestCase
|
6
|
+
include TestWithCompilation
|
7
|
+
|
8
|
+
test_path 'tests/mxx_ru/opt_lib_ext'
|
9
|
+
|
10
|
+
test_case :successful_compile_and_link do
|
11
|
+
assert_nothing_raised {
|
12
|
+
build( 'build.rb' )
|
13
|
+
clean( 'build.rb' )
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require 'mxx_ru/cpp'
|
2
|
-
|
3
|
-
Mxx_ru::Cpp::exe_target {
|
4
|
-
target 'test-no-ext'
|
5
|
-
|
6
|
-
lib 'hi', '.'
|
7
|
-
|
8
|
-
c_source 'main.c'
|
9
|
-
}
|
1
|
+
require 'mxx_ru/cpp'
|
2
|
+
|
3
|
+
Mxx_ru::Cpp::exe_target {
|
4
|
+
target 'test-no-ext'
|
5
|
+
|
6
|
+
lib 'hi', '.'
|
7
|
+
|
8
|
+
c_source 'main.c'
|
9
|
+
}
|
@@ -1,13 +1,13 @@
|
|
1
|
-
require 'mxx_ru/cpp'
|
2
|
-
|
3
|
-
Mxx_ru::Cpp::exe_target {
|
4
|
-
target 'test-with-ext'
|
5
|
-
|
6
|
-
if 'mswin' == toolset.tag( 'target_os' )
|
7
|
-
lib 'hi.lib', '.'
|
8
|
-
else
|
9
|
-
lib 'hi', '.'
|
10
|
-
end
|
11
|
-
|
12
|
-
c_source 'main.c'
|
13
|
-
}
|
1
|
+
require 'mxx_ru/cpp'
|
2
|
+
|
3
|
+
Mxx_ru::Cpp::exe_target {
|
4
|
+
target 'test-with-ext'
|
5
|
+
|
6
|
+
if 'mswin' == toolset.tag( 'target_os' )
|
7
|
+
lib 'hi.lib', '.'
|
8
|
+
else
|
9
|
+
lib 'hi', '.'
|
10
|
+
end
|
11
|
+
|
12
|
+
c_source 'main.c'
|
13
|
+
}
|
@@ -1,72 +1,72 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
|
3
|
-
require 'mxx_ru/cpp'
|
4
|
-
|
5
|
-
class TC_PluralFormMethods < Test::Unit::TestCase
|
6
|
-
def test_required_prj
|
7
|
-
test_value = [ 'test_required_prj_sub1', 'test_required_prj_sub2' ]
|
8
|
-
|
9
|
-
test_value.each { |p| Mxx_ru::Cpp::composite_target( p ) {} }
|
10
|
-
|
11
|
-
t = Mxx_ru::Cpp::composite_target( 'test_required_prj' ) {
|
12
|
-
required_prjs test_value
|
13
|
-
}
|
14
|
-
|
15
|
-
assert_equal( test_value.size, t.mxx_required_prjs.size )
|
16
|
-
t.mxx_required_prjs.each { |p|
|
17
|
-
assert( test_value.member?( p.prj_alias ) )
|
18
|
-
}
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_c_sources
|
22
|
-
test_files = [ 'hello.c', 'greeting.c' ]
|
23
|
-
|
24
|
-
t = Mxx_ru::setup_target(
|
25
|
-
Mxx_ru::Cpp::Exe_target.new( 'test_c_sources' ) {
|
26
|
-
target 'test_c_sources'
|
27
|
-
|
28
|
-
c_sources test_files
|
29
|
-
},
|
30
|
-
false )
|
31
|
-
|
32
|
-
defined_sources = t.mxx_c_files.inject( [] ) { |r, f| r << File.basename( f.name ) }
|
33
|
-
|
34
|
-
assert_equal( test_files, defined_sources )
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_cpp_sources
|
38
|
-
test_files = [ 'hello.cpp', 'greeting.cpp' ]
|
39
|
-
|
40
|
-
path = 'some/test'
|
41
|
-
t = Mxx_ru::setup_target(
|
42
|
-
Mxx_ru::Cpp::Exe_target.new( "#{path}/test_cpp_sources" ) {
|
43
|
-
target 'test_cpp_sources'
|
44
|
-
|
45
|
-
cpp_sources test_files
|
46
|
-
},
|
47
|
-
false )
|
48
|
-
|
49
|
-
expected_sources = test_files.inject( [] ) { |r, f| r << "#{path}/#{f}" }
|
50
|
-
defined_sources = t.mxx_cpp_files.inject( [] ) { |r, f| r << f.name }
|
51
|
-
|
52
|
-
assert_equal( expected_sources, defined_sources )
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_cpp_sources_with_special_prefix
|
56
|
-
path = 'some/test'
|
57
|
-
test_files = [ "#{path}/hello.cpp", "#{path}/greeting.cpp" ]
|
58
|
-
|
59
|
-
t = Mxx_ru::setup_target(
|
60
|
-
Mxx_ru::Cpp::Exe_target.new( "#{path}/test_cpp_sources" ) {
|
61
|
-
target 'test_cpp_sources'
|
62
|
-
|
63
|
-
cpp_sources test_files
|
64
|
-
},
|
65
|
-
false )
|
66
|
-
|
67
|
-
defined_sources = t.mxx_cpp_files.inject( [] ) { |r, f| r << f.name }
|
68
|
-
|
69
|
-
assert_equal( test_files, defined_sources )
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
1
|
+
require 'test/unit'
|
2
|
+
|
3
|
+
require 'mxx_ru/cpp'
|
4
|
+
|
5
|
+
class TC_PluralFormMethods < Test::Unit::TestCase
|
6
|
+
def test_required_prj
|
7
|
+
test_value = [ 'test_required_prj_sub1', 'test_required_prj_sub2' ]
|
8
|
+
|
9
|
+
test_value.each { |p| Mxx_ru::Cpp::composite_target( p ) {} }
|
10
|
+
|
11
|
+
t = Mxx_ru::Cpp::composite_target( 'test_required_prj' ) {
|
12
|
+
required_prjs test_value
|
13
|
+
}
|
14
|
+
|
15
|
+
assert_equal( test_value.size, t.mxx_required_prjs.size )
|
16
|
+
t.mxx_required_prjs.each { |p|
|
17
|
+
assert( test_value.member?( p.prj_alias ) )
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_c_sources
|
22
|
+
test_files = [ 'hello.c', 'greeting.c' ]
|
23
|
+
|
24
|
+
t = Mxx_ru::setup_target(
|
25
|
+
Mxx_ru::Cpp::Exe_target.new( 'test_c_sources' ) {
|
26
|
+
target 'test_c_sources'
|
27
|
+
|
28
|
+
c_sources test_files
|
29
|
+
},
|
30
|
+
false )
|
31
|
+
|
32
|
+
defined_sources = t.mxx_c_files.inject( [] ) { |r, f| r << File.basename( f.name ) }
|
33
|
+
|
34
|
+
assert_equal( test_files, defined_sources )
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_cpp_sources
|
38
|
+
test_files = [ 'hello.cpp', 'greeting.cpp' ]
|
39
|
+
|
40
|
+
path = 'some/test'
|
41
|
+
t = Mxx_ru::setup_target(
|
42
|
+
Mxx_ru::Cpp::Exe_target.new( "#{path}/test_cpp_sources" ) {
|
43
|
+
target 'test_cpp_sources'
|
44
|
+
|
45
|
+
cpp_sources test_files
|
46
|
+
},
|
47
|
+
false )
|
48
|
+
|
49
|
+
expected_sources = test_files.inject( [] ) { |r, f| r << "#{path}/#{f}" }
|
50
|
+
defined_sources = t.mxx_cpp_files.inject( [] ) { |r, f| r << f.name }
|
51
|
+
|
52
|
+
assert_equal( expected_sources, defined_sources )
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_cpp_sources_with_special_prefix
|
56
|
+
path = 'some/test'
|
57
|
+
test_files = [ "#{path}/hello.cpp", "#{path}/greeting.cpp" ]
|
58
|
+
|
59
|
+
t = Mxx_ru::setup_target(
|
60
|
+
Mxx_ru::Cpp::Exe_target.new( "#{path}/test_cpp_sources" ) {
|
61
|
+
target 'test_cpp_sources'
|
62
|
+
|
63
|
+
cpp_sources test_files
|
64
|
+
},
|
65
|
+
false )
|
66
|
+
|
67
|
+
defined_sources = t.mxx_cpp_files.inject( [] ) { |r, f| r << f.name }
|
68
|
+
|
69
|
+
assert_equal( test_files, defined_sources )
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
@@ -1,76 +1,76 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
|
3
|
-
require 'mxx_ru/cpp/qt'
|
4
|
-
|
5
|
-
class CustomQtGen < Mxx_ru::Cpp::QtGen
|
6
|
-
public :names_from_ui
|
7
|
-
end
|
8
|
-
|
9
|
-
class TC_UicResultSubdir < Test::Unit::TestCase
|
10
|
-
|
11
|
-
def test_in_cwd_no_uic_result_subdir
|
12
|
-
target = create_target( 'no_uic_result_subdir.rb' )
|
13
|
-
qt = create_qt_gen( target )
|
14
|
-
|
15
|
-
ui_names = qt.names_from_ui( "dlg.ui", target )
|
16
|
-
assert_equal( "dlg.hpp", ui_names.header )
|
17
|
-
assert_equal( "dlg.cpp", ui_names.source )
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_in_subdir_no_uic_result_subdir
|
21
|
-
target = create_target( 'some/path/no_uic_result_subdir.rb' )
|
22
|
-
qt = create_qt_gen( target )
|
23
|
-
|
24
|
-
path = 'some/path'
|
25
|
-
|
26
|
-
ui_names = qt.names_from_ui( "#{path}/dlg.ui", target )
|
27
|
-
assert_equal( "#{path}/dlg.hpp", ui_names.header )
|
28
|
-
assert_equal( "#{path}/dlg.cpp", ui_names.source )
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_in_cwd_with_uic_result_subdir
|
32
|
-
target = create_target( 'with_uic_result_subdir.rb' )
|
33
|
-
qt = create_qt_gen( target )
|
34
|
-
qt.uic_result_subdir = 'uic'
|
35
|
-
|
36
|
-
ui_names = qt.names_from_ui( "dlg.ui", target )
|
37
|
-
assert_equal( "./uic/dlg.hpp", ui_names.header )
|
38
|
-
assert_equal( "./uic/dlg.cpp", ui_names.source )
|
39
|
-
end
|
40
|
-
|
41
|
-
def test_in_subdir_with_uic_result_subdir
|
42
|
-
target = create_target( 'some/path/with_uic_result_subdir.rb' )
|
43
|
-
qt = create_qt_gen( target )
|
44
|
-
qt.uic_result_subdir = 'uic'
|
45
|
-
|
46
|
-
path = 'some/path'
|
47
|
-
|
48
|
-
ui_names = qt.names_from_ui( "#{path}/dlg.ui", target )
|
49
|
-
assert_equal( "#{path}/uic/dlg.hpp", ui_names.header )
|
50
|
-
assert_equal( "#{path}/uic/dlg.cpp", ui_names.source )
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_target_include_path
|
54
|
-
target = create_target( 'some/path/with_uic_result_subdir.rb' )
|
55
|
-
qt = create_qt_gen( target )
|
56
|
-
qt.uic_result_subdir = 'uic'
|
57
|
-
qt.ui( 'dlg.ui' )
|
58
|
-
qt.ui( 'mainwnd/mainwnd.ui' )
|
59
|
-
|
60
|
-
assert( target.mxx_all_include_paths.include?( 'some/path/uic' ) )
|
61
|
-
assert( target.mxx_all_include_paths.include?( 'some/path/mainwnd/uic' ) )
|
62
|
-
end
|
63
|
-
|
64
|
-
private
|
65
|
-
def create_target( prj_alias )
|
66
|
-
Mxx_ru::Cpp::ExeTarget.new( prj_alias )
|
67
|
-
end
|
68
|
-
|
69
|
-
def create_qt_gen( target )
|
70
|
-
qt = CustomQtGen.new( target )
|
71
|
-
qt.hpp_ext = '.hpp'
|
72
|
-
qt.cpp_ext = '.cpp'
|
73
|
-
qt
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
1
|
+
require 'test/unit'
|
2
|
+
|
3
|
+
require 'mxx_ru/cpp/qt'
|
4
|
+
|
5
|
+
class CustomQtGen < Mxx_ru::Cpp::QtGen
|
6
|
+
public :names_from_ui
|
7
|
+
end
|
8
|
+
|
9
|
+
class TC_UicResultSubdir < Test::Unit::TestCase
|
10
|
+
|
11
|
+
def test_in_cwd_no_uic_result_subdir
|
12
|
+
target = create_target( 'no_uic_result_subdir.rb' )
|
13
|
+
qt = create_qt_gen( target )
|
14
|
+
|
15
|
+
ui_names = qt.names_from_ui( "dlg.ui", target )
|
16
|
+
assert_equal( "dlg.hpp", ui_names.header )
|
17
|
+
assert_equal( "dlg.cpp", ui_names.source )
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_in_subdir_no_uic_result_subdir
|
21
|
+
target = create_target( 'some/path/no_uic_result_subdir.rb' )
|
22
|
+
qt = create_qt_gen( target )
|
23
|
+
|
24
|
+
path = 'some/path'
|
25
|
+
|
26
|
+
ui_names = qt.names_from_ui( "#{path}/dlg.ui", target )
|
27
|
+
assert_equal( "#{path}/dlg.hpp", ui_names.header )
|
28
|
+
assert_equal( "#{path}/dlg.cpp", ui_names.source )
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_in_cwd_with_uic_result_subdir
|
32
|
+
target = create_target( 'with_uic_result_subdir.rb' )
|
33
|
+
qt = create_qt_gen( target )
|
34
|
+
qt.uic_result_subdir = 'uic'
|
35
|
+
|
36
|
+
ui_names = qt.names_from_ui( "dlg.ui", target )
|
37
|
+
assert_equal( "./uic/dlg.hpp", ui_names.header )
|
38
|
+
assert_equal( "./uic/dlg.cpp", ui_names.source )
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_in_subdir_with_uic_result_subdir
|
42
|
+
target = create_target( 'some/path/with_uic_result_subdir.rb' )
|
43
|
+
qt = create_qt_gen( target )
|
44
|
+
qt.uic_result_subdir = 'uic'
|
45
|
+
|
46
|
+
path = 'some/path'
|
47
|
+
|
48
|
+
ui_names = qt.names_from_ui( "#{path}/dlg.ui", target )
|
49
|
+
assert_equal( "#{path}/uic/dlg.hpp", ui_names.header )
|
50
|
+
assert_equal( "#{path}/uic/dlg.cpp", ui_names.source )
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_target_include_path
|
54
|
+
target = create_target( 'some/path/with_uic_result_subdir.rb' )
|
55
|
+
qt = create_qt_gen( target )
|
56
|
+
qt.uic_result_subdir = 'uic'
|
57
|
+
qt.ui( 'dlg.ui' )
|
58
|
+
qt.ui( 'mainwnd/mainwnd.ui' )
|
59
|
+
|
60
|
+
assert( target.mxx_all_include_paths.include?( 'some/path/uic' ) )
|
61
|
+
assert( target.mxx_all_include_paths.include?( 'some/path/mainwnd/uic' ) )
|
62
|
+
end
|
63
|
+
|
64
|
+
private
|
65
|
+
def create_target( prj_alias )
|
66
|
+
Mxx_ru::Cpp::ExeTarget.new( prj_alias )
|
67
|
+
end
|
68
|
+
|
69
|
+
def create_qt_gen( target )
|
70
|
+
qt = CustomQtGen.new( target )
|
71
|
+
qt.hpp_ext = '.hpp'
|
72
|
+
qt.cpp_ext = '.cpp'
|
73
|
+
qt
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|