Skip to content

Commit

Permalink
tests work without modification on windows
Browse files Browse the repository at this point in the history
A little trouble with slashes and line endings
  • Loading branch information
markwal committed Jun 1, 2015
1 parent 4ac5380 commit 147ccd8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/defines/defines.mk
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ PLATFORM = win32
EXE = .exe
OBJ = .o
DEP = .d
PYTHON =
PYTHON = python

else

Expand Down Expand Up @@ -107,7 +107,7 @@ VPATH=./ $(SHAREDIR)
CD = cd
CHMOD = chmod
CP = cp
DIFF = diff
DIFF = diff -b
GZIP = gzip -9c
MKDIR = mkdir -p
RM = rm -f
Expand Down
16 changes: 8 additions & 8 deletions src/gpx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ test:: $(OBJDIR)/gpx$(EXE)
$(OBJDIR)/gpx$(EXE) -g -p -m r2x tests/lint.gcode $(OBJDIR)/lint-g.x3g > $(OBJDIR)/lint-g.log 2>&1
$(OBJDIR)/gpx$(EXE) -p -m r2x tests/issue13.gcode $(OBJDIR)/issue13.x3g > $(OBJDIR)/issue13.log 2>&1
$(OBJDIR)/gpx$(EXE) -g -p -m r2x tests/issue13.gcode $(OBJDIR)/issue13-g.x3g > $(OBJDIR)/issue13-g.log 2>&1
$(DIFF) tests/lint.x3g $(OBJDIR)/lint.x3g
$(DIFF) tests/lint.log $(OBJDIR)/lint.log
$(DIFF) tests/lint-g.x3g $(OBJDIR)/lint-g.x3g
$(DIFF) tests/lint-g.log $(OBJDIR)/lint-g.log
$(DIFF) tests/issue13.x3g $(OBJDIR)/issue13.x3g
$(DIFF) tests/issue13.log $(OBJDIR)/issue13.log
$(DIFF) tests/issue13-g.x3g $(OBJDIR)/issue13-g.x3g
$(DIFF) tests/issue13-g.log $(OBJDIR)/issue13-g.log
$(PYTHON) $(SRCDIR)/../scripts/s3g-decompiler.py $(OBJDIR)/lint.x3g > $(OBJDIR)/lint.txt 2>&1
$(PYTHON) $(SRCDIR)/../scripts/s3g-decompiler.py $(OBJDIR)/lint-g.x3g > $(OBJDIR)/lint-g.txt 2>&1
$(PYTHON) $(SRCDIR)/../scripts/s3g-decompiler.py $(OBJDIR)/issue13.x3g > $(OBJDIR)/issue13.txt 2>&1
Expand All @@ -47,6 +39,14 @@ test:: $(OBJDIR)/gpx$(EXE)
$(DIFF) tests/lint-g.txt $(OBJDIR)/lint-g.txt
$(DIFF) tests/issue13.txt $(OBJDIR)/issue13.txt
$(DIFF) tests/issue13-g.txt $(OBJDIR)/issue13-g.txt
$(DIFF) tests/lint.x3g $(OBJDIR)/lint.x3g
$(DIFF) tests/lint.log $(OBJDIR)/lint.log
$(DIFF) tests/lint-g.x3g $(OBJDIR)/lint-g.x3g
$(DIFF) tests/lint-g.log $(OBJDIR)/lint-g.log
$(DIFF) tests/issue13.x3g $(OBJDIR)/issue13.x3g
$(DIFF) tests/issue13.log $(OBJDIR)/issue13.log
$(DIFF) tests/issue13-g.x3g $(OBJDIR)/issue13-g.x3g
$(DIFF) tests/issue13-g.log $(OBJDIR)/issue13-g.log
-@$(RM) $(OBJDIR)/lint.x3g $(OBJDIR)/lint.txt $(OBJDIR)/lint.log
-@$(RM) $(OBJDIR)/lint-g.x3g $(OBJDIR)/lint-g.txt $(OBJDIR)/lint-g.log
-@$(RM) $(OBJDIR)/issue13.x3g $(OBJDIR)/issue13.txt $(OBJDIR)/issue13.log
Expand Down
13 changes: 13 additions & 0 deletions src/gpx/gpx-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ int main(int argc, char * const argv[])
char *eeprom = NULL;
double filament_diameter = 0;
char *buildname = "GPX " GPX_VERSION;
char *otherdelim = NULL;
char *filename;
int ini_loaded = 0;
speed_t baud_rate = B115200;
Expand Down Expand Up @@ -642,6 +643,13 @@ int main(int argc, char * const argv[])
}
// assign build name
buildname = strrchr(filename, PATH_DELIM);
#ifdef _WIN32
char *otherdelim = strrchr(filename, '/');
if (otherdelim > buildname)
{
buildname = otherdelim;
}
#endif
if(buildname) {
buildname++;
}
Expand All @@ -656,6 +664,11 @@ int main(int argc, char * const argv[])
filename = argv[0];
// prefer output filename over input for the buildname
char *s = strrchr(filename, PATH_DELIM);
#ifdef _WIN32
otherdelim = strrchr(filename, '/');
if (otherdelim > s)
s = otherdelim;
#endif
s = strdup(s ? s+1 : filename);
if (s)
buildname = s;
Expand Down

0 comments on commit 147ccd8

Please sign in to comment.