6656e7fa34041ef472ced30f984aec1919490720
[ghc.git] / testsuite / tests / rts / T11223 / all.T
1 import string
2 import re
3
4 #--------------------------------------
5 # Python normalization functions
6 #--------------------------------------
7 def normalise_duplicate_errmsg( msg ):
8      return re.sub(r"((?:[a-z, A-Z]+):|)[\/\\\\]+(?:.+[\/\\\\]+?)?(.+?)[\/\\\\]+", "    ", 
9                re.sub(r"version\s(\d+\.\d+\.\d+)\sfor\s[a-z,A-Z,0-9,_,-]+(?=\))", r"", msg))
10
11 #--------------------------------------
12 # Test functions
13 #--------------------------------------
14
15 test('T11223_simple_link',
16      [extra_files(['foo.c', 'foo.hs']),
17       when(ghc_dynamic(), skip)],
18      run_command,
19      ['$MAKE -s --no-print-directory t_11223_simple_link'])
20
21 test('T11223_simple_link_lib',
22      [extra_files(['foo.c', 'foo.hs']),
23       when(ghc_dynamic(), skip)],
24      run_command,
25      ['$MAKE -s --no-print-directory t_11223_simple_link_lib'])
26
27 # I'm ignoring the output since for this particular invocation normalise_errmsg
28 # isn't being called and I can't figure out why not.
29 test('T11223_simple_duplicate',
30      [extra_files(['bar.c', 'foo.c', 'foo.hs']),
31       when(ghc_dynamic(), skip), ignore_stderr, ignore_stdout, exit_code(2), normalise_errmsg_fun(normalise_duplicate_errmsg)],
32      run_command,
33      ['$MAKE -s --no-print-directory t_11223_simple_duplicate'])
34
35 test('T11223_simple_duplicate_lib',
36      [extra_files(['bar.c', 'foo.c', 'foo.hs']),
37       when(platform('i386-unknown-mingw32'), expect_broken(13515)),
38       when(ghc_dynamic(), skip), normalise_errmsg_fun(normalise_duplicate_errmsg)],
39      run_command,
40      ['$MAKE -s --no-print-directory t_11223_simple_duplicate_lib'])
41
42 test('T11223_simple_unused_duplicate_lib',
43      [extra_files(['bar.c', 'foo.c', 'foo.hs']),
44       when(ghc_dynamic(), skip)],
45      run_command,
46      ['$MAKE -s --no-print-directory t_11223_simple_unused_duplicate_lib'])
47
48 test('T11223_link_order_a_b_succeed',
49      [extra_files(['bar.c', 'foo.c', 'foo2.hs']),
50       when(ghc_dynamic(), skip)],
51      run_command,
52      ['$MAKE -s --no-print-directory t_11223_link_order_a_b_succeed'])
53
54 test('T11223_link_order_b_a_succeed',
55      [extra_files(['bar.c', 'foo.c', 'foo2.hs']),
56       when(ghc_dynamic(), skip)],
57      run_command,
58      ['$MAKE -s --no-print-directory t_11223_link_order_b_a_succeed'])
59
60 test('T11223_link_order_a_b_2_fail',
61      [extra_files(['bar.c', 'foo.c', 'foo3.hs']),
62       when(ghc_dynamic(), skip), normalise_errmsg_fun(normalise_duplicate_errmsg)],
63      run_command,
64      ['$MAKE -s --no-print-directory t_11223_link_order_a_b_2_fail'])
65
66 test('T11223_link_order_b_a_2_succeed',
67      [extra_files(['bar.c', 'foo.c', 'foo3.hs']),
68       when(ghc_dynamic(), skip)],
69      run_command,
70      ['$MAKE -s --no-print-directory t_11223_link_order_b_a_2_succeed'])
71
72 # Weak Symbols are not currently implemented. So Disable all the tests
73 # See Note [weak-symbols-support] in Linker.c
74
75 test('T11223_weak_only_link_fail',
76      [extra_files(['power.c', 'power.hs']),
77       when(ghc_dynamic(), skip), expect_broken(11817)],
78      run_command,
79      ['$MAKE -s --no-print-directory t_11223_weak_only_link_fail'])
80
81 test('T11223_weak_only_link_succeed',
82      [extra_files(['power3.hs', 'power_slow.c']),
83       when(ghc_dynamic(), skip), expect_broken(11817)],
84      run_command,
85      ['$MAKE -s --no-print-directory t_11223_weak_only_link_succeed'])
86
87 test('T11223_weak_both_link_order_a_b_succeed',
88      [extra_files(['power.c', 'power3.hs', 'power_slow.c']),
89       when(ghc_dynamic(), skip), expect_broken(11817)],
90      run_command,
91      ['$MAKE -s --no-print-directory t_11223_weak_both_link_order_a_b_succeed'])
92
93 test('T11223_weak_both_link_order_b_a_succeed',
94      [extra_files(['power.c', 'power3.hs', 'power_slow.c']),
95       when(ghc_dynamic(), skip), expect_broken(11817)],
96      run_command,
97      ['$MAKE -s --no-print-directory t_11223_weak_both_link_order_b_a_succeed'])
98
99 test('T11223_weak_single_link_order_a_b_succeed',
100      [extra_files(['power.c', 'power3.hs', 'power_slow.c']),
101       when(ghc_dynamic(), skip), expect_broken(11817)],
102      run_command,
103      ['$MAKE -s --no-print-directory t_11223_weak_single_link_order_a_b_succeed'])
104
105 test('T11223_weak_single_link_order_b_a_succeed',
106      [extra_files(['power.c', 'power3.hs', 'power_slow.c']),
107       when(ghc_dynamic(), skip), expect_broken(11817)],
108      run_command,
109      ['$MAKE -s --no-print-directory t_11223_weak_single_link_order_b_a_succeed'])