Ticket #1890: darwin.libparrot_soname.diff.v2

File darwin.libparrot_soname.diff.v2, 2.9 KB (added by jkeenan, 4 years ago)

revised version; modifies darwin hints and test of mk_language_shell.pl

Line 
1diff --git a/config/init/hints/darwin.pm b/config/init/hints/darwin.pm
2index 82820fd..ea9fbfd 100644
3--- a/config/init/hints/darwin.pm
4+++ b/config/init/hints/darwin.pm
5@@ -91,9 +91,11 @@ sub runstep {
6         libparrot_shared_alias => "libparrot$share_ext",
7         rpath                  => "-L",
8         libparrot_soname       => "-install_name "
9-            . '"'. $lib_dir
10+            . '"'
11+            . $conf->data->get('libdir')
12             . '/libparrot'
13-            . $conf->data->get('share_ext') . '"'
14+            . $conf->data->get('share_ext')
15+            . '"'
16     );
17 }
18 
19diff --git a/t/tools/mk_language_shell.t b/t/tools/mk_language_shell.t
20index 91b025c..f556934 100644
21--- a/t/tools/mk_language_shell.t
22+++ b/t/tools/mk_language_shell.t
23@@ -20,6 +20,7 @@ use warnings;
24 use lib qw(lib);
25 
26 use Test::More;
27+use Carp;
28 use IO::File ();
29 use Parrot::Config;
30 use Parrot::Test;
31@@ -47,22 +48,35 @@ my $lang_dir = "test_parrot_language_$$";
32 my $test_dir = catfile($lang_dir, "t");
33 my $src_dir = catfile($lang_dir, "src");
34 my $setup = catfile($lang_dir, "setup.pir");
35-my $parrot_exe = catfile($PConfig{build_dir}, $PConfig{test_prog});
36+my $installed_parrot  = catfile($PConfig{bindir}, $PConfig{test_prog});
37+my $build_parrot      = catfile($PConfig{build_dir}, $PConfig{test_prog});
38+my $parrot_exe = (-e $installed_parrot)
39+    ? $installed_parrot
40+    : $build_parrot;
41 my $to_dev_null = $^O =~ /Win/ ? "1> NUL 2>&1" : ">/dev/null 2>&1";
42 ok(-e $lang_dir, "$lang_dir dir exists");
43 ok(-e $test_dir, "$test_dir dir exists");
44 ok(-e $src_dir, "$src_dir dir exists");
45 ok(-s $setup, "$setup exists and has nonzero size");
46 
47-my $build_status = system("cd $lang_dir && \"$parrot_exe\" setup.pir $to_dev_null");
48-my $build_error  = $!;
49-diag("Faild to execute $parrot_exe setup.pir : $build_error") if $build_status == - 1;
50-ok($build_status == 0, "language builds, exit code = " . ($build_status >> 8) );
51-
52-my $test_status = system("cd $lang_dir && \"$parrot_exe\" setup.pir test $to_dev_null");
53-my $test_error  = $!;
54-diag("Faild to execute $parrot_exe setup.pir test: $test_error") if $test_status == - 1;
55-ok($test_status == 0, "language passes all tests, exit code = " . ($test_status >> 8) );
56+SKIP: {
57+    my $reason = "tools/dev/mk_language_shell.pl requires installed parrot on Darwin";
58+    skip $reason, 2 if (
59+        ($PConfig{osname} eq 'darwin') and
60+        ($parrot_exe eq $build_parrot)
61+    );
62+    my $build_status =
63+        system("cd $lang_dir && \"$parrot_exe\" setup.pir $to_dev_null")
64+        and croak "Unable to execute setup.pir";
65+    is($build_status, 0,
66+        "system call to execute setup.pir completed successfully");
67+   
68+    my $test_status =
69+        system("cd $lang_dir && \"$parrot_exe\" setup.pir test $to_dev_null")
70+        and croak "Unable to execute setup.pir test";
71+    is($test_status, 0,
72+        "system call to execute setup.pir test completed successfully");
73+}
74 
75 =head1 HELPER SUBROUTINES
76