Merged
Conversation
9d7aacc to
31d7196
Compare
legendecas
commented
Mar 18, 2025
| -arch \ | ||
| x86_64 \ | ||
| -L$(builddir) \ | ||
| -Lmylib |
31d7196 to
7200160
Compare
cclauss
reviewed
Mar 18, 2025
Contributor
|
Ruff fixes in |
d996e4b to
c485d48
Compare
Member
Author
|
CI failures are the ones in #287. |
c485d48 to
8544dec
Compare
Member
Author
|
CI is now green. |
cclauss
reviewed
Mar 20, 2025
8544dec to
dffe703
Compare
legendecas
commented
Mar 20, 2025
| actual_bytes = in_file.read() | ||
|
|
||
| try: | ||
| self.assertRegex(actual_bytes, expected_re) |
Member
Author
There was a problem hiding this comment.
Comparing assert re.search(expected_re, actual_bytes) and self.assertRegex(actual_bytes, expected_re), when there is a mismatch, self.assertRegex provides more information on the regex and the input:
E AssertionError: Regex didn't match: '\\#\\ This\\ file\\ is\\ generated\\ by\\ gyp;\\ do\\ not\\ edit\\.\\\n\\\nTOOLSET\\ :=\\ target\\\nTARGET\\ :=\\ test\\\nDEFS_Default\\ :=\\\n\\\n\\#\\ Flags\\ passed\\ to\\ all\\ source\\ files\\.\\\nCFLAGS_Default\\ :=\\ \\\\\\\n\\\t\\-fasm\\-blocks\\ \\\\\\\n\\\t\\-mpascal\\-strings\\ \\\\\\\n\\\t\\-Os\\ \\\\\\\n\\\t\\-gdwarf\\-2\\ \\\\\\\n\\\t\\-arch\\ \\\\\\\n\\\tx86_64\\\n\\\n\\\n\\#\\ Flags\\ passed\\ to\\ only\\ C\\ files\\.\\\nCFLAGS_C_Default\\ :=\\\n\\\n\\#\\ Flags\\ passed\\ to\\ only\\ C\\+\\+\\ files\\.\\\nCFLAGS_CC_Default\\ :=\\\n\\\n\\#\\ Flags\\ passed\\ to\\ only\\ ObjC\\ files\\.\\\nCFLAGS_OBJC_Default\\ :=\\\n\\\n\\#\\ Flags\\ passed\\ to\\ only\\ ObjC\\+\\+\\ files\\.\\\nCFLAGS_OBJCC_Default\\ :=\\\n\\\nINCS_Default\\ :=\\ \\\\\\\n\\\t\\-I\\$\\(srcdir\\)/include\\\n\\\nOBJS\\ :=\\ \\\\\\\n\\\t\\$\\(obj\\)\\.target/\\$\\(TARGET\\)/test\\.o\\\n\\\n\\#\\ Add\\ to\\ the\\ list\\ of\\ files\\ we\\ specially\\ track\\ dependencies\\ for\\.\\\nall_deps\\ \\+=\\ \\$\\(OBJS\\)\\\n\\\n\\#\\ CFLAGS\\ et\\ al\\ overrides\\ must\\ be\\ target\\-local\\.\\\n\\#\\ See\\ "Target\\-specific\\ Variable\\ Values"\\ in\\ the\\ GNU\\ Make\\ manual\\.\\\n\\$\\(OBJS\\):\\ TOOLSET\\ :=\\ \\$\\(TOOLSET\\)\\\n\\$\\(OBJS\\):\\ GYP_CFLAGS\\ :=\\ \\$\\(DEFS_\\$\\(BUILDTYPE\\)\\)\\ \\$\\(INCS_\\$\\(BUILDTYPE\\)\\)\\ \\ \\$\\(CFLAGS_\\$\\(BUILDTYPE\\)\\)\\ \\$\\(CFLAGS_C_\\$\\(BUILDTYPE\\)\\)\\\n\\$\\(OBJS\\):\\ GYP_CXXFLAGS\\ :=\\ \\$\\(DEFS_\\$\\(BUILDTYPE\\)\\)\\ \\$\\(INCS_\\$\\(BUILDTYPE\\)\\)\\ \\ \\$\\(CFLAGS_\\$\\(BUILDTYPE\\)\\)\\ \\$\\(CFLAGS_CC_\\$\\(BUILDTYPE\\)\\)\\\n\\$\\(OBJS\\):\\ GYP_OBJCFLAGS\\ :=\\ \\$\\(DEFS_\\$\\(BUILDTYPE\\)\\)\\ \\$\\(INCS_\\$\\(BUILDTYPE\\)\\)\\ \\ \\$\\(CFLAGS_\\$\\(BUILDTYPE\\)\\)\\ \\$\\(CFLAGS_C_\\$\\(BUILDTYPE\\)\\)\\ \\$\\(CFLAGS_OBJC_\\$\\(BUILDTYPE\\)\\)\\\n\\$\\(OBJS\\):\\ GYP_OBJCXXFLAGS\\ :=\\ \\$\\(DEFS_\\$\\(BUILDTYPE\\)\\)\\ \\$\\(INCS_\\$\\(BUILDTYPE\\)\\)\\ \\ \\$\\(CFLAGS_\\$\\(BUILDTYPE\\)\\)\\ \\$\\(CFLAGS_CC_\\$\\(BUILDTYPE\\)\\)\\ \\$\\(CFLAGS_OBJCC_\\$\\(BUILDTYPE\\)\\)\\\n\\\n\\#\\ Suffix\\ rules,\\ putting\\ all\\ outputs\\ into\\ \\$\\(obj\\)\\.\\\n\\\n\\$\\(obj\\)\\.\\$\\(TOOLSET\\)/\\$\\(TARGET\\)/%\\.o:\\ \\$\\(srcdir\\)/%\\.cc\\ FORCE_DO_CMD\\\n\\\t@\\$\\(call\\ do_cmd,cxx,1\\)\\\n\\\n\\#\\ Try\\ building\\ from\\ generated\\ source,\\ too\\.\\\n\\\n\\$\\(obj\\)\\.\\$\\(TOOLSET\\)/\\$\\(TARGET\\)/%\\.o:\\ \\$\\(obj\\)\\.\\$\\(TOOLSET\\)/%\\.cc\\ FORCE_DO_CMD\\\n\\\t@\\$\\(call\\ do_cmd,cxx,1\\)\\\n\\\n\\$\\(obj\\)\\.\\$\\(TOOLSET\\)/\\$\\(TARGET\\)/%\\.o:\\ \\$\\(obj\\)/%\\.cc\\ FORCE_DO_CMD\\\n\\\t@\\$\\(call\\ do_cmd,cxx,1\\)\\\n\\\n\\#\\ End\\ of\\ this\\ set\\ of\\ suffix\\ rules\\\n\\#\\#\\#\\ Rules\\ for\\ final\\ target\\.\\\nLDFLAGS_Default\\ :=\\ \\\\\\\n\\\t\\-arch\\ \\\\\\\n\\\tx86_64\\ \\\\\\\n\\\t\\-L\\$\\(builddir\\)\\ \\\\\\\n\\\t\\-Lmylib\\\n\\\nLIBTOOLFLAGS_Default\\ :=\\\n\\\nLIBS\\ :=\\\n\\\n\\$\\(builddir\\)/test:\\ GYP_LDFLAGS\\ :=\\ \\$\\(LDFLAGS_\\$\\(BUILDTYPE\\)\\)\\\n\\$\\(builddir\\)/test:\\ LIBS\\ :=\\ \\$\\(LIBS\\)\\\n\\$\\(builddir\\)/test:\\ GYP_LIBTOOLFLAGS\\ :=\\ \\$\\(LIBTOOLFLAGS_\\$\\(BUILDTYPE\\)\\)\\\n\\$\\(builddir\\)/test:\\ LD_INPUTS\\ :=\\ \\$\\(OBJS\\)\\\n\\$\\(builddir\\)/test:\\ TOOLSET\\ :=\\ \\$\\(TOOLSET\\)\\\n\\$\\(builddir\\)/test:\\ \\$\\(OBJS\\)\\ FORCE_DO_CMD\\\n\\\t\\$\\(call\\ do_cmd,link\\)\\\n\\\nall_deps\\ \\+=\\ \\$\\(builddir\\)/test\\\n\\#\\ Add\\ target\\ alias\\\n\\.PHONY:\\ test\\\ntest:\\ \\$\\(builddir\\)/test\\\n\\\n\\#\\ Add\\ executable\\ to\\ "all"\\ target\\.\\\n\\.PHONY:\\ all\\\nall:\\ \\$\\(builddir\\)/test\\\n\\\n' not found in '# This file is generated by gyp; do not edit.\n\nTOOLSET := target\nTARGET := test\nDEFS_Default :=\n\n# Flags passed to all source files.\nCFLAGS_Default := \\\n\t-fasm-blocks \\\n\t-mpascal-strings \\\n\t-Os \\\n\t-gdwarf-2 \\\n\t-arch \\\n\tx86_64\n\n# Flags passed to only C files.\nCFLAGS_C_Default :=\n\n# Flags passed to only C++ files.\nCFLAGS_CC_Default :=\n\n# Flags passed to only ObjC files.\nCFLAGS_OBJC_Default :=\n\n# Flags passed to only ObjC++ files.\nCFLAGS_OBJCC_Default :=\n\nINCS_Default := \\\n\t-I$(srcdir)/include\n\nOBJS := \\\n\t$(obj).target/$(TARGET)/test.o\n\n# Add to the list of files we specially track dependencies for.\nall_deps += $(OBJS)\n\n# CFLAGS et al overrides must be target-local.\n# See "Target-specific Variable Values" in the GNU Make manual.\n$(OBJS): TOOLSET := $(TOOLSET)\n$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))\n$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))\n$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))\n$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))\n\n# Suffix rules, putting all outputs into $(obj).\n\n$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD\n\t@$(call do_cmd,cxx,1)\n\n# Try building from generated source, too.\n\n$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD\n\t@$(call do_cmd,cxx,1)\n\n$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD\n\t@$(call do_cmd,cxx,1)\n\n# End of this set of suffix rules\n### Rules for final target.\nLDFLAGS_Default := \\\n\t-arch \\\n\tx86_64 \\\n\t-L$(builddir) \\\n\t-Lmylib\n\nLIBTOOLFLAGS_Default :=\n\nLIBS :=\n\n$(builddir)/test: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))\n$(builddir)/test: LIBS := $(LIBS)\n$(builddir)/test: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))\n$(builddir)/test: LD_INPUTS := $(OBJS)\n$(builddir)/test: TOOLSET := $(TOOLSET)\n$(builddir)/test: $(OBJS) FORCE_DO_CMD\n\t$(call do_cmd,link)\n\nall_deps += $(builddir)/test\n# Add target alias\n.PHONY: test\ntest: $(builddir)/test\n\n# Add executable to "all" target.\n.PHONY: all\nall: $(builddir)/test\n\n'
On the other hand, assert re.search does not print all the inputs
E assert None
E + where None = <function search at 0x104bf31a0>(re.compile('\\#\\ This\\ file\\ is\\ generated\\ by\\ gyp;\\ do\\ not\\ edit\\.\\\n\\\nTOOLSET\\ :=\\ target\\\nTARGET\\ :=\\ test\\\nDEFS_Default\\ :=\\\n\\\n\\#\\ Flags\\ passed\\ to\\ all\\ source\\ files\\.\), '# This file is generated by gyp; do not edit.\n\nTOOLSET := target\nTARGET := test\nDEFS_Default :=\n\n# Flags passed to all source files.\nCFLAGS_Default := \\\n\t-fasm-blocks \\\n\t-mpascal-strings \\\n\t-Os \\\n\t-gdwarf-2 \\\n\t-arch \\\n\tx86_64\n\n# Flags passed to only C files.\nCFLAGS_C_Default :=\n\n# Flags passed to only C++ files.\nCFLAGS_CC_Default :=\n\n# Flags passed to only ObjC files.\nCFLAGS_OBJC_Default :=\n\n# Flags passed to only ObjC++ files.\nCFLAGS_OBJCC_Default :=\n\nINCS_Default := \\\n\t-I$(srcdir)/include\n\nOBJS := \\\n\t$(obj).target/$(TARGET)/test.o\n\n# Add to the list of files we specially track dependencies for.\nall_deps += $(OBJS)\n\n# CFLAGS et al overrides must be target-local.\n# See "Target-specific Variable Values" in the GNU Make manual.\n$(OBJS): TOOLSET := $(TOOLSET)\n$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))\n$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))\n$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))\n$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))\n\n# Suffix rules, putting all outputs into $(obj).\n\n$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD\n\t@$(call do_cmd,cxx,1)\n\n# Try building from generated source, too.\n\n$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD\n\t@$(call do_cmd,cxx,1)\n\n$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD\n\t@$(call do_cmd,cxx,1)\n\n# End of this set of suffix rules\n### Rules for final target.\nLDFLAGS_Default := \\\n\t-arch \\\n\tx86_64 \\\n\t-L$(builddir) \\\n\t-Lmylib\n\nLIBTOOLFLAGS_Default :=\n\nLIBS :=\n\n$(builddir)/test: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))\n$(builddir)/test: LIBS := $(LIBS)\n$(builddir)/test: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))\n$(builddir)/test: LD_INPUTS := $(OBJS)\n$(builddir)/test: TOOLSET := $(TOOLSET)\n$(builddir)/test: $(OBJS) FORCE_DO_CMD\n\t$(call do_cmd,link)\n\nall_deps += $(builddir)/test\n# Add target alias\n.PHONY: test\ntest: $(builddir)/test\n\n# Add executable to "all" target.\n.PHONY: all\nall: $(builddir)/test\n\n')
E + where <function search at 0x104bf31a0> = re.search
Contributor
There was a problem hiding this comment.
Are you running the tests with pytest (which does assertion rewriting) or with unittest?
Member
Author
There was a problem hiding this comment.
I'm running with pytest -vv.
Contributor
There was a problem hiding this comment.
OK. The rewriting might be limited inside a unittest.TestCase. Thanks for the nice work on this one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test the generator with a minimal gyp file.