Hello,
I've tried to implement test target for hugin makefile, which then can
be used for testing of existence of tools but I've stuck when target
test: isn't present in generated makefile. Does anyone have idea what
can cause this?
Anyway, I'm not sure if using define is good for setting device for
redirecting output (see macro NULL_DEVICE).

I've divided it into two patches, test_target.diff is the one which
should add test: to makefile (but it doesn't). add_test_target.diff
adds building test before stitching.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/hugin-ptx
-~----------~----~----~----~------~----~------~--~---

Index: src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp
===================================================================
--- src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp	(revision 3693)
+++ src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp	(working copy)
@@ -34,6 +34,12 @@
  #define COULD_EXECUTE_EXIFTOOL_WITH_PERL
 #endif
 
+#ifdef __unix__
+ #define NULL_DEVICE /dev/null
+#else // WINDOWS
+ #define NULL_DEVICE nul
+#endif
+
 namespace HuginBase {
 
 using namespace std;
@@ -258,7 +264,7 @@
                     o << "--compression " << opts.quality;
                 }
                 o << endl;
-    
+
                 o << "ENBLEND_HDR_COMP=";
                 if (opts.outputImageType == "tif" && opts.outputImageTypeHDRCompression.size() != 0) {
                     o << "--compression " << opts.outputImageTypeHDRCompression;
@@ -720,6 +726,38 @@
         << "\t-$(RM) $(TEMP_FILES_SHELL)" << endl
         << endl;
 
+        // test rule
+        o << "test: " << endl;
+        // test remapper
+        switch(opts.remapper) {
+            case PanoramaOptions::NONA:
+                o << "\...@$(NONA) --help > " << NULL_DEVICE << " 2>&1 && echo '[OK] nona runs'" << endl;
+                break;
+            case PanoramaOptions::PTMENDER:
+                break;
+        }
+        // test blender
+        switch(opts.blendMode) {
+            case PanoramaOptions::ENBLEND_BLEND:
+                o << "\...@$(ENBLEND) --help > " << NULL_DEVICE << " 2>&1 && echo '[OK] enblend runs'" << endl;
+                break;
+            case PanoramaOptions::PTBLENDER_BLEND:
+                o << "\...@$(PTBLENDER) -h > " << NULL_DEVICE << " 2>&1 && echo '[OK] PTblender runs'" << endl;
+                break;
+            case PanoramaOptions::SMARTBLEND_BLEND:
+                o << "\...@$(SMARTBLEND) > " << NULL_DEVICE << " 2>&1 && echo '[OK] smartblend runs'" << endl;
+                break;
+        }
+        // test enfuse
+        o << "\...@$(ENFUSE) --help > " << NULL_DEVICE << " 2>&1 && echo '[OK] enfuse runs'" << endl;
+        // test hugin_hdrmerge
+        o << "\...@$(HDRMERGE) --help > " << NULL_DEVICE << " 2>&1 && echo '[OK] hugin_hdrmerge runs'" << endl;
+        // test exiftool
+        o << "\...@$(EXIFTOOL) --help > " << NULL_DEVICE << " 2>&1 && echo '[OK] exiftool runs'" << endl;
+        // test rm
+        o << "\...@$(RM) --help > " << NULL_DEVICE << " 2>&1 && echo '[OK] rm runs'" << endl
+          << endl;
+
         // ==============================
         // output rules for all targets.
         // remapped LDR images for exposure stacks.
Index: src/hugin1/base_wx/RunStitchPanel.cpp
===================================================================
--- src/hugin1/base_wx/RunStitchPanel.cpp	(revision 3693)
+++ src/hugin1/base_wx/RunStitchPanel.cpp	(working copy)
@@ -234,7 +234,7 @@
             DEBUG_DEBUG("Overwrite existing images!");
         }
 
-        wxString args = wxT("-f ") + wxQuoteString(m_currentMakefn) + wxT(" all clean");
+        wxString args = wxT("-f ") + wxQuoteString(m_currentMakefn) + wxT(" test all clean");
 
         wxString caption = wxString::Format(_("Stitching %s"), scriptFile.c_str());
 

Reply via email to