/linux/advent2020/

blame commit diff stats
path: root/subx/test_layers
blob: ad5ab1a071664bcf8972954401ee4c17468cf4bc (plain) (tree)
1
2
3
4
5
6
7
8
9

                                                                            

                                               
 

      
               
                             
                 

               
                           
    
 
                                
       

                                                                                               


                              
                                
               
                                                                                                      
      
                               

                  
        
           
    
#!/bin/bash
# Repeatedly stop building until successive layers, and run all tests built.
#
# Assumes .subx files all come after .cc files.

set -e

cd `dirname $0`
# add C++ files one at a time
for f in [0-9]*cc
do
  echo "=== $f"
  ./build_and_test_until $f
done

# build everything one last time
./clean
CFLAGS=$CFLAGS ./build  # build optimized by default since we'll be running it repeatedly below

# add SubX files one at a time
for f in [0-9]*.subx
do
  [ $f == '049'* ]  &&  continue
  echo "=== $f"
  ./subx translate $(../enumerate/enumerate --until $f |grep '\.subx$') -o a.elf  &&  ./subx run a.elf
  echo
  test `uname` = 'Linux'  &&  {
    chmod +x a.elf
    ./a.elf
    echo
  } || true
done