Index: Makefile
==================================================================
--- Makefile
+++ Makefile
@@ -21,21 +21,21 @@
PREFIX=$(PWD)
CSCOPTS=
INSTALL=install
SRCFILES = common.scm items.scm launch.scm ods.scm runconfig.scm \
server.scm configf.scm db.scm keys.scm margs.scm \
- megatest-version.scm process.scm runs.scm tasks.scm \
- tests.scm genexample.scm http-transport.scm filedb.scm \
- tdb.scm client.scm mt.scm ezsteps.scm lock-queue.scm \
- sdb.scm rmt.scm api.scm subrun.scm portlogger.scm \
- archive.scm env.scm diff-report.scm \
- cgisetup/models/pgdb.scm
+ process.scm runs.scm tasks.scm tests.scm genexample.scm \
+ http-transport.scm filedb.scm tdb.scm client.scm mt.scm \
+ ezsteps.scm lock-queue.scm sdb.scm rmt.scm api.scm \
+ subrun.scm portlogger.scm archive.scm env.scm \
+ diff-report.scm cgisetup/models/pgdb.scm
# module source files
# ftail.scm rmtmod.scm commonmod.scm removed
MSRCFILES = ducttape-lib.scm pkts.scm stml2.scm cookie.scm mutils.scm \
- mtargs.scm commonmod.scm dbmod.scm adjutant.scm
+ mtargs.scm commonmod.scm dbmod.scm adjutant.scm ulex.scm \
+ rmtmod.scm apimod.scm
GUISRCF = dashboard-context-menu.scm dashboard-tests.scm \
dashboard-guimonitor.scm gutils.scm dcommon.scm tree.scm \
vg.scm
@@ -47,13 +47,15 @@
MOIMPFILES = $(MSRCFILES:%.scm=%.import.o)
%.import.o : %.import.scm
csc $(CSCOPTS) -unit $*.import -c $*.import.scm -o $*.import.o
-mofiles/%.o %.import.scm : %.scm
+# I'm not sure the cp is a good idea, changed a lot of things and it may not have been necessary...
+mofiles/%.o %.import.scm : %.scm megatest-fossil-hash.scm
@[ -e mofiles ] || mkdir -p mofiles
- csc $(CSCOPTS) -I $* -J -c $< -o mofiles/$*.o
+ csc $(CSCOPTS) -I mofiles -I $* -J -c $< -o $*.o
+ cp $*.o mofiles/$*.o
@touch $*.import.scm # ensure it is touched after the .o is made
ADTLSCR=mt_laststep mt_runstep mt_ezstep
HELPERS=$(addprefix $(PREFIX)/bin/,$(ADTLSCR))
DEPLOYHELPERS=$(addprefix deploytarg/,$(ADTLSCR))
@@ -73,17 +75,14 @@
csc $(CSCOPTS) $(OFILES) $(MOFILES) $(MOIMPFILES) megatest.o -o mtest
showmtesthash:
@echo $(MTESTHASH)
-dboard : $(OFILES) $(GOFILES) dashboard.scm $(MOFILES) $(MOIMPFILES)
+dboard : $(OFILES) $(GOFILES) dashboard.scm $(MOFILES) $(MOIMPFILES) megatest-version.scm megatest-fossil-hash.scm
csc $(CSCOPTS) $(OFILES) dashboard.scm $(GOFILES) $(MOFILES) $(MOIMPFILES) -o dboard
-ndboard : newdashboard.scm $(OFILES) $(GOFILES)
- csc $(CSCOPTS) $(OFILES) $(GOFILES) newdashboard.scm -o ndboard
-
-mtut: $(OFILES) $(MOFILES) megatest-fossil-hash.scm mtut.scm
+mtut: $(OFILES) $(MOFILES) megatest-fossil-hash.scm mtut.scm megatest-version.scm
csc $(CSCOPTS) $(OFILES) $(MOFILES) mtut.scm -o mtut
include makefile.inc
TCMTOBJS = \
@@ -100,17 +99,14 @@
keys.o \
launch.o \
lock-queue.o \
margs.o \
mt.o \
- megatest-version.o \
ods.o \
portlogger.o \
process.o \
rmt.o \
- mofiles/rmtmod.o \
- rpc-transport.o \
runconfig.o \
runs.o \
server.o \
tasks.o \
tdb.o \
@@ -118,11 +114,11 @@
subrun.o \
ezsteps.o
# mofiles/commonmod.o \
-tcmt : $(TCMTOBJS) tcmt.scm
+tcmt : $(TCMTOBJS) tcmt.scm megatest-version.scm
csc $(CSCOPTS) $(TCMTOBJS) $(MOFILES) $(MOIMPFILES) tcmt.scm -o tcmt
# install documentation to $(PREFIX)/docs
# DOES NOT REBUILD DOCS
#
@@ -139,25 +135,29 @@
$(PREFIX)/share/db/mt-pg.sql : mt-pg.sql
mkdir -p $(PREFIX)/share/db
$(INSTALL) mt-pg.sql $(PREFIX)/share/db/mt-pg.sql
# Special dependencies for the includes
-common.o : mofiles/commonmod.o
+$(MOFILE) $(MOIMPFILES) : megatest-fossil-hash.scm
+
+common.o : mofiles/commonmod.o megatest-fossil-hash.scm
+
+commonmod.o dashboard.o megatest.o tcmt.o apimod.o : megatest-fossil-hash.scm
tests.o db.o launch.o runs.o dashboard-tests.o \
dashboard-context-menu.o dashboard-guimonitor.o dashboard-main.o \
-monitor.o dashboard.o archive.o megatest.o : db_records.scm
+monitor.o dashboard.o archive.o megatest.o : db_records.scm megatest-fossil-hash.scm
tests.o runs.o dashboard.o dashboard-tests.o dashboard-context-menu.o dashboard-main.o : run_records.scm
db.o ezsteps.o keys.o launch.o megatest.o monitor.o runs-for-ref.o runs.o tests.o : key_records.scm
tests.o tasks.o dashboard-tasks.o : task_records.scm
runs.o : test_records.scm
-megatest.o : megatest-fossil-hash.scm
+megatest.o : megatest-fossil-hash.scm megatest-version.scm
rmt.scm client.scm common.scm configf.scm dashboard-guimonitor.scm dashboard-tests.scm dashboard.scm db.scm dcommon.scm ezsteps.scm fs-transport.scm http-transport.scm index-tree.scm items.scm keys.scm launch.scm megatest.scm monitor.scm mt.scm newdashboard.scm runconfig.scm runs.scm server.scm tdb.scm tests.scm tree.scm : common_records.scm
common_records.scm : altdb.scm
@@ -173,30 +173,32 @@
# special include based modules
mofiles/pkts.o : pkts/pkts.scm
mofiles/stml2.o : cookie.o
# mofiles/mtargs.o : mtargs/mtargs.scm
# mofiles/mtconfigf.o : mtconfigf/mtconfigf.scm
-# mofiles/ulex.o : ulex/ulex.scm
+mofiles/ulex.o : ulex/ulex.scm
mofiles/mutils.o : mutils/mutils.scm
mofiles/cookie.o : stml2/cookie.scm
mofiles/stml2.o : stml2/stml2.scm
# for the modularized stuff
rmt.o : mofiles/ducttape-lib.o mofiles/pkts.o mofiles/stml2.o mofiles/mutils.o mofiles/mtargs.o
-megatest-fossil-hash.scm : $(SRCFILES) megatest.scm *_records.scm
- echo "(define megatest-fossil-hash \"$(MTESTHASH)\")" > megatest-fossil-hash.new
- if ! diff -q megatest-fossil-hash.new megatest-fossil-hash.scm ; then echo copying .new to .scm;cp -f megatest-fossil-hash.new megatest-fossil-hash.scm;fi
+mofiles/rmtmod.o : mofiles/apimod.o mofiles/ulex.o
+
+megatest-fossil-hash.scm : .fslckout
+ @echo "(define megatest-fossil-hash \"$(MTESTHASH)\")" > megatest-fossil-hash.new
+ @if [[ ! -e megatest-fossil-hash.scm ]] || ! diff -q megatest-fossil-hash.new megatest-fossil-hash.scm ; then echo copying .new to .scm;cp -f megatest-fossil-hash.new megatest-fossil-hash.scm;fi
$(OFILES) $(GOFILES) : common_records.scm
# This having the full list of MOFILES cause everything to be rebuilt every time.
#
# %.o : %.scm $(MOFILES)
# csc $(CSCOPTS) -c $< $(MOFILES)
#
-%.o : %.scm
+%.o : %.scm megatest-fossil-hash.scm
csc $(CSCOPTS) -c $<
# specific rules for .o files that genuninely depend on mofiles/something
#
megatest.o : megatest.scm stml2.o mutils.o commonmod.o
@@ -209,27 +211,22 @@
csc $(CSCOPTS) -c common.scm mofiles/commonmod.o
configf.o : configf.scm mofiles/commonmod.o
csc $(CSCOPTS) -c configf.scm mofiles/commonmod.o
+$(PREFIX)/bin/.$(ARCHSTR)/bin/mtest : mtest
+
+$(PREFIX)/bin/megatest : $(PREFIX)/bin/.$(ARCHSTR)/bin/mtest utils/mk_wrapper
+
$(PREFIX)/bin/.$(ARCHSTR)/bin/mtest : mtest
@echo Installing to PREFIX=$(PREFIX)
$(INSTALL) mtest $(PREFIX)/bin/.$(ARCHSTR)/bin/mtest
$(PREFIX)/bin/megatest : $(PREFIX)/bin/.$(ARCHSTR)/bin/mtest utils/mk_wrapper
utils/mk_wrapper $(PREFIX) mtest $(PREFIX)/bin/megatest
chmod a+x $(PREFIX)/bin/megatest
-$(PREFIX)/bin/.$(ARCHSTR)/bin/ndboard : ndboard
- $(INSTALL) ndboard $(PREFIX)/bin/.$(ARCHSTR)/bin/ndboard
-
-$(PREFIX)/bin/newdashboard : $(PREFIX)/bin/.$(ARCHSTR)/ndboard utils/mk_wrapper
- utils/mk_wrapper $(PREFIX) ndboard $(PREFIX)/bin/newdashboard
- chmod a+x $(PREFIX)/bin/newdashboard
-
-# mtutil
-
$(PREFIX)/bin/.$(ARCHSTR)/bin/mtut : mtut
$(INSTALL) mtut $(PREFIX)/bin/.$(ARCHSTR)/bin/mtut
install-mtut : mtut
$(INSTALL) mtut $(PREFIX)/bin/mtut
@@ -349,13 +346,13 @@
fossil clone https://www.kiatoa.com/fossils/megatest_qa $(MTQA_FOSSIL)
clean :
rm -f $(OFILES) $(GOFILES) $(MOFILES) $(TCMTOBJS) \
$(PREFIX)/megatest $(PREFIX)/dashboard mtest mtutil mtut \
- tcmt readline-fix.scm serialize-env dboard dboard.o \
- megatest.o dashboard.o megatest-fossil-hash.* altdb.scm \
- mofiles/*.o vg.o cookie.o dashboard-main.o \
+ tcmt readline-fix.scm serialize-env dboard *.o \
+ megatest-fossil-hash.* altdb.scm mofiles/*.o \
+ mofiles/*.o vg.o cookie.o dashboard-main.o \
ducttape-lib.o ftail.o mutils.o pkts.o rmtmod.o stml2.o \
tcmt.o
rm -rf share
#======================================================================
@@ -398,19 +395,19 @@
mkdir -p /tmp/$(USER)/datashare/disk1 /tmp/$(USER)/basepath
xterm : sd
(export BASEPATH=/tmp/$(USER)/basepath ; export PATH="$(PWD)/datashare-testing:$(PATH)" ; xterm &)
-datashare-testing/spublish : spublish.scm $(OFILES)
- csc $(CSCOPTS) spublish.scm megatest-version.o margs.o process.o common.o -o datashare-testing/spublish
+datashare-testing/spublish : spublish.scm $(OFILES) megatest-version.scm
+ csc $(CSCOPTS) spublish.scm margs.o process.o common.o -o datashare-testing/spublish
-datashare-testing/sretrieve : sretrieve.scm $(OFILES)
- csc $(CSCOPTS) sretrieve.scm megatest-version.o margs.o process.o common.o -o datashare-testing/sretrieve
+datashare-testing/sretrieve : sretrieve.scm $(OFILES) megatest-version.scm
+ csc $(CSCOPTS) sretrieve.scm margs.o process.o common.o -o datashare-testing/sretrieve
-datashare-testing/sauthorize : sauthorize.scm $(OFILES)
- csc $(CSCOPTS) sauthorize.scm megatest-version.o margs.o process.o common.o -o datashare-testing/sauthorize
+datashare-testing/sauthorize : sauthorize.scm $(OFILES) megatest-version.scm
+ csc $(CSCOPTS) sauthorize.scm margs.o process.o common.o -o datashare-testing/sauthorize
sauth-init:
mkdir -p datashare-testing
rm datashare-testing/sauthorize
rm datashare-testing/sretrieve
@@ -445,10 +442,30 @@
@grep : Makefile | perl -ne '/^([A-Za-z0-9_-]+):/ && print "$$1\n"'
unit :
cd tests;make unit
+
+ALLSCMFILES=$(shell ls *scm|grep -v import)
+ALLREINDENT=$(addprefix reindent/,$(ALLSCMFILES))
+
+indentreport : reindentall
+ @for x in $(ALLSCMFILES);do if ! diff -q $$x reindent/$$x > /dev/null;then echo "FAIL $$x";fi;done
+
+reindentall : $(ALLREINDENT)
+ echo "ENSURE YOU HAVE THE LINES FROM emacs.config IN YOUR ~/.emacs FILE!"
+
+reindent/README :
+ mkdir -p reindent
+ echo "Indent modified files are put here." > reindent/README
+
+reindent/%.scm : %.scm reindent/README
+ cp $< reindent
+ cd reindent;emacs -batch $< --eval '(load "$(PWD)/reindent.el")' -f save-buffer
+
+# cd reindent;emacs -batch $< --eval '(indent-region (point-min) (point-max) nil)' -f save-buffer
+
#======================================================================
# Attic
#======================================================================
Index: adjutant.scm
==================================================================
--- adjutant.scm
+++ adjutant.scm
@@ -18,13 +18,12 @@
;;======================================================================
(declare (unit adjutant))
-(module adjutant
- *
-
+(module adjutant *
+
(import scheme chicken data-structures extras files)
(import (prefix sqlite3 sqlite3:) posix typed-records srfi-18 srfi-69
md5 message-digest
regex srfi-1)
Index: api.scm
==================================================================
--- api.scm
+++ api.scm
@@ -81,11 +81,11 @@
tasks-get-last
testmeta-get-record
have-incompletes?
;; synchash-get
get-changed-record-ids
- get-run-record-ids
+ get-run-record-ids
get-not-completed-cnt))
(define api:write-queries
'(
get-keys-write ;; dummy "write" query to force server start
@@ -99,11 +99,11 @@
delete-test-records
delete-old-deleted-test-records
test-set-state-status
test-set-top-process-pid
set-state-status-and-roll-up-items
-
+
update-pass-fail-counts
top-test-set-per-pf-counts ;; (db:top-test-set-per-pf-counts (db:get-db *db* 5) 5 "runfirst")
;; RUNS
register-run
@@ -243,11 +243,11 @@
;; NO SYNC DB
((no-sync-set) (apply db:no-sync-set *no-sync-db* params))
((no-sync-get/default) (apply db:no-sync-get/default *no-sync-db* params))
((no-sync-del!) (apply db:no-sync-del! *no-sync-db* params))
((no-sync-get-lock) (apply db:no-sync-get-lock *no-sync-db* params))
-
+
;; ARCHIVES
;; ((archive-get-allocations)
((archive-register-disk) (apply db:archive-register-disk dbstruct params))
((archive-register-block-name)(apply db:archive-register-block-name dbstruct params))
;; ((archive-allocate-testsuite/area-to-block)(apply db:archive-allocate-testsuite/area-to-block dbstruct block-id testsuite-name areakey))
ADDED apimod.scm
Index: apimod.scm
==================================================================
--- /dev/null
+++ apimod.scm
@@ -0,0 +1,37 @@
+;;======================================================================
+;; Copyright 2017, Matthew Welland.
+;;
+;; This file is part of Megatest.
+;;
+;; Megatest is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; Megatest is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with Megatest. If not, see