Testing internal-combustion engines by monitoring exhaust gases {or combustion flame by monitoring exhaust gases}