<commit_before>const app = require('../app');
const expect = require('chai').expect

const version = process.env.QB_VERSION;

describe('run docker with version', function () {
    it('should have benchmark results', async () => {
	var request = {
	    compiler: version,
	    optim: 3,
	    cppVersion: 17,
	    isAnnotated: "true",
	    force: "true"
	};
	expect(version).to.be.ok;
	const done = await app.execute('system-test/testfile/test', request);
	const parsed = JSON.parse(done.res);
	expect(parsed.benchmarks).to.have.length(2);
	//	expect(done.stdout).to.be.empty; // Removed because of a Docker message on my Ubuntu version.
	console.log(done.stdout);
	expect(done.annotation).to.be.ok;
    }).timeout(120000);
})

describe('check compiler version inside docker', function() {
    it('should have the same version', async () => {
        const exec = require('child_process').exec;
        let options = {
            timeout: 60000,
            killSignal: 'SIGKILL'
        };
        console.log(`${__dirname}/testfile/version.cpp`);
        const result = await new Promise(resolve => exec(`docker run --rm -v ${__dirname}/testfile/version.cpp:/home/builder/bench-file.cpp -t fredtingaud/quick-bench:${version} /bin/bash -c "./build && ./run"`, options, (error, stdout, stderr) => {<commit_msg>Add a test on the content of the assembly<commit_after>const app = require('../app');
const expect = require('chai').expect

const version = process.env.QB_VERSION;

describe('run docker with version', function () {
    it('should have benchmark results', async () => {
	var request = {
	    compiler: version,
	    optim: 3,
	    cppVersion: 17,
	    isAnnotated: "true",
	    force: "true"
	};
	expect(version).to.be.ok;
	const done = await app.execute('system-test/testfile/test', request);
	const parsed = JSON.parse(done.res);
	expect(parsed.benchmarks).to.have.length(2);
	expect(done.annotation).to.be.ok;
	expect(done.annotation.split('\n')).to.have.lengthOf.above(7);
	expect(done.annotation).to.have.string('BM_StringCreation');
	expect(done.annotation).to.have.string('BM_StringCopy');
	//	expect(done.stdout).to.be.empty; // Removed because of a Docker message on my Ubuntu version.
	console.log(done.stdout);
	expect(done.annotation).to.be.ok;
    }).timeout(120000);
})

describe('check compiler version inside docker', function() {
    it('should have the same version', async () => {
        const exec = require('child_process').exec;
        let options = {
            timeout: 60000,
            killSignal: 'SIGKILL'
        };
        console.log(`${__dirname}/testfile/version.cpp`);
        const result = await new Promise(resolve => exec(`docker run --rm -v ${__dirname}/testfile/version.cpp:/home/builder/bench-file.cpp -t fredtingaud/quick-bench:${version} /bin/bash -c "./build && ./run"`, options, (error, stdout, stderr) => {
{'fraction_non_alphanumeric': 0.1636998254799302, 'fraction_numerical': 0.010820244328097731, 'mean_word_length': 3.5205047318611986, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3582448', 'n_tokens_mistral': 939, 'n_tokens_neox': 885, 'n_words': 206}