OSDN Git Service

* cygload/README: Delete.
authorcgf <cgf>
Mon, 2 Jan 2006 06:15:57 +0000 (06:15 +0000)
committercgf <cgf>
Mon, 2 Jan 2006 06:15:57 +0000 (06:15 +0000)
* cygload/cygload.cc: Move to winsup.api.  Add comments from README.
* cygload/cygload.h: Move to winsup.api.
* cygload/cygload.exp: Move to winsup.api.
* Makefile.in: Remove cygload.
* winsup.api/winsup.exp: If a .exp file is detected, run it rather than using
standard compile.
* winsup.api/resethand.c (main): Use printf to print status or expect thinks
something is wrong.

winsup/testsuite/ChangeLog
winsup/testsuite/Makefile.in
winsup/testsuite/cygload/Makefile [deleted file]
winsup/testsuite/cygload/README [deleted file]
winsup/testsuite/winsup.api/cygload.cc [moved from winsup/testsuite/cygload/cygload.cc with 93% similarity]
winsup/testsuite/winsup.api/cygload.exp [moved from winsup/testsuite/cygload/cygload.exp with 100% similarity]
winsup/testsuite/winsup.api/cygload.h [moved from winsup/testsuite/cygload/cygload.h with 99% similarity]
winsup/testsuite/winsup.api/resethand.c
winsup/testsuite/winsup.api/winsup.exp

index 6ed7c39..5fb31a8 100644 (file)
@@ -1,3 +1,16 @@
+2006-01-02  Christopher Faylor  <cgf@timesys.com>
+
+       * cygload/README: Delete.
+       * cygload/cygload.cc: Move to winsup.api.  Add comments from README.
+       * cygload/cygload.h: Move to winsup.api.
+       * cygload/cygload.exp: Move to winsup.api.
+       * Makefile.in: Remove cygload.
+       * winsup.api/winsup.exp: If a .exp file is detected, run it rather than
+       using standard compile.
+
+       * winsup.api/resethand.c (main): Use printf to print status or expect
+       thinks something is wrong.
+
 2006-01-01  Christopher Faylor  <cgf@timesys.com>
 
        * winsup.api/resethand.c (main): Remove core dump flag from exit
index cdc96d8..70bf30c 100644 (file)
@@ -187,7 +187,6 @@ check: $(TESTSUP_LIB_NAME) $(RUNTIME) cygrun.exe testsuite/site.exp
            export TCL_LIBRARY ; fi ; \
        PATH=$(bupdir)/cygwin:$${PATH} ;\
        $(RUNTEST) --tool winsup $(RUNTESTFLAGS) ;\
-       $(RUNTEST) --tool cygload $(RUNTESTFLAGS)
 
 cygrun.o: cygrun.c
        $(CC) $(MINGW_CFLAGS) -o $@ -c $<
