Permalink
Browse files

Instead of having a hardcoded shebang for the parrot only tests,

generate the files with the appropriate path-to-parrot already in them.


git-svn-id: http://partcl.googlecode.com/svn/trunk@357 6cb8db7d-f34b-0410-8f57-4f83c6281724
  • Loading branch information...
wcoleda
wcoleda committed May 22, 2009
1 parent 5920afd commit d7c074d75c0e06a0dc6a16eb890f9bcb3039cf34
View
@@ -15,6 +15,7 @@
my $perlbin = `$config perl`
or die "Unable to find parrot_config, $config";
my $libdir = `$config libdir`;
+my $bindir = `$config bindir`;
my $versiondir = `$config versiondir`;
my $slash = `$config slash`;
my $make = `$config make`;
@@ -56,6 +57,13 @@
print {$fh} "use lib qw(${libdir}${versiondir}/tools/lib);\n";
print {$fh} "1;\n";
+print "Generating miscellaneous files\n";
+
+my $parrot = "$bindir/parrot";
+add_shebang($parrot, "t/internals/select_switches.t", "t/internals/select_switches_t.in");
+add_shebang($parrot, "t/internals/select_option.t", "t/internals/select_option_t.in");
+
+
print <<"END";
You can now use '$make' to build partcl.
@@ -68,3 +76,22 @@ sub usage {
Usage: $0 [--parrot-config=/path/to/parrot_config]
EOM
}
+
+sub add_shebang {
+ my $exe = shift;
+ my $target = shift;
+ my $source = shift;
+
+ my $shebang = "#!$exe";
+
+ my $contents;
+ {
+ local undef $/;
+ open my $fh, '<', $source;
+ $contents = <$fh>;
+ }
+
+ open my $ofh, '>', $target;
+ print {$ofh} $shebang, "\n";
+ print {$ofh} $contents;
+}
View
@@ -191,7 +191,9 @@ clean:
realclean: clean
$(RM_F) examples/Makefile Makefile t_tcl \
$(PMCDIR)/Makefile $(OPSDIR)/Makefile \
- lib/Parrot/Installed.pm
+ lib/Parrot/Installed.pm \
+ t/internals/select_option.t \
+ t/internals/select_switches.t
distclean: realclean
@@ -1,4 +1,3 @@
-#! parrot
# Copyright (C) 2001-2008, The Perl Foundation.
# $Id: select_option.t 31294 2008-09-21 08:47:14Z tene $
@@ -1,4 +1,3 @@
-#! parrot
# Copyright (C) 2001-2008, The Perl Foundation.
# $Id: select_switches.t 31511 2008-09-30 14:18:56Z coke $

0 comments on commit d7c074d

Please sign in to comment.