#!/bin/sh

full_log=full.log
temp_log=tmplog.log
lastboot=mylastboot

rm -f $full_log

for fake in \
    "intel" \
    "intel_amd" \
    "intel_nvidia" \
    "amd" \
    "amd_amd" \
    "multi_amd" \
    "amd_nvidia"; do

    # First time
    echo "\n========================================" >> $full_log
    echo "* Running tests with $fake as FIRST TIME" >> $full_log
    echo "========================================" >> $full_log
    ./amd-xconfig --test $fake --laptop --log $temp_log --last-boot $lastboot && rm -f $lastboot && cat $temp_log >> $full_log
    ./amd-xconfig --test $fake --laptop --no-fglrx --log $temp_log --last-boot $lastboot && rm -f $lastboot && cat $temp_log >> $full_log
    ./amd-xconfig --test $fake --log $temp_log --last-boot $lastboot && rm -f $lastboot && cat $temp_log >> $full_log
    ./amd-xconfig --test $fake --no-fglrx --log $temp_log --last-boot $lastboot && rm -f $lastboot && cat $temp_log >> $full_log

    # Change
    echo "\n=====================================" >> $full_log
    echo "* Running tests with $fake as CHANGED" >> $full_log
    echo "=====================================" >> $full_log
    echo 10 > $lastboot
    ./amd-xconfig --test $fake --laptop --log $temp_log --last-boot $lastboot && cat $temp_log >> $full_log
    echo 10 > $lastboot
    ./amd-xconfig --test $fake --laptop --no-fglrx --log $temp_log --last-boot $lastboot && cat $temp_log >> $full_log
    echo 10 > $lastboot
    ./amd-xconfig --test $fake --log $temp_log --last-boot $lastboot && cat $temp_log >> $full_log
    echo 10 > $lastboot
    ./amd-xconfig --test $fake --no-fglrx --log $temp_log --last-boot $lastboot && cat $temp_log >> $full_log
done
