summary refs log tree commit diff stats
path: root/svc/leveldb.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-13 23:58:17 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-13 23:58:22 -0400
commitdf8fa27ffa596e02d0560aa9238f194911c03e56 (patch)
tree882ddbc7cfa6be1123a77fc84b01c124623707d4 /svc/leveldb.go
parentc4130e200d1282c1637c6f79332593026c87993d (diff)
downloadgetwtxt-df8fa27ffa596e02d0560aa9238f194911c03e56.tar.gz
on SIGINT, push to DB before shutting down
also logging elapsed time for DB pulls
Diffstat (limited to 'svc/leveldb.go')
0 files changed, 0 insertions, 0 deletions
t&id=bae9ef6366c6729b95155246476f948e4b98fc7b'>bae9ef63 ^
1fad5eef ^
dacf4030 ^
88663269 ^
1fad5eef ^

7cae95a9 ^
6d943605 ^
852936bf ^
6d943605 ^
01b2852b ^
6d943605 ^
88663269 ^
e45c1ce2 ^
5f128523 ^

56ce5577 ^



01b2852b ^
c8dd393c ^
793fcf5f ^

c8dd393c ^

56ce5577 ^
c8dd393c ^
75cbfa28 ^
88663269 ^
56ce5577 ^
01b2852b ^
75cbfa28 ^

88663269 ^
c2d49d81 ^

e53787f5 ^
4d1f4a66 ^


c2d49d81 ^
8abff870 ^
e53787f5 ^
201b2e6c ^
88663269 ^
6d943605 ^
01b2852b ^
5f128523 ^
fa3d7edc ^
7b8a2ff3 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

                   


                
                                           
                                                                                                
 

                                                                             
                                                  
                                                                                      
                                                     
 

                                                                         
 
                    
                            
 
              
                                          
 
                                                           

                          



                                                                                
                    
                                                                                           

                                                                                                     

                                                                                                                      
                                                                                                  
                         
                                                                                                       
 
                                    
                

                                                                                              
 

                                           
 


                                        
                                            
                                                                                      
 
            
      
                                  
                               
                                
                                       
                        
all: mu_bin core.mu

CXX ?= c++
CFLAGS ?= -g -O3

mu_bin: makefile mu.cc termbox/libtermbox.a
	${CXX} ${CFLAGS} -Wall -Wextra -fno-strict-aliasing mu.cc termbox/libtermbox.a -o mu_bin

# To see what the program looks like after all layers have been applied, read
# mu.cc
mu.cc: [0-9]*.cc enumerate/enumerate tangle/tangle
	./tangle/tangle $$(./enumerate/enumerate --until zzz |grep -v '.mu$$') > mu.cc
	make --no-print-directory autogenerated_lists

core.mu: [0-9]*.mu mu.cc
	cat $$(./enumerate/enumerate --until zzz |grep '.mu$$') > core.mu

enumerate/enumerate:
	cd enumerate && make

tangle/tangle:
	cd tangle && make && ./tangle test

termbox/libtermbox.a: termbox/*.c termbox/*.h termbox/*.inl
	cd termbox && make

# auto-generated files; by convention they end in '_list'.
autogenerated_lists: mu.cc function_list test_list

# autogenerated list of function declarations, so I can define them in any order
function_list: mu.cc
	@# functions start out unindented, have all args on the same line, and end in ') {'
	@#                                      ignore methods
	@grep -h "^[^[:space:]#].*) {$$" mu.cc |grep -v ":.*(" |perl -pwe 's/ {.*/;/' > function_list
	@# occasionally we need to modify a declaration in a later layer without messing with ugly unbalanced brackets
	@# assume such functions move the '{' to column 0 of the very next line
	@grep -v "^#line" mu.cc |grep -B1 "^{" |grep -v "^{" |perl -pwe 's/$$/;/' >> function_list
	@# test functions
	@grep -h "^\s*TEST(" mu.cc |perl -pwe 's/^\s*TEST\((.*)\)$$/void test_$$1();/' >> function_list

# autogenerated list of tests to run
test_list: mu.cc
	@grep -h "^\s*void test_" mu.cc |perl -pwe 's/^\s*void (.*)\(\) {.*/$$1,/' > test_list
	@grep -h "^\s*TEST(" mu.cc |perl -pwe 's/^\s*TEST\((.*)\)$$/test_$$1,/' >> test_list

#
.PHONY: all autogenerated_lists clean clena

test: autogenerated_lists mu_bin core.mu
	./mu_bin test

valgrind: autogenerated_lists mu_bin core.mu
	valgrind --leak-check=yes --num-callers=40 -q --error-exitcode=1 ./mu_bin test

clena: clean
clean:
	cd enumerate && make clean
	cd tangle && make clean
	cd termbox && make clean
	-rm mu.cc core.mu mu_bin *_list
	-rm -rf mu_bin.*