[test suite] minor 're-run make' bug fix for perl FKO module installation
authorMichael Rash <mbr@cipherdyne.org>
Sun, 9 Dec 2012 20:25:14 +0000 (15:25 -0500)
committerMichael Rash <mbr@cipherdyne.org>
Sun, 9 Dec 2012 20:25:14 +0000 (15:25 -0500)
test/test-fwknop.pl

index 512d8c5..f434c34 100755 (executable)
@@ -2863,15 +2863,23 @@ sub perl_fko_module_compile_install() {
 
     chdir '../perl/FKO' or die $!;
 
-    &run_cmd("make clean", $cmd_out_tmp,
-            "../../test/$curr_test_file");
+    &run_cmd("make clean", $cmd_out_tmp, "../../test/$curr_test_file")
+        if -e 'Makefile' or -e 'Makefile.old';
+
     &run_cmd("perl Makefile.PL PREFIX=../../test/$perl_mod_fko_dir " .
         "LIB=../../test/$perl_mod_fko_dir", $cmd_out_tmp,
         "../../test/$curr_test_file");
-    &run_cmd('make', $cmd_out_tmp,
-        "../../test/$curr_test_file");
-    &run_cmd('make install', $cmd_out_tmp,
-        "../../test/$curr_test_file");
+
+    &run_cmd('make', $cmd_out_tmp, "../../test/$curr_test_file");
+
+    if (&file_find_regex([qr/rerun\sthe\smake\scommand/],
+            $MATCH_ALL, "../../test/$curr_test_file")) {
+        &run_cmd('touch Makefile.PL', $cmd_out_tmp, "../../test/$curr_test_file");
+        &run_cmd('touch Makefile', $cmd_out_tmp, "../../test/$curr_test_file");
+        &run_cmd('make', $cmd_out_tmp, "../../test/$curr_test_file");
+    }
+
+    &run_cmd('make install', $cmd_out_tmp, "../../test/$curr_test_file");
 
     chdir $curr_pwd or die $!;