diff --git a/winsup/testsuite/cygload/Makefile b/winsup/testsuite/cygload/Makefile
deleted file mode 100644 (file)
index e88dde3..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# Makefile for cygload
-
-###
-### MinGW options
-###
-CC = gcc
-CFLAGS = -mno-cygwin -Wall
-LINKFLAGS = -lstdc++ -Wl,-e,_cygloadCRTStartup@0
-
-###
-### MSVC options
-###
-ifndef MSVCDir
-MSVCDir = C:/cygwin/usr/local/tools/i686_win32/vc7/Vc7
-endif
-
-CL = $(MSVCDir)/bin/cl
-# If you want to look at the assembly, add "/Famsvc-cygload.asm /FAs".
-MSVCCFLAGS = /nologo /GX /MDd /Zi /W4 /TP
-MSVCINCLUDES = /I $(MSVCDir)/include /I $(MSVCDir)/PlatformSDK/Include
-# Using /ENTRY seems to automatically invoke /NODEFAULTLIBS.
-MSVCLIBS = /link /LIBPATH:$(MSVCDir)/lib /LIBPATH:$(MSVCDir)/PlatformSDK/lib \
-       /ENTRY:cygloadCRTStartup uuid.lib msvcprtd.lib msvcrtd.lib \
-       oldnames.lib kernel32.lib
-
-all:   mingw-cygload.exe
-
-mingw-cygload.exe:     cygload.cc cygload.h
-       $(CC) $(CFLAGS) $< -o $@ $(LINKFLAGS)
-
-msvc-cygload.exe:      cygload.cc cygload.h
-       $(CL) $(MSVCCFLAGS) $(MSVCINCLUDES) $< /o $@ $(MSVCLIBS)
-
-clean:
-       rm -f msvc-cygload.exe msvc-cygload.ilk cygload.obj \
-               msvc-cygload.pdb vc70.pdb mingw-cygload.exe
diff --git a/winsup/testsuite/cygload/README b/winsup/testsuite/cygload/README
deleted file mode 100644 (file)
index a61f73b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-cygload demonstrates how to dynamically load cygwin1.dll.  The default
-build uses MinGW to compile it; the Makefile also shows how to build
-it using the Microsoft compiler.
-
-By default, the program will silently test basic functionality:
-        * Making space on the stack for cygtls
-        * Loading and initializing cygwin1.dll
-        * Path translation
-        * Error handling
-        * Signal handling
-
-Command line parameters are:
-
-    -v                 Verbose output
-    -testinterrupts    Pause for 30 seconds to allow testing command line
-                       interrupts (^C)
-    -cygwin xxx        Specifies an alternative DLL to load instead of
-                       cygwin1.dll.
similarity index 93%
rename from winsup/testsuite/cygload/cygload.cc
rename to winsup/testsuite/winsup.api/cygload.cc
index 0febf32..bdbbcd1 100644 (file)
@@ -1,23 +1,33 @@
-// cygload.cpp
-//
-// Copyright 2005, Red Hat, Inc.
-//
-// Written by Max Kaehn <slothman@electric-cloud.com>
-//
-// This software is a copyrighted work licensed under the terms of the
-// Cygwin license.  Please consult the file "CYGWIN_LICENSE" for details.
-//
-// Note that dynamically linking to cygwin1.dll automatically places your code
-// under the GPL unless you purchase a Cygwin Contract with Red Hat, Inc.
-// See http://www.redhat.com/software/cygwin/ for more information.
-
-
-// Options for this program:
-// -v              Verbose output.  Normal operation is entirely silent,
-//                 save for errors.
-// -testinterrupts Pauses the program for 30 seconds so you can demonstrate
-//                 that it handles ^C properly.
-// -cygwin         Name of DLL to load.  Defaults to "cygwin1.dll".
+/* cygload.cc
+
+   Copyright 2005, 2006 Red Hat, Inc.
+
+   Written by Max Kaehn <slothman@electric-cloud.com>
+  
+   This software is a copyrighted work licensed under the terms of the
+   Cygwin license.  Please consult the file "CYGWIN_LICENSE" for details.
+  
+   Note that dynamically linking to cygwin1.dll automatically places your code
+   under the GPL unless you purchase a Cygwin Contract with Red Hat, Inc.
+   See http://www.redhat.com/software/cygwin/ for more information.
+
+   cygload demonstrates how to dynamically load cygwin1.dll.  The default
+   build uses MinGW to compile it; the Makefile also shows how to build
+   it using the Microsoft compiler.
+
+   By default, the program will silently test basic functionality:
+     * Making space on the stack for cygtls
+     * Loading and initializing cygwin1.dll
+     * Path translation
+     * Error handling
+     * Signal handling
+
+   Options for this program:
+     -v              Verbose output.  Normal operation is entirely silent,
+                    save for errors.
+     -testinterrupts Pauses the program for 30 seconds so you can demonstrate
+                    that it handles ^C properly.
+     -cygwin         Name of DLL to load.  Defaults to "cygwin1.dll". */
 
 #include "cygload.h"
 #include <iostream>
