Skip to content

Commit

Permalink
Revert part of [269ce15793561e10]: Backport fix for [080a28104e] and …
Browse files Browse the repository at this point in the history
…add TK_NO_STDERR processing, but not the solution itself.

Github testcases are already broken for 2 weaks, it appears focus-1.12 and focus-1.19 are negatively affected by this
  • Loading branch information
jan.nijtmans committed Feb 14, 2025
1 parent b3b3092 commit f7c0857
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 82 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/mac-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
}
- name: Run Tests
run: |
make TK_NO_STDERR=1 test | tee out.txt
make test | tee out.txt
nmatches=$( grep -c "Failed 0" out.txt )
if [ $nmatches -lt 4 ]
then
Expand Down Expand Up @@ -144,7 +144,6 @@ jobs:
else
function runXvfb {
echo Xvfb not used, this is a --enable-aqua build
export TK_NO_STDERR=1
}
fi
( runXvfb :0; make test-classic; exit $? ) | tee out-classic.txt || {
Expand Down
50 changes: 1 addition & 49 deletions macosx/tkMacOSXDialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,41 +87,6 @@ static filepanelFilterInfo filterInfo;
static NSOpenPanel *openpanel;
static NSSavePanel *savepanel;

/*
* A thread which closes the currently running modal dialog after a timeout.
*/

@interface TKPanelMonitor: NSThread {
@private
NSTimeInterval _timeout;
}

- (id) initWithTimeout: (NSTimeInterval) timeout;

@end

@implementation TKPanelMonitor: NSThread

- (id) initWithTimeout: (NSTimeInterval) timeout {
self = [super init];
if (self) {
_timeout = timeout;
return self;
}
return self;
}

- (void) main
{
[NSThread sleepForTimeInterval:_timeout];
if ([self isCancelled]) {
[NSThread exit];
}
[NSApp stopModalWithCode:modalCancel];
}
@end


static const char *const colorOptionStrings[] = {
"-initialcolor", "-parent", "-title", NULL
};
Expand Down Expand Up @@ -903,20 +868,7 @@ Tk_GetOpenFileObjCmd(
parent = nil;
parentIsKey = False;
}
TKPanelMonitor *monitor;
if (testsAreRunning) {
/*
* We need the panel to close by itself when running tests.
*/

monitor = [[TKPanelMonitor alloc] initWithTimeout: 1.0];
[monitor start];
}
modalReturnCode = showOpenSavePanel(openpanel, parent, interp, cmdObj,
multiple);
if (testsAreRunning) {
[monitor cancel];
}
modalReturnCode = showOpenSavePanel(openpanel, parent, interp, cmdObj, multiple);
if (cmdObj) {
Tcl_DecrRefCount(cmdObj);
}
Expand Down
9 changes: 0 additions & 9 deletions macosx/tkMacOSXInit.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@
#include <sys/stat.h>
#include <sys/utsname.h>

/*
* This flag is set if tests are being run.
*/

int testsAreRunning = 0;

static char tkLibPath[PATH_MAX + 1] = "";

/*
Expand Down Expand Up @@ -600,9 +594,6 @@ TkpInit(
#if defined(USE_CUSTOM_EXIT_PROC)
doCleanupFromExit = YES;
#endif
} else if (getenv("TK_NO_STDERR") != NULL) {
FILE *null = fopen("/dev/null", "w");
dup2(fileno(null), STDERR_FILENO);
}

/*
Expand Down
6 changes: 0 additions & 6 deletions macosx/tkMacOSXPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@
STRINGIFY(symbol)); \
}

/*
* This is set to 1 if tests are being run. Defined in tkMacOSXInit.c.
*/

extern int testsAreRunning;

/*
* The structure of a 32-bit XEvent keycode on macOS. It may be viewed as
* an unsigned int or as having either two or three bitfields.
Expand Down
7 changes: 1 addition & 6 deletions macosx/tkMacOSXTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "tkMacOSXConstants.h"
#include "tkMacOSXWm.h"


/*
* Forward declarations of procedures defined later in this file:
*/
Expand Down Expand Up @@ -50,12 +51,6 @@ int
TkplatformtestInit(
Tcl_Interp *interp) /* Interpreter to add commands to. */
{
/*
* Set a flag indicating that testing is in progress.
*/

testsAreRunning = 1;

/*
* Add commands for platform specific tests on MacOS here.
*/
Expand Down
10 changes: 0 additions & 10 deletions tests/filebox.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ test fileDialog-0.2 {GetFileName: file types: MakeFilter() fails} {
regsub -all "\0" $msg {\\0} msg
list $x $msg
} {1 {bad Macintosh file type "\0\0"}}
test fileDialog-0.3 {GetFileName: file types: bad filetype} \
-constraints {[tk windowingsystem] eq "aqua"} \
-body {
# Check for the Aqua crash reported in ticket 080a28104.

set filename [tk_getOpenFile -filetypes {
{"Invalid extension" {x.y}}
{"All files" {*}}
}]
} -result {}

set tk_strictMotif_old $tk_strictMotif

Expand Down

0 comments on commit f7c0857

Please sign in to comment.