about summary refs log tree commit diff stats
path: root/mu
blob: 71827c49e309119f0d02dca56d8292c0bb952f6d (plain) (blame)
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
#!/bin/bash
#
# Compile mu if necessary before running it.

# show make output only if something needs doing
make -q || make >&2 || exit 1

# Little bit of cleverness: If I'm setting flags at the commandline I'm often
# disabling optimizations. In that case don't run all tests if I load any app
# files.
# Might be too clever..
if [[ $CFLAGS && $# -gt 0 && $1 != '--help' ]]  # latter two conditions are to continue printing the help message
then
  ./mu_bin --test-only-app "$@"
  exit 1
fi

./mu_bin "$@"

# Scenarios considered:
#   mu
#   mu --help
#   mu test
#   mu test file1.mu
#   CFLAGS=-g mu test file1.mu  # run only tests in file1.mu