similarity index 99%
rename from winsup/testsuite/cygload/cygload.h
rename to winsup/testsuite/winsup.api/cygload.h
index dfe9d0f..226a3f8 100644 (file)
@@ -66,7 +66,7 @@ namespace cygwin
     // gdb reports sizeof(_cygtls) == 3964 at the time of this writing.
     // This is at the end of the object so it'll be toward the bottom
     // of the stack when it gets declared.
-    char _padding[4096];
+    char _padding[8192];
 
     static padding *_main;
     static DWORD _mainTID;
index 2d1ccab..7d58dcd 100644 (file)
@@ -8,7 +8,6 @@ int doit = 0;
 void
 ouch (int sig)
 {
-  fprintf (stderr, "ouch %d\n", sig);
   if (doit++ > 0)
     kill (getpid (), SIGTERM);
 }
@@ -32,6 +31,6 @@ main (int argc, char **argv)
       exit (0x42);
     }
   status &= ~0x80;     // remove core dump flag
-  fprintf (stderr, "pid %d exited with status %p\n", pid, (void *) status);
+  printf ("pid %d exited with status %p\n", pid, (void *) status);
   exit (argc == 1 ? !(status == SIGSEGV) : !(status == SIGTERM));
 }
index 26d3af0..6390962 100644 (file)
@@ -29,7 +29,7 @@ proc ws_spawn {cmd args} {
 
 verbose "Filter: $test_filter"
 
-foreach src [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.c] {
+foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.{cc,c}]] {
     if { $test_filter != "" && ! [regexp $test_filter $src] } {
        verbose -log "Skipping $src"
        continue
@@ -48,32 +48,36 @@ foreach src [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.c] {
        clear_xfail
     }
 
-    ws_spawn "$CC -nodefaultlibs -mwin32 $CFLAGS $src $add_includes $add_libs $runtime_root/binmode.o -lgcc $runtime_root/libcygwin0.a -lkernel32 -luser32 -o $base.exe"
-    if { $rv != "" } {
-       verbose -log "$rv"
-       fail "$testcase (compile)"
+    if [ file exists "$srcdir/$subdir/$basename.exp" ] then {
+       source "$srcdir/$subdir/$basename.exp"
     } else {
-        if { $verbose } {
-           set redirect_output "./$base.log"
-        } else {
-           set redirect_output /dev/null
-        }
-        ws_spawn "$rootme/cygrun ./$base.exe > $redirect_output"
-        if { $rv != "" } {
-           verbose -log "$testcase: $rv"
-           fail "$testcase (execute)"
-            if { $xfail_expected } {
-               catch { file delete "$base.exe" } err
-                if { $err != "" } {
-                    note "error deleting $base.exe: $err"
-                }
-            }
+       ws_spawn "$CC -nodefaultlibs -mwin32 $CFLAGS $src $add_includes $add_libs $runtime_root/binmode.o -lgcc $runtime_root/libcygwin0.a -lkernel32 -luser32 -o $base.exe"
+       if { $rv != "" } {
+           verbose -log "$rv"
+           fail "$testcase (compile)"
        } else {
-           pass "$testcase"
-            if { ! $xfail_expected } {
-               catch { file delete "$base.exe" } err
-               if { $err != "" } {
-                    note "error deleting $base.exe: $err"
+           if { $verbose } {
+              set redirect_output "./$base.log"
+           } else {
+              set redirect_output /dev/null
+           }
+           ws_spawn "$rootme/cygrun ./$base.exe > $redirect_output"
+           if { $rv != "" } {
+               verbose -log "$testcase: $rv"
+               fail "$testcase (execute)"
+               if { $xfail_expected } {
+                   catch { file delete "$base.exe" } err
+                   if { $err != "" } {
+                       note "error deleting $base.exe: $err"
+                   }
+               }
+           } else {
+               pass "$testcase"
+               if { ! $xfail_expected } {
+                   catch { file delete "$base.exe" } err
+                   if { $err != "" } {
+                       note "error deleting $base.exe: $err"
+                   }
                }
            }
        }